EgtInterface 1.6e2 :

- esecutore e lua scorporato in EgtExecutor.
This commit is contained in:
Dario Sassi
2015-05-05 22:14:56 +00:00
parent e7ee6d9255
commit 8bc0e986b2
60 changed files with 454 additions and 16260 deletions
+14 -128
View File
@@ -14,205 +14,91 @@
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "API.h"
#include "API_Macro.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EGnStringConverter.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include "/EgtDev/Include/EXeExecutor.h"
using namespace std ;
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSelectObj( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// seleziono l'oggetto
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) ;
return ( ExeSelectObj( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtDeselectObj( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// deseleziono l'oggetto
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) ;
return ( ExeDeselectObj( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSelectAll( bool bOnlyIfVisible)
__stdcall EgtSelectAll( BOOL bOnlyIfVisible)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// seleziono tutto
int nId1 = EgtGetFirstPart( bOnlyIfVisible) ;
while ( nId1 != GDB_ID_NULL) {
// ciclo sugli oggetti del pezzo
int nId2 = pGeomDB->GetFirstInGroup( nId1) ;
while ( nId2 != GDB_ID_NULL) {
// se è gruppo seleziono i suoi componenti
if ( pGeomDB->GetGdbType( nId2) == GDB_TY_GROUP)
pGeomDB->SelectGroupObjs( nId2, 0, bOnlyIfVisible) ;
// altrimenti lo seleziono direttamente
else
pGeomDB->SelectObj( nId2, bOnlyIfVisible) ;
// passo al successivo
nId2 = pGeomDB->GetNext( nId2) ;
}
// passo al successivo
nId1 = EgtGetNextPart( nId1, bOnlyIfVisible) ;
}
// 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 ;
return ( ExeSelectAll( ( bOnlyIfVisible != FALSE)) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtDeselectAll( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// deseleziono tutto
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) ;
return ( ExeDeselectAll() ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSelectGroupObjs( int nGroupId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// 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 = "EgtSelectGroupObjs(" + ToString( nGroupId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
return ( ExeSelectGroupObjs( nGroupId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtDeselectGroupObjs( int nGroupId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// 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 = "EgtDeselectGroupObjs(" + ToString( nGroupId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
return ( ExeDeselectGroupObjs( nGroupId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtIsSelectedObj( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// verifico se l'oggetto è selezionato
return ( pGeomDB->IsSelectedObj( nId) ? TRUE : FALSE) ;
return ( ExeIsSelectedObj( nId) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtGetSelectedObjNbr( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, 0)
// restituisco il numero di oggetti selezionati
return pGeomDB->GetSelectedObjNbr() ;
return ExeGetSelectedObjNbr() ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtGetFirstSelectedObj( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero il primo oggetto selezionato
return pGeomDB->GetFirstSelectedObj() ;
return ExeGetFirstSelectedObj() ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtGetNextSelectedObj( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero il successivo oggetto selezionato
return pGeomDB->GetNextSelectedObj() ;
return ExeGetNextSelectedObj() ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtGetLastSelectedObj( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero l'ultimo oggetto selezionato
return pGeomDB->GetLastSelectedObj() ;
return ExeGetLastSelectedObj() ;
}
//-----------------------------------------------------------------------------
int
__stdcall EgtGetPrevSelectedObj( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero il precedente oggetto selezionato
return pGeomDB->GetPrevSelectedObj() ;
return ExeGetPrevSelectedObj() ;
}