EgtExecutor 1.6h2 :

- aggiunta CreateSurfFlatRegion per EXE e LUA
- aggiunta TrimCurveWithRegion per EXE e LUA
- aggiunta ExtractSurfFrLoop per EXE e LUA.
This commit is contained in:
Dario Sassi
2015-08-07 10:48:19 +00:00
parent af849e6202
commit 064fb60719
7 changed files with 256 additions and 0 deletions
+35
View File
@@ -20,6 +20,7 @@
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EgkCurveComposite.h"
#include "/EgtDev/Include/EgkSurfFlatRegion.h"
#include "/EgtDev/Include/EgkSurfTriMesh.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
@@ -56,6 +57,40 @@ ExeInvertSurface( const INTVECTOR& vIds)
return bOk ;
}
//----------------------------------------------------------------------------
int
ExeExtractSurfFrLoop( int nId, int nLoop, int nDestGrpId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la superficie FlatRegion
const ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pSfr != nullptr) ;
// recupero il riferimento della superficie
Frame3d frSurf ;
bOk = bOk && pGeomDB->GetGlobFrame( nId, frSurf) ;
// recupero il riferimento di destinazione
Frame3d frDest ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest) ;
// richiedo la curva che costituisce il loop
PtrOwner<ICurve> pCrv( pSfr->GetLoop( nLoop)) ;
bOk = bOk && ! IsNull( pCrv) ;
// la porto nel riferimento destinazione
bOk = bOk && pCrv->LocToLoc( frSurf, frDest) ;
// la inserisco nel DB geometrico
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( pCrv)) : GDB_ID_NULL) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtExtractSurfFrLoop(" + ToString( nId) + ",{" +
ToString( nLoop) + "," +
ToString( nDestGrpId) + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
return nNewId ;
}
//----------------------------------------------------------------------------
int
ExeExtractSurfTmFacetLoops( int nId, int nFacet, int nDestGrpId, int* pnCount)