EgtInterface 1.5k2 :
- aggiunta EgtCreateSurfTriMeshRuled - aggiunta EgtExplodeText - aggiunte EgtExtendCurve*ByLen e EgtExplodeCurveBezier - aggiunte EgtSelectAll, EgtSelectPartObjs, EgtDeselectPartObjs, EgtSelectLayerObjs, EgtDeselectLayerObjs, EgtGetLastSelectedObj, EgtGetPrevSelectedObj - aggiunte EgtIntersectionPoint, EgtPointToIdGlob.
This commit is contained in:
+166
-21
@@ -25,70 +25,215 @@ using namespace std ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSelectObj( int nId)
|
||||
{
|
||||
__stdcall EgtSelectObj( int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// seleziono l'oggetto
|
||||
return ( pGeomDB->SelectObj( nId) ? TRUE : FALSE) ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtDeselectObj( int nId)
|
||||
{
|
||||
__stdcall EgtDeselectObj( int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// deseleziono l'oggetto
|
||||
return ( pGeomDB->DeselectObj( nId) ? TRUE : FALSE) ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtDeselectAll( void)
|
||||
{
|
||||
__stdcall EgtSelectAll( bool bOnlyIfVisible)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// seleziono tutto
|
||||
int nId1 = pGeomDB->GetFirstInGroup( GDB_ID_ROOT) ;
|
||||
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 = pGeomDB->GetNext( nId1) ;
|
||||
}
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtDeselectAll( void)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// deseleziono tutto
|
||||
return ( pGeomDB->ClearSelection() ? TRUE : FALSE) ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtIsSelectedObj( int nId)
|
||||
{
|
||||
__stdcall EgtSelectPartObjs( int nPartId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// 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) ;
|
||||
}
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtDeselectPartObjs( int nPartId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// 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) ;
|
||||
}
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSelectLayerObjs( int nLayerId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// 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
|
||||
pGeomDB->SelectObj( nId) ;
|
||||
// passo al successivo
|
||||
nId = pGeomDB->GetNext( nId) ;
|
||||
}
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtDeselectLayerObjs( int nLayerId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// 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
|
||||
pGeomDB->DeselectObj( nId) ;
|
||||
// passo al successivo
|
||||
nId = pGeomDB->GetNext( nId) ;
|
||||
}
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtIsSelectedObj( int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// verifico se l'oggetto è selezionato
|
||||
return ( pGeomDB->IsSelectedObj( nId) ? TRUE : FALSE) ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtGetSelectedObjNbr( void)
|
||||
{
|
||||
__stdcall EgtGetSelectedObjNbr( void)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, 0)
|
||||
// restituisco il numero di oggetti selezionati
|
||||
return pGeomDB->GetSelectedObjNbr() ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtGetFirstSelectedObj( void)
|
||||
{
|
||||
__stdcall EgtGetFirstSelectedObj( void)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero il primo oggetto selezionato
|
||||
return pGeomDB->GetFirstSelectedObj() ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtGetNextSelectedObj( void)
|
||||
{
|
||||
__stdcall EgtGetNextSelectedObj( void)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero il successivo oggetto selezionato
|
||||
return pGeomDB->GetNextSelectedObj() ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtGetLastSelectedObj( void)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero l'ultimo oggetto selezionato
|
||||
return pGeomDB->GetLastSelectedObj() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtGetPrevSelectedObj( void)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero il precedente oggetto selezionato
|
||||
return pGeomDB->GetPrevSelectedObj() ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user