Compare commits

...

5 Commits

Author SHA1 Message Date
Daniele Bariletti 16b7208962 EgtExecutor :
- corretto un commento.
2024-05-23 09:32:29 +02:00
Daniele Bariletti 7c6c48b8b8 EgtExecutor :
- tolti refusi da un altro ramo.
2024-05-22 16:41:05 +02:00
Daniele Bariletti 2f3d1a84ef EgtExecutor :
- aggiunta la funzione per modificare lo smooth angle delle surf trimesh.
2024-05-22 16:35:13 +02:00
Dario Sassi 2221934f3c Merge commit 'e4f45df79ad5c4fc5c8442557e5db129c0c7ce70' 2024-05-20 09:02:10 +02:00
Dario Sassi 0424900a2b EgtExecutor 2.6e4 :
- aggiunta funzione Exe e Lua VerifyKeyOption (nel parametro OptInd le centinaia indicano il numero di opzione, il resto indica il numero del bit).
2024-05-16 12:55:37 +02:00
8 changed files with 86 additions and 59 deletions
+3 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2023
// EgalTech 2014-2024
//----------------------------------------------------------------------------
// File : EXE.h Data : 05.02.23 Versione : 2.5a6
// File : EXE.h Data : 15.05.24 Versione : 2.6e4
// Contenuto : Dichiarazioni locali per moduli EXE.
//
//
@@ -26,6 +26,7 @@ const std::string& ExeGetIniFile( void) ;
const std::string& ExeGetKey( void) ;
const std::string& ExeGetNestKey( void) ;
const std::string& ExeGetLockId( void) ;
bool ExeVerifyKeyOption( int nOptInd) ;
//----------------------------------------------------------------------------
ILogger* GetLogger( void) ;
+1 -34
View File
@@ -677,37 +677,4 @@ ExeCurveCompoNormVersor( int nId, int nSimpCrv, int nRefId, Vector3d& vtNorm)
}
// gestione trasformazione ( eventuale)
return TransformVector( pGeomDB, nId, nRefId, vtNorm) ;
}
//----------------------------------------------------------------------------
bool
ExeShowBezierCurveControlPoints( int nCrvId, int* pnCount)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la curva di bezier
const ICurveBezier* pCrvBezier = GetCurveBezier( pGeomDB->GetGeoObj( nCrvId)) ;
if ( pCrvBezier == nullptr || pCrvBezier->GetType() != CRV_BEZIER)
return false ;
int nParent = pGeomDB->GetParentId( nCrvId) ;
int nDeg = pCrvBezier->GetDegree() ;
bool bRat = pCrvBezier->IsRational() ;
int nFirstId = -1 ;
int nCount = 0 ;
for ( int i = 0 ; i < nDeg + 1 ; ++i) {
IGeoPoint3d* pGeoPt( CreateGeoPoint3d()) ;
if ( ! bRat)
pGeoPt->Set( pCrvBezier->GetControlPoint( i)) ;
else
pGeoPt->Set( pCrvBezier->GetControlPoint( i) * pCrvBezier->GetControlWeight( i)) ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParent, pGeoPt) ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
if ( nId != GDB_ID_NULL)
++nCount ;
}
// restituisco i risultati
if ( pnCount != nullptr)
*pnCount = nCount ;
return nFirstId ;
}
}
+21
View File
@@ -1214,3 +1214,24 @@ ExeSurfBzTrim( int nId, int nCutterId)
}
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeSurfTmSetSmoothAng( int nId, double dAngDeg)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la superficie trimseh da trimmare
ISurfTriMesh* pSrfTm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
if ( pSrfTm == nullptr)
return false ;
pSrfTm->SetSmoothAngle( dAngDeg) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtSurfTmSetSmoothAng(" + ToString( nId) + "," +
ToString( dAngDeg) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
return true ;
}
+29
View File
@@ -35,6 +35,7 @@
#include "/EgtDev/Include/EgtIniFile.h"
#include "/EgtDev/Include/EgtLogger.h"
#include "/EgtDev/Include/EgtStringConverter.h"
#include "/EgtDev/Include/EgtKeyCodes.h"
#include "/EgtDev/Include/SELkLockId.h"
#include "/EgtDev/Include/SELkKeyProc.h"
#include <fstream>
@@ -352,6 +353,34 @@ ExeGetNetHwKey( void)
return s_bNetHwKey ;
}
//-----------------------------------------------------------------------------
bool
ExeVerifyKeyOption( int nOptInd)
{
// recupero le opzioni abilitate
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( ! ExeGetNetHwKey())
nRet = GetKeyOptions( ExeGetKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
// verifico validità chiave con licenza
if ( nRet != KEY_OK || nOptExpDays < GetCurrDay())
return false ;
// verifico le opzioni (nOptInd = 100 -> bit 0 di Opt1 ... = 200 -> bit 0 di Opt2 ... = 231 -> bit 31 di Opt2)
if ( nOptInd >= 100 && nOptInd <= 131) {
unsigned int nOptVal = ( 1 << ( nOptInd - 100)) ;
return ( ( nOpt1 & nOptVal) != 0) ;
}
else if ( nOptInd >= 200 && nOptInd <= 231) {
unsigned int nOptVal = ( 1 << ( nOptInd - 200)) ;
return ( ( nOpt2 & nOptVal) != 0) ;
}
else
return false ;
}
//-----------------------------------------------------------------------------
bool
ExeSetFont( const string& sNfeFontDir, const string& sDefaultFont)
BIN
View File
Binary file not shown.
-23
View File
@@ -531,28 +531,6 @@ LuaCurveCompoNormVersor( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaShowBezierCurveControlPoint( lua_State* L)
{
// 1 parametro : nCrvId
int nCrvId ;
LuaCheckParam( L, 1, nCrvId)
LuaClearStack( L) ;
int nCount = 0 ;
int nId = ExeShowBezierCurveControlPoints( nCrvId, &nCount) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL) {
LuaSetParam( L, nId) ;
LuaSetParam( L, nCount) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 2 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbGetCurve( LuaMgr& luaMgr)
@@ -584,6 +562,5 @@ LuaInstallGdbGetCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoRadius", LuaCurveCompoRadius) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoAngCenter", LuaCurveCompoAngCenter) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoNormVersor", LuaCurveCompoNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtShowBezierCurveControlPoints", LuaShowBezierCurveControlPoint) ;
return bOk ;
}
+17
View File
@@ -582,6 +582,22 @@ LuaSurfBzTrim( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSurfTmSetSmoothAng( lua_State* L)
{
// 2 parametri : nId, nCutterId
int nId ;
LuaCheckParam( L, 1, nId)
double dAngDeg ;
LuaCheckParam( L, 2, dAngDeg)
LuaClearStack( L) ;
// aggiorno lo smooth angle della superficie
bool bOk = ExeSurfTmSetSmoothAng( nId, dAngDeg) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallGdbModifySurf( LuaMgr& luaMgr)
@@ -616,5 +632,6 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetShowEdges", LuaSurfTmSetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetShowEdges", LuaSurfTmGetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBzTrim", LuaSurfBzTrim) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetSmoothAng", LuaSurfTmSetSmoothAng) ;
return bOk ;
}
+15
View File
@@ -1083,6 +1083,20 @@ LuaGetMsg( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaVerifyKeyOption( lua_State* L)
{
// 1 parametro : nOptInd
int nOptInd ;
LuaCheckParam( L, 1, nOptInd)
LuaClearStack( L) ;
// verifico l'abilitazione dell'opzione (da chiave + licenza)
bool bOk = ExeVerifyKeyOption( nOptInd) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaWinExec( lua_State* L)
@@ -1384,6 +1398,7 @@ LuaInstallGeneral( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtIs64bit", LuaIs64bit) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetLanguage", LuaGetLanguage) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtMsg", LuaGetMsg) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVerifyKeyOption", LuaVerifyKeyOption) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtDialogBox", LuaDialogBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtWinExec", LuaWinExec) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCloseExe", LuaCloseExe) ;