EgtExecutor :

- aggiunta a Exe e Lua funzione CreateVolZmapByRegionExtrusion.
This commit is contained in:
Dario Sassi
2016-10-31 19:23:34 +00:00
parent 24b91503ff
commit 20f3f5755f
2 changed files with 64 additions and 1 deletions
+39 -1
View File
@@ -65,4 +65,42 @@ ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, double dDim
}
// restituisco l'identificativo della nuova entità
return nNewId ;
}
}
//-------------------------------------------------------------------------------
int
ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, double dPrec)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
// recupero la regione
ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nSfrId)) ;
bool bOk = ( pSfr != nullptr) ;
// recupero il riferimento della regione
Frame3d frSfr ;
bOk = bOk && pGeomDB->GetGlobFrame( nSfrId, frSfr) ;
// recupero il riferimento del gruppo di destinazione
Frame3d frDest ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frDest) ;
// creo lo Zmap nel suo riferimento intrinseco
PtrOwner<IVolZmap> pVZM( CreateVolZmap()) ;
bOk = bOk && ! IsNull( pVZM) ;
bOk = bOk && pVZM->CreateMapFromFlatRegion( *pSfr, dDimZ, dPrec) ;
// lo porto nel riferimento di destinazione
bOk = bOk && pVZM->LocToLoc( frSfr, frDest) ;
// inserisco lo Zmap nel DB
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pVZM)) : GDB_ID_NULL) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtVolZmapByRegionExtrusion(" + IdToString( nParentId) + "," +
ToString( nSfrId) + "," +
ToString( dDimZ) + "," +
ToString( dPrec) + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco l'identificativo della nuova entità
return nNewId ;
}