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
+124 -59
View File
@@ -30,7 +30,15 @@ __stdcall EgtSelectObj( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// seleziono l'oggetto
return ( pGeomDB->SelectObj( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->SelectObj( nId) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSelectObj(" + ToString( nId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -40,7 +48,15 @@ __stdcall EgtDeselectObj( int nId)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// deseleziono l'oggetto
return ( pGeomDB->DeselectObj( nId) ? TRUE : FALSE) ;
bool bOk = pGeomDB->DeselectObj( nId) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtDeselectObj(" + ToString( nId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -67,6 +83,13 @@ __stdcall EgtSelectAll( bool bOnlyIfVisible)
// passo al successivo
nId1 = pGeomDB->GetNext( nId1) ;
}
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSelectAll(" + string( bOnlyIfVisible ? "true" : "false") + ")" +
" -- bOk=1" ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return TRUE ;
}
@@ -77,7 +100,15 @@ __stdcall EgtDeselectAll( void)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// deseleziono tutto
return ( pGeomDB->ClearSelection() ? TRUE : FALSE) ;
bool bOk = pGeomDB->ClearSelection() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtDeselectAll()"
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -86,23 +117,33 @@ __stdcall EgtSelectPartObjs( int nPartId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// verifico sia veramente un pezzo (gruppo sotto la radice)
if ( pGeomDB->GetGdbType( nPartId) != GDB_TY_GROUP ||
pGeomDB->GetParentId( nPartId) != GDB_ID_ROOT)
return FALSE ;
// ciclo sugli oggetti del pezzo
int nId = pGeomDB->GetFirstInGroup( nPartId) ;
while ( nId != GDB_ID_NULL) {
// se è gruppo seleziono i suoi componenti
if ( pGeomDB->GetGdbType( nId) == GDB_TY_GROUP)
pGeomDB->SelectGroupObjs( nId) ;
// altrimenti lo seleziono direttamente
else
pGeomDB->SelectObj( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
if ( pGeomDB->GetGdbType( nPartId) == GDB_TY_GROUP &&
pGeomDB->GetParentId( nPartId) == GDB_ID_ROOT) {
// ciclo sugli oggetti del pezzo
int nId = pGeomDB->GetFirstInGroup( nPartId) ;
while ( nId != GDB_ID_NULL) {
// se è gruppo seleziono i suoi componenti
if ( pGeomDB->GetGdbType( nId) == GDB_TY_GROUP)
pGeomDB->SelectGroupObjs( nId) ;
// altrimenti lo seleziono direttamente
else
pGeomDB->SelectObj( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
}
}
return TRUE ;
else
bOk = false ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSelectPartObjs(" + ToString( nPartId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -111,23 +152,33 @@ __stdcall EgtDeselectPartObjs( int nPartId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// verifico sia veramente un pezzo (gruppo sotto la radice)
if ( pGeomDB->GetGdbType( nPartId) != GDB_TY_GROUP ||
pGeomDB->GetParentId( nPartId) != GDB_ID_ROOT)
return FALSE ;
// ciclo sugli oggetti del pezzo
int nId = pGeomDB->GetFirstInGroup( nPartId) ;
while ( nId != GDB_ID_NULL) {
// se è gruppo deseleziono i suoi componenti
if ( pGeomDB->GetGdbType( nId) == GDB_TY_GROUP)
pGeomDB->DeselectGroupObjs( nId) ;
// altrimenti lo deseleziono direttamente
else
pGeomDB->DeselectObj( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
if ( pGeomDB->GetGdbType( nPartId) == GDB_TY_GROUP &&
pGeomDB->GetParentId( nPartId) == GDB_ID_ROOT) {
// ciclo sugli oggetti del pezzo
int nId = pGeomDB->GetFirstInGroup( nPartId) ;
while ( nId != GDB_ID_NULL) {
// se è gruppo deseleziono i suoi componenti
if ( pGeomDB->GetGdbType( nId) == GDB_TY_GROUP)
pGeomDB->DeselectGroupObjs( nId) ;
// altrimenti lo deseleziono direttamente
else
pGeomDB->DeselectObj( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
}
}
return TRUE ;
else
bOk = false ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtDeselectPartObjs(" + ToString( nPartId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -136,22 +187,29 @@ __stdcall EgtSelectLayerObjs( int nLayerId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// verifico sia veramente un layer (gruppo senza sottogruppi)
if ( pGeomDB->GetGdbType( nLayerId) != GDB_TY_GROUP)
return FALSE ;
// ciclo sugli oggetti del layer
int nId = pGeomDB->GetFirstInGroup( nLayerId) ;
while ( nId != GDB_ID_NULL) {
// se è gruppo errore
if ( pGeomDB->GetGdbType( nId) == GDB_TY_GROUP)
return FALSE ;
// altrimenti lo seleziono direttamente
else
if ( pGeomDB->GetGdbType( nLayerId) == GDB_TY_GROUP &&
pGeomDB->GetFirstGroupInGroup( nLayerId) == GDB_ID_NULL) {
// ciclo sugli oggetti del layer
int nId = pGeomDB->GetFirstInGroup( nLayerId) ;
while ( nId != GDB_ID_NULL) {
// seleziono
pGeomDB->SelectObj( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
}
}
return TRUE ;
else
bOk = false ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSelectLayerObjs(" + ToString( nLayerId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
@@ -160,22 +218,29 @@ __stdcall EgtDeselectLayerObjs( int nLayerId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// verifico sia veramente un layer (gruppo senza sottogruppi)
if ( pGeomDB->GetGdbType( nLayerId) != GDB_TY_GROUP)
return FALSE ;
// ciclo sugli oggetti del layer
int nId = pGeomDB->GetFirstInGroup( nLayerId) ;
while ( nId != GDB_ID_NULL) {
// se è gruppo errore
if ( pGeomDB->GetGdbType( nId) == GDB_TY_GROUP)
return FALSE ;
// altrimenti lo deseleziono direttamente
else
if ( pGeomDB->GetGdbType( nLayerId) == GDB_TY_GROUP &&
pGeomDB->GetFirstGroupInGroup( nLayerId) == GDB_ID_NULL) {
// ciclo sugli oggetti del layer
int nId = pGeomDB->GetFirstInGroup( nLayerId) ;
while ( nId != GDB_ID_NULL) {
// deseleziono
pGeomDB->DeselectObj( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
// passo al successivo
nId = pGeomDB->GetNext( nId) ;
}
}
return TRUE ;
else
bOk = false ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtDeselectLayerObjs(" + ToString( nLayerId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------