EgtInterface 1.6a2 :

- numerose modifiche e correzioni
- aggiunta registrazione comandi in formato lua
- aggiunto valutatore di espressioni.
This commit is contained in:
Dario Sassi
2015-01-14 21:56:57 +00:00
parent bebcf1ecfe
commit e23999b6a3
32 changed files with 3080 additions and 989 deletions
+78 -7
View File
@@ -226,7 +226,23 @@ __stdcall EgtCopy( int nSouId, int nRefId, int nSonBeforeAfter)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// eseguo la copia
return pGeomDB->Copy( nSouId, GDB_ID_NULL, nRefId, nSonBeforeAfter) ;
int nNewId = pGeomDB->Copy( nSouId, GDB_ID_NULL, nRefId, nSonBeforeAfter) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
if ( nSonBeforeAfter == GDB_SON)
sLua = "EgtCopy(" + ToString( nSouId) + "," +
ToString( nRefId) + ")" +
" -- Id=" + ToString( nNewId) ;
else
sLua = "EgtCopy(" + ToString( nSouId) + "," +
ToString( nRefId) + "," +
( nSonBeforeAfter == GDB_AFTER ? "'AFTER'" : "'BEFORE'") + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return nNewId ;
}
//-----------------------------------------------------------------------------
@@ -236,7 +252,23 @@ __stdcall EgtCopyGlob( int nSouId, int nRefId, int nSonBeforeAfter)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// eseguo la copia mantenendo la posizione in globale
return pGeomDB->CopyGlob( nSouId, GDB_ID_NULL, nRefId, nSonBeforeAfter) ;
int nNewId = pGeomDB->CopyGlob( nSouId, GDB_ID_NULL, nRefId, nSonBeforeAfter) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
if ( nSonBeforeAfter == GDB_SON)
sLua = "EgtCopyGlob(" + ToString( nSouId) + "," +
ToString( nRefId) + ")" +
" -- Id=" + ToString( nNewId) ;
else
sLua = "EgtCopyGlob(" + ToString( nSouId) + "," +
ToString( nRefId) + "," +
( nSonBeforeAfter == GDB_AFTER ? "'AFTER'" : "'BEFORE'") + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return nNewId ;
}
//-----------------------------------------------------------------------------
@@ -246,7 +278,23 @@ __stdcall EgtRelocate( int nSouId, int nRefId, int nSonBeforeAfter)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// eseguo la rilocazione
return ( pGeomDB->Relocate( nSouId, nRefId, nSonBeforeAfter) ? TRUE : FALSE) ;
bool bOk = pGeomDB->Relocate( nSouId, nRefId, nSonBeforeAfter) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
if ( nSonBeforeAfter == GDB_SON)
sLua = "EgtRelocate(" + ToString( nSouId) + "," +
ToString( nRefId) + ")" +
" -- Ok=" + ToString( bOk) ;
else
sLua = "EgtRelocate(" + ToString( nSouId) + "," +
ToString( nRefId) + "," +
( nSonBeforeAfter == GDB_AFTER ? "'AFTER'" : "'BEFORE'") + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -256,7 +304,23 @@ __stdcall EgtRelocateGlob( int nSouId, int nRefId, int nSonBeforeAfter)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// eseguo la rilocazione mantenendo la posizione in globale
return ( pGeomDB->RelocateGlob( nSouId, nRefId, nSonBeforeAfter) ? TRUE : FALSE) ;
bool bOk = pGeomDB->RelocateGlob( nSouId, nRefId, nSonBeforeAfter) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua ;
if ( nSonBeforeAfter == GDB_SON)
sLua = "EgtRelocateGlob(" + ToString( nSouId) + "," +
ToString( nRefId) + ")" +
" -- Ok=" + ToString( bOk) ;
else
sLua = "EgtRelocateGlob(" + ToString( nSouId) + "," +
ToString( nRefId) + "," +
( nSonBeforeAfter == GDB_AFTER ? "'AFTER'" : "'BEFORE'") + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -265,21 +329,28 @@ __stdcall EgtErase( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// eseguo cancellazione singola
if ( nId != GDB_ID_SEL) {
return ( pGeomDB->Erase( nId) ? TRUE : FALSE) ;
bOk = pGeomDB->Erase( nId) ;
}
// eseguo cancellazione dei selezionati
else {
bool bOk = true ;
int nI = pGeomDB->GetFirstSelectedObj() ;
while ( nI != GDB_ID_NULL && bOk) {
if ( ! pGeomDB->Erase( nI))
bOk = false ;
nI = pGeomDB->GetFirstSelectedObj() ;
}
return ( bOk ? TRUE : FALSE) ;
}
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtErase(" + ( nId != GDB_ID_SEL ? ToString( nId) : "GDB_ID_SEL") + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------