EgtExecutor 1.6x2 :
- modifiche per Zmap con tridexel.
This commit is contained in:
+11
-8
@@ -27,7 +27,7 @@ using namespace std ;
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, double dDimY, double dDimZ,
|
||||
double dPrec, int nRefType)
|
||||
double dPrec, bool bTriDex, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -45,7 +45,7 @@ ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, double dDim
|
||||
// creo lo Zmap nel suo riferimento intrinseco
|
||||
PtrOwner<IVolZmap> pVZM( CreateVolZmap()) ;
|
||||
bOk = bOk && ! IsNull( pVZM) ;
|
||||
bOk = bOk && pVZM->Create( ORIG, dDimX, dDimY, dDimZ, dPrec) ;
|
||||
bOk = bOk && pVZM->Create( ORIG, dDimX, dDimY, dDimZ, dPrec, bTriDex) ;
|
||||
// lo porto nel riferimento locale
|
||||
bOk = bOk && pVZM->ToGlob( frBox) ;
|
||||
// inserisco lo Zmap nel DB
|
||||
@@ -59,6 +59,7 @@ ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, double dDim
|
||||
ToString( dDimY) + "," +
|
||||
ToString( dDimZ) + "," +
|
||||
ToString( dPrec) + "," +
|
||||
( bTriDex ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
@@ -69,7 +70,7 @@ ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, double dDim
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, double dPrec)
|
||||
ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, double dPrec, bool bTriDex)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -86,7 +87,7 @@ ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, doub
|
||||
// creo lo Zmap nel suo riferimento intrinseco
|
||||
PtrOwner<IVolZmap> pVZM( CreateVolZmap()) ;
|
||||
bOk = bOk && ! IsNull( pVZM) ;
|
||||
bOk = bOk && pVZM->CreateFromFlatRegion( *pSfr, dDimZ, dPrec) ;
|
||||
bOk = bOk && pVZM->CreateFromFlatRegion( *pSfr, dDimZ, dPrec, bTriDex) ;
|
||||
// lo porto nel riferimento di destinazione
|
||||
bOk = bOk && pVZM->LocToLoc( frSfr, frDest) ;
|
||||
// inserisco lo Zmap nel DB
|
||||
@@ -97,7 +98,8 @@ ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, doub
|
||||
string sLua = "EgtVolZmapByRegionExtrusion(" + IdToString( nParentId) + "," +
|
||||
ToString( nSfrId) + "," +
|
||||
ToString( dDimZ) + "," +
|
||||
ToString( dPrec) + ")" +
|
||||
ToString( dPrec) + "," +
|
||||
( bTriDex ? "true" : "false") + ")" +
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
@@ -107,7 +109,7 @@ ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, doub
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec)
|
||||
ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDex)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -124,7 +126,7 @@ ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec)
|
||||
// creo lo Zmap nel suo riferimento intrinseco
|
||||
PtrOwner<IVolZmap> pVZM( CreateVolZmap()) ;
|
||||
bOk = bOk && ! IsNull( pVZM) ;
|
||||
bOk = bOk && pVZM->CreateFromTriMesh( *pStm, dPrec) ;
|
||||
bOk = bOk && pVZM->CreateFromTriMesh( *pStm, dPrec, bTriDex) ;
|
||||
// lo porto nel riferimento di destinazione
|
||||
bOk = bOk && pVZM->LocToLoc( frStm, frDest) ;
|
||||
// inserisco lo Zmap nel DB
|
||||
@@ -134,7 +136,8 @@ ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec)
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapFromTriMesh(" + IdToString( nParentId) + "," +
|
||||
ToString( nStmId) + "," +
|
||||
ToString( dPrec) + ")" +
|
||||
ToString( dPrec) + "," +
|
||||
( bTriDex ? "true" : "false") + ")" +
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
|
||||
Binary file not shown.
+13
-7
@@ -24,7 +24,7 @@ using namespace std ;
|
||||
static int
|
||||
LuaCreateVolZmapBox( lua_State* L)
|
||||
{
|
||||
// 5 o 6 parametri : ParentId, PtIni, dDimX, dDimY, dDimZ, dPrec [, nRefType]
|
||||
// 7 o 8 parametri : ParentId, PtIni, dDimX, dDimY, dDimZ, dPrec, bTriDex [, nRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptIni ;
|
||||
@@ -37,11 +37,13 @@ LuaCreateVolZmapBox( lua_State* L)
|
||||
LuaCheckParam( L, 5, dDimZ)
|
||||
double dPrec ;
|
||||
LuaCheckParam( L, 6, dPrec)
|
||||
bool bTriDex ;
|
||||
LuaCheckParam( L, 7, bTriDex)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 7, nRefType) ;
|
||||
LuaGetParam( L, 8, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo VZM parallelepipedo
|
||||
int nId = ExeCreateVolZmap( nParentId, ptIni, dDimX, dDimY, dDimZ, dPrec, nRefType) ;
|
||||
int nId = ExeCreateVolZmap( nParentId, ptIni, dDimX, dDimY, dDimZ, dPrec, bTriDex, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
@@ -54,7 +56,7 @@ LuaCreateVolZmapBox( lua_State* L)
|
||||
static int
|
||||
LuaCreateVolZmapByRegionExtrusion( lua_State* L)
|
||||
{
|
||||
// 4 parametri : ParentId, SfrId, dDimZ, dPrec
|
||||
// 5 parametri : ParentId, SfrId, dDimZ, dPrec, bTriDex
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
int nSfrId ;
|
||||
@@ -63,9 +65,11 @@ LuaCreateVolZmapByRegionExtrusion( lua_State* L)
|
||||
LuaCheckParam( L, 3, dDimZ)
|
||||
double dPrec ;
|
||||
LuaCheckParam( L, 4, dPrec)
|
||||
bool bTriDex ;
|
||||
LuaCheckParam( L, 5, bTriDex)
|
||||
LuaClearStack( L) ;
|
||||
// creo VZM per estrusione di flat region
|
||||
int nId = ExeCreateVolZmapByRegionExtrusion( nParentId, nSfrId, dDimZ, dPrec) ;
|
||||
int nId = ExeCreateVolZmapByRegionExtrusion( nParentId, nSfrId, dDimZ, dPrec, bTriDex) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
@@ -78,16 +82,18 @@ LuaCreateVolZmapByRegionExtrusion( lua_State* L)
|
||||
static int
|
||||
LuaCreateVolZmapFromSurfTm( lua_State* L)
|
||||
{
|
||||
// 4 parametri : ParentId, StmId, dPrec
|
||||
// 4 parametri : ParentId, StmId, dPrec, bTriDex
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
int nStmId ;
|
||||
LuaCheckParam( L, 2, nStmId)
|
||||
double dPrec ;
|
||||
LuaCheckParam( L, 3, dPrec)
|
||||
bool bTriDex ;
|
||||
LuaCheckParam( L, 4, bTriDex)
|
||||
LuaClearStack( L) ;
|
||||
// creo VZM da superficie trimesh
|
||||
int nId = ExeCreateVolZmapFromSurfTm( nParentId, nStmId, dPrec) ;
|
||||
int nId = ExeCreateVolZmapFromSurfTm( nParentId, nStmId, dPrec, bTriDex) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
|
||||
Reference in New Issue
Block a user