EgtExecutor :
- aggiunta a Exe e Lua funzione CreateVolZmapByRegionExtrusion.
This commit is contained in:
+39
-1
@@ -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 ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user