//---------------------------------------------------------------------------- // 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 "/EgtDev/Include/EInAPI.h" #include "/EgtDev/Include/EXeExecutor.h" #include "/EgtDev/Include/EGnStringConverter.h" using namespace std ; //----------------------------------------------------------------------------- BOOL __stdcall EgtSetLevel( int nId, int nLevel) { return ( ExeSetLevel( nId, nLevel) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtRevertLevel( int nId) { return ( ExeRevertLevel( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetLevel( int nId, int* pnLevel) { return ( ExeGetLevel( nId, pnLevel) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetCalcLevel( int nId, int* pnLevel) { return ( ExeGetCalcLevel( nId, pnLevel) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetMode( int nId, int nMode) { return ( ExeSetMode( nId, nMode) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtRevertMode( int nId) { return ( ExeRevertMode( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetMode( int nId, int* pnMode) { return ( ExeGetMode( nId, pnMode) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetCalcMode( int nId, int* pnMode) { return ( ExeGetCalcMode( nId, pnMode) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetStatus( int nId, int nStat) { INTVECTOR vIds ; vIds.push_back( nId) ; return ( ExeSetStatus( vIds, nStat) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtRevertStatus( int nId) { return ( ExeRevertStatus( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetStatus( int nId, int* pnStat) { return ( ExeGetStatus( nId, pnStat) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetCalcStatus( int nId, int* pnStat) { return ( ExeGetCalcStatus( nId, pnStat) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetMark( int nId) { return ( ExeSetMark( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtResetMark( int nId) { return ( ExeResetMark( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetMark( int nId, BOOL* pbMark) { return ( ExeGetMark( nId, pbMark) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetCalcMark( int nId, BOOL* pbMark) { return ( ExeGetCalcMark( nId, pbMark) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtStdColor( const wchar_t* wsName, int StdCol[4]) { Color ColStd ; if ( ExeStdColor( wstrztoA( wsName), ColStd)) { StdCol[0] = ColStd.GetIntRed() ; StdCol[1] = ColStd.GetIntGreen() ; StdCol[2] = ColStd.GetIntBlue() ; StdCol[3] = ColStd.GetIntAlpha() ; return TRUE ; } return FALSE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetColor( int nId, const int ObjCol[4], BOOL bSetAlpha) { // assegno indice entità INTVECTOR vIds ; vIds.push_back( nId) ; // sistemo il colore Color cCol( ObjCol) ; // eseguo return ( ExeSetColor( vIds, cCol, (bSetAlpha != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetAlpha( int nId, int nAlpha) { // assegno indice entità INTVECTOR vIds ; vIds.push_back( nId) ; // eseguo return ( ExeSetAlpha( vIds, nAlpha) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtResetColor( int nId) { // assegno indice entità INTVECTOR vIds ; vIds.push_back( nId) ; // eseguo return ( ExeResetColor( vIds) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetColor( int nId, int ObjCol[4]) { // recupero il colore Color cCol ; if ( ExeGetColor( nId, cCol)) { ObjCol[0] = cCol.GetIntRed() ; ObjCol[1] = cCol.GetIntGreen() ; ObjCol[2] = cCol.GetIntBlue() ; ObjCol[3] = cCol.GetIntAlpha() ; return TRUE ; } else return FALSE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetCalcColor( int nId, int ObjCol[4]) { // recupero il colore Color cCol ; if ( ExeGetCalcColor( nId, cCol)) { ObjCol[0] = cCol.GetIntRed() ; ObjCol[1] = cCol.GetIntGreen() ; ObjCol[2] = cCol.GetIntBlue() ; ObjCol[3] = cCol.GetIntAlpha() ; return TRUE ; } else return FALSE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetName( int nId, const wchar_t* wsName) { return ( ExeSetName( nId, wstrztoA( wsName)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetName( int nId, wchar_t*& wsName) { if ( &wsName == nullptr) return FALSE ; string sName ; if ( ! ExeGetName( nId, sName)) return FALSE ; wsName = _wcsdup( stringtoW( sName)) ; return (( wsName == nullptr) ? FALSE : TRUE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtExistsName( int nId) { return ( ExeExistsName( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtRemoveName( int nId) { return ( ExeRemoveName( nId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetInfo( int nId, const wchar_t* wsKey, const wchar_t* wsInfo) { return ( ExeSetInfo( nId, wstrztoA( wsKey), wstrztoA( wsInfo)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSetInfoInt( int nId, const wchar_t* wsKey, int nInfo) { return ( ExeSetInfo( nId, wstrztoA( wsKey), nInfo) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetInfo( int nId, const wchar_t* wsKey, wchar_t*& wsInfo) { string sInfo ; if ( ! ExeGetInfo( nId, wstrztoA( wsKey), sInfo)) return FALSE ; wsInfo = _wcsdup( stringtoW( sInfo)) ; return (( wsInfo == nullptr) ? FALSE : TRUE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtGetInfoInt( int nId, const wchar_t* wsKey, int* pnInfo) { // verifico il parametro if ( pnInfo == nullptr) return FALSE ; // recupero info return ( ExeGetInfo( nId, wstrztoA( wsKey), *pnInfo) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtExistsInfo( int nId, const wchar_t* wsKey) { return ( ExeExistsInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtRemoveInfo( int nId, const wchar_t* wsKey) { return ( ExeRemoveInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ; }