Files
EgtInterface/API_GdbObjAttribs.cpp
T
Dario Sassi 71254e1c04 EgtInterface 1.5i2 :
- estensione e razionalizzazione della interfaccia.
2014-09-04 12:33:41 +00:00

297 lines
9.3 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : API_GdbObjAttribs.cpp Data : 03.09.14 Versione : 1.5i1
// Contenuto : Funzioni sugli attributi degli oggetti di GeomDB per API.
//
//
//
// Modifiche : 03.09.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "API.h"
#include "API_Macro.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGnStringConverter.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
using namespace std ;
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetLevel( int nGseCtx, int nId, int nLevel)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto il livello
return ( pGeomDB->SetLevel( nId, nLevel) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtRevertLevel( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// porto il livello allo stato precedente
return ( pGeomDB->RevertLevel( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetLevel( int nGseCtx, int nId, int* pnLevel)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pnLevel == nullptr)
return FALSE ;
// recupero il livello
return ( pGeomDB->GetLevel( nId, *pnLevel) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetCalcLevel( int nGseCtx, int nId, int* pnLevel)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pnLevel == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetCalcLevel( nId, *pnLevel) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetMode( int nGseCtx, int nId, int nMode)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto il modo
return ( pGeomDB->SetMode( nId, nMode) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtRevertMode( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// porto il modo allo stato precedente
return ( pGeomDB->RevertMode( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetMode( int nGseCtx, int nId, int* pnMode)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pnMode == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetMode( nId, *pnMode) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetCalcMode( int nGseCtx, int nId, int* pnMode)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pnMode == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetCalcMode( nId, *pnMode) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetStatus( int nGseCtx, int nId, int nStat)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto il modo
return ( pGeomDB->SetStatus( nId, nStat) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtRevertStatus( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// porto lo stato al valore precedente
return ( pGeomDB->RevertStatus( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetStatus( int nGseCtx, int nId, int* pnStat)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pnStat == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetStatus( nId, *pnStat) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetCalcStatus( int nGseCtx, int nId, int* pnStat)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pnStat == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetCalcStatus( nId, *pnStat) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetMark( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto l'evidenziazione
return ( pGeomDB->SetMark( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtResetMark( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// imposto l'evidenziazione
return ( pGeomDB->ResetMark( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetMark( int nGseCtx, int nId, BOOL* pbMark)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pbMark == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetMark( nId, *pbMark) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetCalcMark( int nGseCtx, int nId, BOOL* pbMark)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico il parametro
if ( pbMark == nullptr)
return FALSE ;
// recupero il modo
return ( pGeomDB->GetCalcMark( nId, *pbMark) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetName( int nGseCtx, int nId, const wchar_t* wsName)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// assegno il nome
return ( pGeomDB->SetName( nId, wstrztoA( wsName)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetName( int nGseCtx, int nId, wchar_t*& wsName)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// recupero il nome
string sName ;
if ( ! pGeomDB->GetName( nId, sName))
return FALSE ;
wsName = _wcsdup( stringtoW( sName)) ;
return (( wsName == nullptr) ? FALSE : TRUE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtExistsName( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico esistenza del nome
return ( pGeomDB->ExistsName( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtRemoveName( int nGseCtx, int nId)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// rimuovo il nome
return ( pGeomDB->RemoveName( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetInfo( int nGseCtx, int nId, const wchar_t* wsKey, const wchar_t* wsInfo)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// assegno la info
return ( pGeomDB->SetInfo( nId, wstrztoA( wsKey), string( wstrztoA( wsInfo))) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtGetInfo( int nGseCtx, int nId, const wchar_t* wsKey, wchar_t*& wsInfo)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// recupero la info
string sInfo ;
if ( ! pGeomDB->GetInfo( nId, wstrztoA( wsKey), sInfo))
return FALSE ;
wsInfo = _wcsdup( stringtoW( sInfo)) ;
return (( wsInfo == nullptr) ? FALSE : TRUE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtExistsInfo( int nGseCtx, int nId, const wchar_t* wsKey)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico esistenza info
return ( pGeomDB->ExistsInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtRemoveInfo( int nGseCtx, int nId, const wchar_t* wsKey)
{
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// rimuovo la info
return ( pGeomDB->RemoveInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ;
}