EgtInterface 1.6a7 :

- aggiunta gestione nome file di progetto e suo stato
- aggiunta gestione pezzo e layer
- riordino generale.
This commit is contained in:
Dario Sassi
2015-01-30 08:16:05 +00:00
parent f039e22297
commit 0c41c8c631
20 changed files with 868 additions and 178 deletions
+10 -96
View File
@@ -113,32 +113,20 @@ __stdcall EgtDeselectAll( void)
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSelectPartObjs( int nPartId)
__stdcall EgtSelectGroupObjs( int nGroupId)
{
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) {
// 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) ;
}
// verifico sia un gruppo
if ( pGeomDB->GetGdbType( nGroupId) == GDB_TY_GROUP) {
bOk = pGeomDB->SelectGroupObjs( nGroupId) ;
}
else
bOk = false ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSelectPartObjs(" + ToString( nPartId) + ")" +
string sLua = "EgtSelectGroupObjs(" + ToString( nGroupId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
@@ -148,94 +136,20 @@ __stdcall EgtSelectPartObjs( int nPartId)
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtDeselectPartObjs( int nPartId)
__stdcall EgtDeselectGroupObjs( int nGroupId)
{
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) {
// 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) ;
}
// verifico sia un gruppo
if ( pGeomDB->GetGdbType( nGroupId) == GDB_TY_GROUP) {
bOk = pGeomDB->DeselectGroupObjs( nGroupId) ;
}
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) ;
}
//-----------------------------------------------------------------------------
BOOL
__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 &&
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) ;
}
}
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) ;
}
//-----------------------------------------------------------------------------
BOOL
__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 &&
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) ;
}
}
else
bOk = false ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtDeselectLayerObjs(" + ToString( nLayerId) + ")" +
string sLua = "EgtDeselectGroupObjs(" + ToString( nGroupId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}