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:
Dario Sassi
2017-10-06 07:54:48 +00:00
parent 4821310eb7
commit ac5772a654
7 changed files with 324 additions and 0 deletions
+63
View File
@@ -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)