EgtExecutor 3.1d1 :

- aggiunta funzione Exe/lua Redraw
- aggiunte funzioni Exe/lua SurfTmGetSmoothAng e VolZmapGetShowEdges.
This commit is contained in:
Dario Sassi
2026-04-08 19:30:11 +02:00
parent 1abcac8aa4
commit e9f368a85f
7 changed files with 110 additions and 4 deletions
+22 -1
View File
@@ -1185,7 +1185,10 @@ ExeSurfTmGetShowEdges( int nId, bool& bShow)
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pStm != nullptr) ;
// recupero lo stato di visualizzazione degli spigoli vivi
bShow = ( bOk && pStm->GetShowEdges()) ;
if ( bOk)
bShow = pStm->GetShowEdges() ;
else
bShow = false ;
return bOk ;
}
@@ -1199,6 +1202,7 @@ ExeSurfTmSetSmoothAng( int nId, double dAngDeg)
ISurfTriMesh* pSrfTm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
if ( pSrfTm == nullptr)
return false ;
// imposto l'angolo discriminante degli spigoli vivi
pSrfTm->SetSmoothAngle( dAngDeg) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
@@ -1210,6 +1214,23 @@ ExeSurfTmSetSmoothAng( int nId, double dAngDeg)
return true ;
}
//----------------------------------------------------------------------------
bool
ExeSurfTmGetSmoothAng( int nId, double& dAngDeg)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la superficie trimesh
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pStm != nullptr) ;
// recupero l'angolo discriminante degli spigoli vivi
if ( bOk)
dAngDeg = pStm->GetSmoothAngle() ;
else
dAngDeg = 0 ;
return bOk ;
}
//----------------------------------------------------------------------------
static double
GetStmOffsPrec( double dOffs, double dLinTol)
+17
View File
@@ -142,6 +142,23 @@ ExeVolZmapSetShowEdges( int nId, bool bShow)
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapGetShowEdges( int nId, bool& bShow)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero lo Zmap
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pVZM != nullptr) ;
// leggo lo stato di visualizzazione degli spigoli vivi
if ( bOk)
bShow = pVZM->GetShowEdges() ;
else
bShow = false ;
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeRemoveVolZmapPart( int nId, int nPart)
+15
View File
@@ -267,6 +267,21 @@ ExeDraw( void)
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeRedraw( void)
{
// se interfaccia disabilitata, esco subito
if ( ! ExeGetEnableUI())
return true ;
IEGrScene* pScene = GetCurrScene() ;
VERIFY_SCENE( pScene, false)
// forzo ridisegno
pScene->RedrawWindow() ;
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeSelect( int nWinX, int nWinY, int nSelW, int nSelH, int* pnSel)
BIN
View File
Binary file not shown.
+21 -2
View File
@@ -565,7 +565,7 @@ LuaSurfTmGetShowEdges( lua_State* L)
static int
LuaSurfTmSetSmoothAng( lua_State* L)
{
// 2 parametri : nId, nCutterId
// 2 parametri : nId, dAngDeg
int nId ;
LuaCheckParam( L, 1, nId)
double dAngDeg ;
@@ -577,6 +577,24 @@ LuaSurfTmSetSmoothAng( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSurfTmGetSmoothAng( lua_State* L)
{
// 1 parametro : nId
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero lo smooth angle della superficie
double dAngDeg ;
bool bOk = ExeSurfTmGetSmoothAng( nId, dAngDeg) ;
if ( bOk)
LuaSetParam( L, dAngDeg) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSurfTmOffset( lua_State* L)
@@ -664,7 +682,7 @@ LuaSurfBzTrim( lua_State* L)
bool
LuaInstallGdbModifySurf( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bool bOk = true ;
bOk = bOk && luaMgr.RegisterFunction( "EgtInvertSurf", LuaInvertSurf) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeSurf", LuaExplodeSurf) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtApproxSurf", LuaApproxSurf) ;
@@ -694,6 +712,7 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetShowEdges", LuaSurfTmSetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetShowEdges", LuaSurfTmGetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetSmoothAng", LuaSurfTmSetSmoothAng) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetSmoothAng", LuaSurfTmGetSmoothAng) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmOffset", LuaSurfTmOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmThickeningOffset", LuaSurfTmThickeningOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfBzPlane", LuaCutSurfBzPlane) ;
+20
View File
@@ -73,6 +73,25 @@ LuaVolZmapSetShowEdges( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaVolZmapGetShowEdges( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// imposto flag visualizzazione spigoli vivi
bool bShow ;
bool bOk = ExeVolZmapGetShowEdges( nId, bShow) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, bShow) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaRemoveVolZmapPart( lua_State* L)
@@ -465,6 +484,7 @@ LuaInstallGdbModifyVol( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeVolume", LuaExplodeVolume) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapChangeResolution", LuaVolZmapChangeResolution) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetShowEdges", LuaVolZmapSetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapGetShowEdges", LuaVolZmapGetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveVolZmapPart", LuaRemoveVolZmapPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetAdvTool", LuaVolZmapSetAdvTool) ;
+15 -1
View File
@@ -73,6 +73,19 @@ LuaDraw( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaRedraw( lua_State* L)
{
// nessun parametro
LuaClearStack( L) ;
// forzo ridisegno
bool bOk = ExeRedraw() ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetShowMode( lua_State* L)
@@ -378,10 +391,11 @@ LuaSetShowSurfBezierTol( lua_State* L)
bool
LuaInstallScene( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bool bOk = true ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetBackground", LuaSetBackground) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetBackground", LuaGetBackground) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtDraw", LuaDraw) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRedraw", LuaRedraw) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowMode", LuaSetShowMode) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowCurveDirection", LuaSetShowCurveDirection) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowTriaAdv", LuaSetShowTriaAdv) ;