EgtExecutor :
- aggiunta funzione exe e lua CreateSurfTmByPolygonWithHoles.
This commit is contained in:
@@ -1079,6 +1079,51 @@ ExeCreateSurfTmByPolygon( int nParentId, const PolyLine& PL, int nRefType)
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateSurfTmByPolygonWithHoles( int nParentId, const POLYLINEVECTOR& vPL, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
nParentId = AdjustId( nParentId) ;
|
||||
bool bOk = true ;
|
||||
// recupero il riferimento del gruppo destinazione
|
||||
Frame3d frDest ;
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frDest) ;
|
||||
// creo la superficie trimesh
|
||||
PtrOwner<ISurfTriMesh> pSTM( CreateSurfTriMesh()) ;
|
||||
bOk = bOk && ! IsNull( pSTM) ;
|
||||
bOk = bOk && pSTM->CreateByPolygonWithHoles( vPL) ;
|
||||
// eventuale trasformazione per riferimento di espressione dei punti
|
||||
if ( bOk && nRefType == RTY_GLOB)
|
||||
pSTM->ToLoc( frDest) ;
|
||||
else if ( bOk && nRefType == RTY_GRID)
|
||||
pSTM->LocToLoc( pGeomDB->GetGridFrame(), frDest) ;
|
||||
// inserisco la superficie nel DB
|
||||
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pSTM)) : GDB_ID_NULL) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sPnt ;
|
||||
for ( int i = 0 ; i < int( vPL.size()) ; ++ i) {
|
||||
if ( i > 0)
|
||||
sPnt += ",{0/0,0/0,0/0}," ; ;
|
||||
Point3d ptP ;
|
||||
if ( vPL[i].GetFirstPoint( ptP))
|
||||
sPnt += "{" + ToString( ptP) + "}" ;
|
||||
while ( vPL[i].GetNextPoint( ptP))
|
||||
sPnt += ",{" + ToString( ptP) + "}" ;
|
||||
}
|
||||
string sLua = "EgtSurfTmByPolygonWithHoles(" + IdToString( nParentId) + ",{" +
|
||||
sPnt + "}," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateSurfTmByFlatContour( int nParentId, int nCrvId, double dLinTol)
|
||||
|
||||
Reference in New Issue
Block a user