EgtExecutor 1.8j2 :
- aggiunta fiunzione Exe e Lua CreateSurfTmByVolZmap - aggiunte funzioni Exe e Lua CopyVolZmapPart e RemoveVolZmapPart - aggiunte funzioni Exe e Lua SurfArea, SurfVolume, VolZmapVolume e VolZmapPartVolume.
This commit is contained in:
@@ -96,6 +96,69 @@ ExeExplodeVolume( int nId, int* pnCount)
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCopyVolZmapPart( int nId, int nPart, int nDestGrpId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero lo Zmap e copio la parte indicata
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pVZM == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
// recupero il suo riferimento globale
|
||||
Frame3d frVZM ;
|
||||
if ( ! pGeomDB->GetGlobFrame( nId, frVZM))
|
||||
return GDB_ID_NULL ;
|
||||
// recupero il riferimento del gruppo di destinazione
|
||||
Frame3d frDest ;
|
||||
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
|
||||
return GDB_ID_NULL ;
|
||||
// copio la parte connessa
|
||||
PtrOwner<IVolZmap> pPart( pVZM->ClonePart( nPart)) ;
|
||||
if ( IsNull( pPart))
|
||||
return GDB_ID_NULL ;
|
||||
pPart->LocToLoc( frVZM, frDest) ;
|
||||
// inserisco nel DB
|
||||
int nVZMId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nDestGrpId, GDB_LAST_SON, Release( pPart)) ;
|
||||
if ( nVZMId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
// copio gli attributi
|
||||
if ( ! pGeomDB->CopyAttributes( nId, nVZMId))
|
||||
return GDB_ID_NULL ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "ExeCopyVolZmapPart(" + ToString( nId) + "," +
|
||||
ToString( nPart) + "," +
|
||||
ToString( nDestGrpId) + ")" +
|
||||
" -- Id=" + ToString( nVZMId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
return nVZMId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeRemoveVolZmapPart( int nId, int nPart)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero lo Zmap e rimuovo la parte indicata
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr && pVZM->RemovePart( nPart)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtRemoveVolZmapPart(" + ToString( nId) + "," +
|
||||
ToString( nPart) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapSetStdTool( int nId, const string& sToolName, double dLen, double dDiam, double dCornR)
|
||||
|
||||
Reference in New Issue
Block a user