From 5aebd3a8734bf56c2744ed4c808bbd5c36646ef2 Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Wed, 27 Nov 2024 16:03:05 +0100 Subject: [PATCH 01/24] Include: - in GeoObjSave, aggiunta funzione di salvataggio. --- EGkGeoObjSave.h | 207 +++++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 116 deletions(-) diff --git a/EGkGeoObjSave.h b/EGkGeoObjSave.h index db2c349..a046f10 100644 --- a/EGkGeoObjSave.h +++ b/EGkGeoObjSave.h @@ -15,6 +15,7 @@ #include "/EgtDev/Include/EGkGeomDB.h" #include "/EgtDev/Include/EgtPointerOwner.h" +#include "/EgtDev/Include/EGkSurfFlatRegion.h" //---------------------------------------------------------------------------- @@ -130,122 +131,6 @@ SaveGeoObj( std::vector> vvpGObj, std::vector vCol, return bOk ; } -//---------------------------------------------------------------------------- -bool -SaveCurveCompo( ICRVCOMPOPOVECTOR& vCompo, bool bUniform, const std::string& sFile, int nFlag = GDB_SV_BIN) -{ - // controllo validità delle curve - std::vector vpGObj ; - for ( int i = 0 ; i < int( vCompo.size()) ; ++ i) { - if ( vCompo[i] == nullptr || ! vCompo[i]->IsValid()) - return false ; - vpGObj.emplace_back( static_cast( vCompo[i]->Clone())) ; - } - // creo GeomDB temporaneo - PtrOwner pGeomDB( CreateGeomDB()) ; - if ( IsNull( pGeomDB)) - return false ; - INTVECTOR vIds ; - - // se curve con colore uniforme - if ( bUniform) - return SaveGeoObj( vpGObj, sFile, nFlag) ; - - // altrimenti scorro le sottocurve e le coloro in base alle temp prop - int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ; - int nLayId = 0 ; - for ( int i = 0 ; i < int( vCompo.size()) ; ++i) { - // inserisco l'oggetto nel GeomDB (sotto pezzo/layer) - nLayId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ; - for ( int u = 0 ; u < vCompo[i]->GetCurveCount() ; ++ u) { - const ICurve* pCrv = vCompo[i]->GetCurve( u) ; - if ( pCrv == nullptr) - return false ; - int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nLayId, pCrv->Clone()) ; - pGeomDB->SetMaterial( nId, ( pCrv->GetTempProp( 0) == 1 ? RED : - ( pCrv->GetTempProp( 0)) == 0 ? BLUE : WHITE)) ; - vIds.push_back( nId) ; - if ( nId == GDB_ID_NULL) - return false ; - } - } - // eseguo il salvataggio - bool bOk = pGeomDB->Save( vIds, sFile, nFlag) ; - // rimuovo l'oggetto dal GeomDB - for ( int i = 0 ; i < int( vIds.size()); ++i) - bOk = ( pGeomDB->RemoveGeoObjAndErase( vIds[i]) != nullptr) && bOk ; - - return bOk ; - -} - -bool SaveVoronoi( const ICRVCOMPOPOVECTOR& vCrvsCompo, const ICURVEPOVECTOR& vBisectors, - bool bUniform, const std::string& sFile, int nFlag = GDB_SV_BIN) -{ - // controllo validità delle curve - std::vector vpGObj_crv ; - for ( int i = 0 ; i < int( vCrvsCompo.size()) ; ++ i) { - if ( vCrvsCompo[i] == nullptr || ! vCrvsCompo[i]->IsValid()) - return false ; - vpGObj_crv.emplace_back( static_cast( vCrvsCompo[i]->Clone())) ; - } - std::vector vpGObj_bisect ; - for ( int i = 0 ; i < int( vBisectors.size()) ; ++ i) { - if ( vBisectors[i] == nullptr || ! vBisectors[i]->IsValid()) - return false ; - vpGObj_bisect.emplace_back( static_cast( vBisectors[i]->Clone())) ; - } - - // creo GeomDB temporaneo - PtrOwner pGeomDB( CreateGeomDB()) ; - if ( IsNull( pGeomDB)) - return false ; - INTVECTOR vIds ; - - // salvo le curve - int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ; - int nLayId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ; - pGeomDB->SetName( nLayId, "Curves") ; - for ( int i = 0 ; i < int( vpGObj_crv.size()) ; ++i) { - // inserisco l'oggetto nel GeomDB - int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nLayId, vpGObj_crv[i]->Clone()) ; - if ( nId == GDB_ID_NULL) - return false ; - vIds.push_back( nId) ; - pGeomDB->SetMaterial( nId, LIME) ; - } - - // salvo i bisettori - nLayId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ; - pGeomDB->SetName( nLayId, "Bisectors") ; - for ( int i = 0 ; i < int( vpGObj_bisect.size()) ; ++i) { - // inserisco l'oggetto nel GeomDB - int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nLayId, vpGObj_bisect[i]->Clone()) ; - if ( nId == GDB_ID_NULL) - return false ; - vIds.push_back( nId) ; - if ( bUniform) - pGeomDB->SetMaterial( nId, RED) ; - else { - if ( vBisectors[i]->GetTempParam( 0) < EPS_SMALL || - vBisectors[i]->GetTempParam( 1) < EPS_SMALL) - pGeomDB->SetMaterial( nId, ORANGE) ; - else - pGeomDB->SetMaterial( nId, RED) ; - } - pGeomDB->SetInfo( nId, "START_PARAM", vBisectors[i]->GetTempParam( 0)) ; - pGeomDB->SetInfo( nId, "END_PARAM", vBisectors[i]->GetTempParam( 1)) ; - } - - // eseguo il salvataggio - bool bOk = pGeomDB->Save( vIds, sFile, nFlag) ; - // rimuovo l'oggetto dal GeomDB - for ( int i = 0 ; i < int( vIds.size()); ++i) - bOk = ( pGeomDB->RemoveGeoObjAndErase( vIds[i]) != nullptr) && bOk ; - - return bOk ; -} - bool SaveSfrBooleans( const ISurfFlatRegion* pSfrA, const ISurfFlatRegion* pSfrB, const std::string& sFile, int nFlag = GDB_SV_BIN, Color cColA = Color( 0., .5, .75, .5), Color cColB = Color( 0., .5, 0., .5)) @@ -277,5 +162,95 @@ bool SaveSfrBooleans( const ISurfFlatRegion* pSfrA, const ISurfFlatRegion* pSfrB for ( int i = 0 ; i < int( vIds.size()) ; ++i) bOk = ( pGeomDB->RemoveGeoObjAndErase( vIds[i]) != nullptr) && bOk ; + return bOk ; +} + +//---------------------------------------------------------------------------- +bool +SaveGeoObj( std::vector> vvpGObj, std::vector> vvCol, + const std::string& sFile, int nFlag = GDB_SV_BIN) +{ + // verifico validità oggetti + for ( int i = 0 ; i < int( vvpGObj.size()) ; ++ i) { + for ( int j = 0 ; j < int( vvpGObj[i].size()) ; ++ j) { + if ( vvpGObj[i][j] == nullptr || ! vvpGObj[i][j]->IsValid()) + return false ; + } + } + + // creo GeomDB temporaneo + PtrOwner pGeomDB( CreateGeomDB()) ; + if ( IsNull( pGeomDB)) + return false ; + INTVECTOR vIds ; + + // creo il part + int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ; + + // per ogni elemento i-esimo, creo un layer + for ( int i = 0 ; i < int( vvpGObj.size()) ; ++i) { + // creo il layer + int nLayId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ; + for ( int j = 0 ; j < int( vvpGObj[i].size()) ; ++ j ) { + // inserisco gli oggetti corrispondenti + int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nLayId, vvpGObj[i][j]) ; + if ( nId == GDB_ID_NULL) + return false ; + // setto il colore ( se definito) + if ( i < int( vvCol.size()) && j < int( vvCol[i].size())) + pGeomDB->SetMaterial( nId, vvCol[i][j]) ; + vIds.push_back( nId) ; + } + } + + // eseguo il salvataggio + bool bOk = pGeomDB->Save( vIds, sFile, nFlag) ; + // rimuovo l'oggetto dal GeomDB + for ( int i = 0 ; i < int( vIds.size()) ; ++i) + bOk = ( pGeomDB->RemoveGeoObjAndErase( vIds[i]) != nullptr) && bOk ; + + return bOk ; +} + +//---------------------------------------------------------------------------- +bool +SaveGeoObj( std::vector vpGObj, std::vector vCol, + const std::string& sFile, int nFlag = GDB_SV_BIN) +{ + // verifico validità oggetti + if ( int( vpGObj.size()) != int( vCol.size())) + return false ; + + // creo GeomDB temporaneo + PtrOwner pGeomDB( CreateGeomDB()) ; + if ( IsNull( pGeomDB)) + return false ; + INTVECTOR vIds ; + + // creo il part + int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ; + // creo il layer + int nLayId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ; + + // scorro gli elementi da visualizzare + for ( int i = 0 ; i < int( vpGObj.size()) ; ++ i) { + if ( vpGObj[i] == nullptr || ! vpGObj[i]->IsValid()) + continue ; + // inserisco gli oggetti corrispondenti + int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nLayId, vpGObj[i]) ; + if ( nId == GDB_ID_NULL) + return false ; + // setto il colore + pGeomDB->SetMaterial( nId, vCol[i]) ; + // aggiungo l'Id ottenuto + vIds.push_back( nId) ; + } + + // eseguo il salvataggio + bool bOk = pGeomDB->Save( vIds, sFile, nFlag) ; + // rimuovo l'oggetto dal GeomDB + for ( int i = 0 ; i < int( vIds.size()) ; ++i) + bOk = ( pGeomDB->RemoveGeoObjAndErase( vIds[i]) != nullptr) && bOk ; + return bOk ; } \ No newline at end of file From 3b65b5c13a71fb5579ed244d5d12749dbda830d3 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 29 Nov 2024 18:56:58 +0100 Subject: [PATCH 02/24] Include : - aggiunta interfaccia IImportOff - aggiornamento codici mensili di protezione delle librerie. --- EExImportOff.h | 38 ++++++++++++++++++++++++++++++++++++++ EGkPolyLine.h | 2 ++ EInAPI.h | 1 + EXeConst.h | 5 +++-- EXeExecutor.h | 1 + EgtKeyCodes.h | 2 +- 6 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 EExImportOff.h diff --git a/EExImportOff.h b/EExImportOff.h new file mode 100644 index 0000000..1e16dd9 --- /dev/null +++ b/EExImportOff.h @@ -0,0 +1,38 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : EExImportOff.h Data : 28.11.24 Versione : 2.6k2 +// Contenuto : Dichiarazione della interfaccia IImportOff. +// +// +// +// Modifiche : 28.11.24 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkGeomDB.h" +#include + +//----------------------- Macro per import/export ---------------------------- +#undef EEK_EXPORT +#if defined( I_AM_EEX) // da definirsi solo nella DLL + #define EEX_EXPORT __declspec( dllexport) +#else + #define EEX_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +class __declspec( novtable) IImportOff +{ + public : + virtual ~IImportOff( void) {} + virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup, double dScaleFactor = 1) = 0 ; +} ; + +//----------------------------------------------------------------------------- +extern "C" { + EEX_EXPORT IImportOff* CreateImportOff( void) ; +} diff --git a/EGkPolyLine.h b/EGkPolyLine.h index 88de9de..5c94cc2 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -113,6 +113,7 @@ class PolyLine EGK_EXPORT bool MakeConvex( const Vector3d& vtN, bool bLeftSide) ; EGK_EXPORT bool Invert( bool bInvertU = true) ; EGK_EXPORT bool Flatten( double dZ = 0) ; + EGK_EXPORT bool FlattenInAutoPlane( double dToler = 10 * EPS_SMALL) ; EGK_EXPORT bool GetConvexHullXY( PNTVECTOR& vConvHull) const ; EGK_EXPORT bool GetMinAreaRectangleXY( Point3d& ptCen, Vector3d& vtAx, double& dLen, double& dHeight) const ; EGK_EXPORT bool Trim( const Plane3d& plPlane, bool bInVsOut = true) ; @@ -126,6 +127,7 @@ class PolyLine bool MyChangeStart( int nPos) ; bool MyApproxOnSide( const Vector3d& vtN, bool bLeftSide, double dToler = EPS_SMALL) ; bool MyMakeConvex( const Vector3d& vtN, bool bLeftSide) ; + bool MyRemoveSamePoints( double dToler = EPS_SMALL) ; private : int m_nRejected ; // numero punti rifiutati perchè coincidenti diff --git a/EInAPI.h b/EInAPI.h index 04e4a3e..fb795e1 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -116,6 +116,7 @@ EIN_EXPORT BOOL __stdcall EgtImportCsf( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtImportDxf( const wchar_t* wsFilePath, double dScaleFactor) ; EIN_EXPORT BOOL __stdcall EgtImportPnt( const wchar_t* wsFilePath, int nFlag) ; EIN_EXPORT BOOL __stdcall EgtImportStl( const wchar_t* wsFilePath, double dScaleFactor) ; +EIN_EXPORT BOOL __stdcall EgtImportOff( const wchar_t* wsFilePath, double dScaleFactor) ; EIN_EXPORT BOOL __stdcall EgtImport3MF( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtImport3dm( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtAdvancedImportIsEnabled( void) ; diff --git a/EXeConst.h b/EXeConst.h index 181478a..767b3cd 100644 --- a/EXeConst.h +++ b/EXeConst.h @@ -28,8 +28,9 @@ enum FileType { FT_NULL = 0, FT_SVG = 18, FT_BTLX = 19, FT_3MF = 20, - FT_OBJ = 21, - FT_3DM = 22 , + FT_OBJ = 21, + FT_3DM = 22, + FT_OFF = 23, FT_IGES = 31, FT_STEP = 32, FT_ACIS = 33, diff --git a/EXeExecutor.h b/EXeExecutor.h index e29ab4a..f356196 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -124,6 +124,7 @@ EXE_EXPORT bool ExeImportCsf( const std::string& sFilePath) ; EXE_EXPORT bool ExeImportDxf( const std::string& sFilePath, double dScaleFactor) ; EXE_EXPORT bool ExeImportPnt( const std::string& sFilePath, int nFlag) ; EXE_EXPORT bool ExeImportStl( const std::string& sFilePath, double dScaleFactor) ; +EXE_EXPORT bool ExeImportOff( const std::string& sFilePath, double dScaleFactor) ; EXE_EXPORT bool ExeImport3MF( const std::string& sFilePath) ; EXE_EXPORT bool ExeImport3dm( const std::string& sFilePath) ; EXE_EXPORT bool ExeAdvancedImportIsEnabled( void) ; diff --git a/EgtKeyCodes.h b/EgtKeyCodes.h index 3e9438b..e728d3a 100644 --- a/EgtKeyCodes.h +++ b/EgtKeyCodes.h @@ -25,7 +25,7 @@ //---------------------------------------------------------------------------- const int KEY_BASELIB_PROD = 207 ; -const int KEY_BASELIB_VER = 2611 ; +const int KEY_BASELIB_VER = 2612 ; const int KEY_BASELIB_LEV = 1 ; //---------------------------------------------------------------------------- From a311b4bd0f46484b0e512f60b413a47e76f7d145 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 4 Dec 2024 10:07:33 +0100 Subject: [PATCH 03/24] Include : - aggiunte costanti SURFFIN_SUB_Z_CONST e SURFFIN_SUB_OPTIMAL per tipo finitura superfici. --- EMkMachiningConst.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/EMkMachiningConst.h b/EMkMachiningConst.h index 7486e42..c97246b 100644 --- a/EMkMachiningConst.h +++ b/EMkMachiningConst.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2015-2024 //---------------------------------------------------------------------------- -// File : EmkMachiningConst.h Data : 29.03.24 Versione : 2.6di1 +// File : EmkMachiningConst.h Data : 04.12.24 Versione : 2.6l2 // Contenuto : Costanti delle lavorazioni. // // @@ -14,6 +14,7 @@ // 04.02.22 DS Agg. MPA_EPICYCLESRAD e MPA_EPICYCLESDIST. // 06.09.23 DS Agg. 5AxMachining. // 29.03.24 DS Agg. MGP_APPROXLINTOL. +// 04.12.24 ES Agg. SURFFIN_SUB_Z_CONST e SURFFIN_SUB_OPTIMAL. // //---------------------------------------------------------------------------- @@ -390,7 +391,9 @@ enum { SURFROU_LO_NONE = 0, enum { SURFFIN_SUB_ZIGZAG = 0, SURFFIN_SUB_ONEWAY = 1, SURFFIN_SUB_SPIRALIN = 2, - SURFFIN_SUB_SPIRALOUT = 3} ; + SURFFIN_SUB_SPIRALOUT = 3, + SURFFIN_SUB_Z_CONST = 4, + SURFFIN_SUB_OPTIMAL = 5} ; // Tipo di attacco enum { SURFFIN_LI_NONE = 0, SURFFIN_LI_LINEAR = 1, From 916c8bf793d71e7e77f104d6ef9cc8570d559786 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 4 Dec 2024 15:00:55 +0100 Subject: [PATCH 04/24] Include : - aggiornamento prototipi. --- EGkStmStandard.h | 7 ++++--- EGkSurfTriMesh.h | 1 - EMkMachMgr.h | 1 + EXeExecutor.h | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/EGkStmStandard.h b/EGkStmStandard.h index 0e9578c..5a5d4df 100644 --- a/EGkStmStandard.h +++ b/EGkStmStandard.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2015 +// EgalTech 2015-2024 //---------------------------------------------------------------------------- -// File : EGkStmStandard.h Data : 31.03.15 Versione : 1.6c7 +// File : EGkStmStandard.h Data : 04.12.24 Versione : 2.6l2 // Contenuto : Dichiarazione funzioni per creazione superfici Stm // standard : Box, Pyramid, Cylinder, Sphere, Cone. // // // Modifiche : 31.03.15 DS Creazione modulo. -// +// 04.12.24 DS Aggiunta GetSurfTriMeshEmpty. // //---------------------------------------------------------------------------- @@ -24,6 +24,7 @@ #endif //---------------------------------------------------------------------------- +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshEmpty( void) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshBox( double dDimX, double dDimY, double dHeight, bool bRegular = false) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshPyramid( double dDimX, double dDimY, double dHeight) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshCylinder( double dRadius, double dHeight, double dLinTol) ; diff --git a/EGkSurfTriMesh.h b/EGkSurfTriMesh.h index 8a9da18..bda355e 100644 --- a/EGkSurfTriMesh.h +++ b/EGkSurfTriMesh.h @@ -50,7 +50,6 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual bool RemoveTriangle( int nId) = 0 ; virtual bool AdjustTopology( void) = 0 ; virtual bool CreateByFlatContour( const PolyLine& PL) = 0 ; - virtual bool CreateByRegion( const POLYLINEVECTOR& vPL, const INTMATRIX& vnPLIndMat) = 0 ; virtual bool CreateByExtrusion( const PolyLine& PL, const Vector3d& vtExtr) = 0 ; virtual bool CreateByPointCurve( const Point3d& ptP, const PolyLine& PL) = 0 ; virtual bool CreateByTwoCurves( const PolyLine& PL1, const PolyLine& PL2, int nRuledType) = 0 ; diff --git a/EMkMachMgr.h b/EMkMachMgr.h index 86504d3..177cb16 100644 --- a/EMkMachMgr.h +++ b/EMkMachMgr.h @@ -280,6 +280,7 @@ class __declspec( novtable) IMachMgr virtual bool GetClEntMove( int nEntId, int& nMove) const = 0 ; virtual bool GetClEntFlag( int nEntId, int& nFlag, int& nFlag2) const = 0 ; virtual bool GetClEntIndex( int nEntId, int& nIndex) const = 0 ; + virtual bool GetClEntAxesStatus( int nEntId, int& nStatus) const = 0 ; virtual bool GetClEntAxesMask( int nEntId, int& nMask) const = 0 ; virtual bool GetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) const = 0 ; // Simulation diff --git a/EXeExecutor.h b/EXeExecutor.h index f356196..25ee0a6 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -1234,6 +1234,7 @@ EXE_EXPORT bool ExeUpdateAllMachiningsEx( bool bStopOnFirstErr, std::string& sEr EXE_EXPORT bool ExeGetClEntMove( int nEntId, int& nMove) ; EXE_EXPORT bool ExeGetClEntFlag( int nEntId, int& nFlag, int& nFlag2) ; EXE_EXPORT bool ExeGetClEntIndex( int nEntId, int& nIndex) ; +EXE_EXPORT bool ExeGetClEntAxesStatus( int nEntId, int& nStatus) ; EXE_EXPORT bool ExeGetClEntAxesMask( int nEntId, int& nMask) ; EXE_EXPORT bool ExeGetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) ; From 9d7e968fb7ffa163af52e281a36dabcabb0a5885 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 5 Dec 2024 17:38:36 +0100 Subject: [PATCH 05/24] Include : - migliorie e correzioni a funzioni inline per accedere a variabili globali strutturate lua. --- EGnLuaAux.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/EGnLuaAux.h b/EGnLuaAux.h index 7babf7b..e5883e3 100644 --- a/EGnLuaAux.h +++ b/EGnLuaAux.h @@ -528,13 +528,21 @@ LuaGetGlobVar( lua_State* L, const std::string& sVar, T& Val) int nTokenCnt = int( vsTokens.size()) ; if ( nTokenCnt < 2) return false ; - lua_getglobal( L, vsTokens[0].c_str()) ; + if ( lua_getglobal( L, vsTokens[0].c_str()) != LUA_TTABLE) { + lua_pop( L, 1) ; + return false ; + } for ( int nInd = 1 ; nInd <= nTokenCnt - 2 ; ++ nInd) { + bool bOk ; int nField ; if ( FromString( vsTokens[nInd], nField)) - lua_rawgeti( L, -1, nField) ; + bOk = ( lua_rawgeti( L, -1, nField) == LUA_TTABLE) ; else - lua_getfield( L, -1, vsTokens[nInd].c_str()) ; + bOk = ( lua_getfield( L, -1, vsTokens[nInd].c_str()) == LUA_TTABLE) ; + if ( ! bOk) { + lua_pop( L, nInd + 1) ; + return false ; + } } bool bOk = LuaGetTabFieldParam( L, -1, vsTokens[nTokenCnt-1].c_str(), Val) ; lua_pop( L, nTokenCnt - 1) ; @@ -563,7 +571,10 @@ LuaSetGlobVar( lua_State* L, const std::string& sVar, const T& Val) int nTokenCnt = int( vsTokens.size()) ; if ( nTokenCnt < 2) return false ; - lua_getglobal( L, vsTokens[0].c_str()) ; + if ( lua_getglobal( L, vsTokens[0].c_str()) != LUA_TTABLE) { + lua_pop( L, 1) ; + return false ; + } for ( int nInd = 1 ; nInd <= nTokenCnt - 2 ; ++ nInd) { int nField ; bool bNumber = FromString( vsTokens[nInd], nField) ; @@ -603,7 +614,10 @@ LuaResetGlobVar( lua_State* L, const std::string& sVar) int nTokenCnt = int( vsTokens.size()) ; if ( nTokenCnt < 2) return false ; - lua_getglobal( L, vsTokens[0].c_str()) ; + if ( lua_getglobal( L, vsTokens[0].c_str()) != LUA_TTABLE) { + lua_pop( L, 1) ; + return false ; + } for ( int nInd = 1 ; nInd <= nTokenCnt - 2 ; ++ nInd) { int nField ; bool bNumber = FromString( vsTokens[nInd], nField) ; From 2549d720df74a0f452a575f036ca0ac45494bb3c Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Thu, 12 Dec 2024 11:50:56 +0100 Subject: [PATCH 06/24] Include : - in CavSilhouette aggiunte funzioni per calcolo silhouette all'interno di una regione piana. --- EGkCAvSilhouetteSurfTm.h | 6 ++++++ EGkCAvToolSurfTm.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/EGkCAvSilhouetteSurfTm.h b/EGkCAvSilhouetteSurfTm.h index 48381ee..6168150 100644 --- a/EGkCAvSilhouetteSurfTm.h +++ b/EGkCAvSilhouetteSurfTm.h @@ -31,8 +31,14 @@ class __declspec( novtable) ICAvParSilhouettesSurfTm { public : virtual ~ICAvParSilhouettesSurfTm( void) {} + // generica virtual bool SetData( const CISURFTMPVECTOR& vpStm, const Frame3d& frPlanes, double dTol) = 0 ; virtual bool GetSilhouette( double dLevel, POLYLINEVECTOR& vPL) = 0 ; + // con regione piana + virtual bool SetDataForRegion( const CISURFTMPVECTOR& vpStm, const ISurfFlatRegion* pSfr, double dSideAng, + double dDiam, double dCornRad, double dMaxMat, double dOffsR, + double dSampleTol = 10 * EPS_SMALL, double dSharpedAngTol = 15.) = 0 ; + virtual bool GetSilhouetteInsideRegion( double dLevel, POLYLINEVECTOR& vPL) = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkCAvToolSurfTm.h b/EGkCAvToolSurfTm.h index 60d7339..c3a4ee7 100644 --- a/EGkCAvToolSurfTm.h +++ b/EGkCAvToolSurfTm.h @@ -37,6 +37,9 @@ class __declspec( novtable) ICAvToolSurfTm { virtual bool SetGenTool( const ICurveComposite* pToolOutline) = 0 ; virtual double GetToolRadius( void) const = 0 ; virtual double GetToolHeight( void) const = 0 ; + virtual double GetToolTipHeight( void) const = 0 ; + virtual double GetToolTipRadius( void) const = 0 ; + virtual double GetToolCornRadius( void) const = 0 ; virtual const ICurveComposite& GetToolOutline( bool bApprox = false) const = 0 ; virtual bool TestPosition( const Point3d& ptT, const Vector3d& vtDir, const Vector3d& vtMove, double& dTotDist, Vector3d* pvtTriaN = nullptr) const = 0 ; From 0dd9b62386d892a65c7e9a422b72773404ef2862 Mon Sep 17 00:00:00 2001 From: SaraP Date: Mon, 16 Dec 2024 10:54:39 +0100 Subject: [PATCH 07/24] Include : - aggiornamento prototipi per conservare la gerarchia nell'importazione 3MF. --- EExImport3MF.h | 5 ++++- EXeExecutor.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/EExImport3MF.h b/EExImport3MF.h index 7cb15f8..935108a 100644 --- a/EExImport3MF.h +++ b/EExImport3MF.h @@ -29,10 +29,13 @@ class __declspec( novtable) IImport3MF { public : virtual ~IImport3MF( void) {} - virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup) = 0 ; + virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup, int nFlag = 0) = 0 ; } ; //----------------------------------------------------------------------------- extern "C" { EEX_EXPORT IImport3MF* CreateImport3MF( void) ; } + +enum EIm3MFFlag { EI3FLAG_NONE = 0x0000, + EI3FLAG_KEEP_GROUPS = 0x0001} ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 25ee0a6..6ed1963 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -125,7 +125,7 @@ EXE_EXPORT bool ExeImportDxf( const std::string& sFilePath, double dScaleFactor) EXE_EXPORT bool ExeImportPnt( const std::string& sFilePath, int nFlag) ; EXE_EXPORT bool ExeImportStl( const std::string& sFilePath, double dScaleFactor) ; EXE_EXPORT bool ExeImportOff( const std::string& sFilePath, double dScaleFactor) ; -EXE_EXPORT bool ExeImport3MF( const std::string& sFilePath) ; +EXE_EXPORT bool ExeImport3MF( const std::string& sFilePath, int nFlag = 0) ; EXE_EXPORT bool ExeImport3dm( const std::string& sFilePath) ; EXE_EXPORT bool ExeAdvancedImportIsEnabled( void) ; EXE_EXPORT bool ExeAdvancedImport( const std::string& sFilePath, double dToler = 0.1, int nFlag = 0) ; From bc0ac3c33621ba8b1165c11bb2791e729b9f20fb Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 17 Dec 2024 10:20:54 +0100 Subject: [PATCH 08/24] Include : - aggiornamento prototipi. --- EInAPI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EInAPI.h b/EInAPI.h index fb795e1..a45d76d 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -117,7 +117,7 @@ EIN_EXPORT BOOL __stdcall EgtImportDxf( const wchar_t* wsFilePath, double dScale EIN_EXPORT BOOL __stdcall EgtImportPnt( const wchar_t* wsFilePath, int nFlag) ; EIN_EXPORT BOOL __stdcall EgtImportStl( const wchar_t* wsFilePath, double dScaleFactor) ; EIN_EXPORT BOOL __stdcall EgtImportOff( const wchar_t* wsFilePath, double dScaleFactor) ; -EIN_EXPORT BOOL __stdcall EgtImport3MF( const wchar_t* wsFilePath) ; +EIN_EXPORT BOOL __stdcall EgtImport3MF( const wchar_t* wsFilePath, int nFlag) ; EIN_EXPORT BOOL __stdcall EgtImport3dm( const wchar_t* wsFilePath) ; EIN_EXPORT BOOL __stdcall EgtAdvancedImportIsEnabled( void) ; EIN_EXPORT BOOL __stdcall EgtAdvancedImport( const wchar_t* wsFilePath, double dLinToler, int nFlag) ; From 3ecbb9b55a4705cad3901b514506a8bba2d88b23 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 19 Dec 2024 10:50:03 +0100 Subject: [PATCH 09/24] Include : - aggiunti prototipi. --- EXeExecutor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/EXeExecutor.h b/EXeExecutor.h index 6ed1963..826652e 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -461,6 +461,7 @@ EXE_EXPORT int ExeGetFirstNameInGroup( int nGroupId, const std::string& sName) EXE_EXPORT int ExeGetNextName( int nId, const std::string& sName) ; EXE_EXPORT int ExeGetLastNameInGroup( int nGroupId, const std::string& sName) ; EXE_EXPORT int ExeGetPrevName( int nId, const std::string& sName) ; +EXE_EXPORT bool ExeGetInfoInGroup( int nGroupId, const std::string& sKey, INTVECTOR& vIds) ; EXE_EXPORT bool ExeGetBBox( int nId, int nFlag, BBox3d& b3Box) ; EXE_EXPORT bool ExeGetBBoxGlob( int nId, int nFlag, BBox3d& b3Box) ; EXE_EXPORT bool ExeGetBBoxRef( int nId, int nFlag, const Frame3d& frRef, BBox3d& b3Box) ; From 59a4239226d6b01cbaca902ada266d3b43b6cf6e Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 23 Dec 2024 12:02:03 +0100 Subject: [PATCH 10/24] Include : - aggiornamento prototipi. --- EXeExecutor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/EXeExecutor.h b/EXeExecutor.h index 826652e..e377ac1 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -461,6 +461,7 @@ EXE_EXPORT int ExeGetFirstNameInGroup( int nGroupId, const std::string& sName) EXE_EXPORT int ExeGetNextName( int nId, const std::string& sName) ; EXE_EXPORT int ExeGetLastNameInGroup( int nGroupId, const std::string& sName) ; EXE_EXPORT int ExeGetPrevName( int nId, const std::string& sName) ; +EXE_EXPORT bool ExeGetNameInGroup( int nGroupId, const std::string& sName, INTVECTOR& vIds) ; EXE_EXPORT bool ExeGetInfoInGroup( int nGroupId, const std::string& sKey, INTVECTOR& vIds) ; EXE_EXPORT bool ExeGetBBox( int nId, int nFlag, BBox3d& b3Box) ; EXE_EXPORT bool ExeGetBBoxGlob( int nId, int nFlag, BBox3d& b3Box) ; From fd4b84807f184f5259afb89b18cdc288f48176b2 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 3 Jan 2025 12:16:52 +0100 Subject: [PATCH 11/24] Include : - modifiche a FromString con double per uso libreria fast_float. --- EGnStringUtils.h | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/EGnStringUtils.h b/EGnStringUtils.h index 34002ac..6b828e1 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -15,6 +15,7 @@ #include "/EgtDev/Include/EgtStringBase.h" #include "/EgtDev/Include/EgtNumCollection.h" +#include "/EgtDev/Extern/fast_float/fast_float.h" #include #include @@ -123,6 +124,7 @@ ValidateDxfName( std::string& sName, bool bAdvanced) } //---------------------------------------------------------------------------- +#define FAST_FLOAT_FMT fast_float::chars_format::general | fast_float::chars_format::allow_leading_plus | fast_float::chars_format::skip_white_space inline bool FromString( const std::string& sVal, int& nVal) { const char* pStart = sVal.c_str() ; @@ -146,11 +148,8 @@ FromString( const std::string& sVal, bool& bVal) return true ; } inline bool FromString( const std::string& sVal, double& dVal) - { const char* pStart = sVal.c_str() ; - char* pStop ; - errno = 0 ; - dVal = strtod( pStart, &pStop) ; - return ( pStop != pStart && errno == 0) ; } + { auto answer = fast_float::from_chars( sVal.data(), sVal.data() + sVal.size(), dVal, FAST_FLOAT_FMT) ; + return ( answer.ec == std::errc() && answer.ptr != sVal.data()) ; } template bool FromString( const std::string& sVal, int (&nVal)[size]) { const char* pStart = sVal.c_str() ; @@ -166,29 +165,25 @@ bool FromString( const std::string& sVal, int (&nVal)[size]) } template bool FromString( const std::string& sVal, double (&dVal)[size]) - { const char* pStart = sVal.c_str() ; - char* pStop ; - errno = 0 ; + { const char* pFirst = sVal.data() ; for ( int i = 0 ; i < size ; ++ i) { - dVal[i] = strtod( pStart, &pStop) ; - if ( ( i < size - 1 && *pStop != ',') || errno != 0) + auto answer = fast_float::from_chars( pFirst, sVal.data() + sVal.size(), dVal[i], FAST_FLOAT_FMT) ; + if ( answer.ec != std::errc() || ( i < size - 1 && answer.ptr[0] != ',')) return false ; - pStart = pStop + 1 ; + pFirst = answer.ptr + 1 ; } - return ( errno == 0) ; + return true ; } template bool FromString( const std::string& sVal, std::array& dVal) - { const char* pStart = sVal.c_str() ; - char* pStop ; - errno = 0 ; + { const char* pFirst = sVal.data() ; for ( int i = 0 ; i < size ; ++ i) { - dVal[i] = strtod( pStart, &pStop) ; - if ( ( i < size - 1 && *pStop != ',') || errno != 0) + auto answer = fast_float::from_chars( pFirst, sVal.data() + sVal.size(), dVal[i], FAST_FLOAT_FMT) ; + if ( answer.ec != std::errc() || ( i < size - 1 && answer.ptr[0] != ',')) return false ; - pStart = pStop + 1 ; + pFirst = answer.ptr + 1 ; } - return ( errno == 0) ; + return true ; } EGN_EXPORT bool FromString( const std::string& sVal, INTVECTOR& vnVal) ; EGN_EXPORT bool FromString( const std::string& sVal, DBLVECTOR& vdVal) ; From 481a86c2fa149cfcd7c03f4076cf059f3e133859 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 6 Jan 2025 18:12:49 +0100 Subject: [PATCH 12/24] Include : - modifiche a FromString con integer per uso libreria fast_float. --- EGnStringUtils.h | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/EGnStringUtils.h b/EGnStringUtils.h index 6b828e1..bf39928 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -125,20 +125,15 @@ ValidateDxfName( std::string& sName, bool bAdvanced) //---------------------------------------------------------------------------- #define FAST_FLOAT_FMT fast_float::chars_format::general | fast_float::chars_format::allow_leading_plus | fast_float::chars_format::skip_white_space +#define FAST_FLOAT_OPTS fast_float::parse_options( FAST_FLOAT_FMT) inline bool FromString( const std::string& sVal, int& nVal) - { const char* pStart = sVal.c_str() ; - char* pStop ; - errno = 0 ; - nVal = strtol( pStart, &pStop, 10) ; - return ( pStop != pStart && errno == 0) ; } + { auto answer = fast_float::from_chars_advanced( sVal.data(), sVal.data() + sVal.size(), nVal, FAST_FLOAT_OPTS) ; + return ( answer.ec == std::errc() && answer.ptr != sVal.data()) ; } inline bool FromString( const std::string& sVal, unsigned int& nVal) - { const char* pStart = sVal.c_str() ; - char* pStop ; - errno = 0 ; - nVal = strtoul( pStart, &pStop, 10) ; - return ( pStop != pStart && errno == 0) ; } + { auto answer = fast_float::from_chars_advanced( sVal.data(), sVal.data() + sVal.size(), nVal, FAST_FLOAT_OPTS) ; + return ( answer.ec == std::errc() && answer.ptr != sVal.data()) ; } inline bool FromString( const std::string& sVal, bool& bVal) { int nTmp ; @@ -152,16 +147,14 @@ FromString( const std::string& sVal, double& dVal) return ( answer.ec == std::errc() && answer.ptr != sVal.data()) ; } template bool FromString( const std::string& sVal, int (&nVal)[size]) - { const char* pStart = sVal.c_str() ; - char* pStop ; - errno = 0 ; + { const char* pFirst = sVal.data() ; for ( int i = 0 ; i < size ; ++ i) { - nVal[i] = strtol( pStart, &pStop, 10) ; - if ( ( i < size - 1 && *pStop != ',') || errno != 0) + auto answer = fast_float::from_chars_advanced( pFirst, sVal.data() + sVal.size(), nVal[i], FAST_FLOAT_OPTS) ; + if ( answer.ec != std::errc() || ( i < size - 1 && answer.ptr[0] != ',')) return false ; - pStart = pStop + 1 ; + pFirst = answer.ptr + 1 ; } - return ( errno == 0) ; + return true ; } template bool FromString( const std::string& sVal, double (&dVal)[size]) From 6c57d57be14c1d902b339b932227b86fb096f738 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 9 Jan 2025 17:53:27 +0100 Subject: [PATCH 13/24] Include : - aggiornamento codici protezione librerie a 27 - aggiornamento ToString con uso std::to_chars. --- EGnStringUtils.h | 25 +++++++++++++------------ EgtBase64.h | 6 +++--- EgtKeyCodes.h | 7 ++++--- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/EGnStringUtils.h b/EGnStringUtils.h index bf39928..2b20a4a 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -18,6 +18,7 @@ #include "/EgtDev/Extern/fast_float/fast_float.h" #include #include +#include //----------------------- Macro per import/export ----------------------------- #undef EGN_EXPORT @@ -187,12 +188,12 @@ inline const std::string ToString( int nVal, int nPrec = 1, int nRadix = 10) { // eseguo conversione - char szBuff[24] ; - int nErr = _itoa_s( nVal, szBuff, nRadix) ; - // se errore, ritorno stringa opportuna - if ( nErr != 0) { - _ASSERT( 0) ; - return "#Error" ; + const int nBuffSize = 36 ; + char szBuff[nBuffSize]{} ; + auto Res = std::to_chars( szBuff, szBuff + nBuffSize - 1, nVal, nRadix) ; + if ( Res.ec != std::errc()) { + std::string sOut = make_error_code( Res.ec).message() ; + return "#Error (" + sOut + ")" ; } // verifico lunghezza minima int nLen = (int) strlen( szBuff) ; @@ -207,12 +208,12 @@ inline const std::string ToString( unsigned int nVal, int nPrec = 1, int nRadix = 10) { // eseguo conversione - char szBuff[24] ; - int nErr = _ultoa_s( nVal, szBuff, nRadix) ; - // se errore, ritorno stringa opportuna - if ( nErr != 0) { - _ASSERT( 0) ; - return "#Error" ; + const int nBuffSize = 36 ; + char szBuff[nBuffSize]{} ; + auto Res = std::to_chars( szBuff, szBuff + nBuffSize - 1, nVal, nRadix) ; + if ( Res.ec != std::errc()) { + std::string sOut = make_error_code( Res.ec).message() ; + return "#Error (" + sOut + ")" ; } // verifico lunghezza minima int nLen = (int) strlen( szBuff) ; diff --git a/EgtBase64.h b/EgtBase64.h index eabfc63..ead01c8 100644 --- a/EgtBase64.h +++ b/EgtBase64.h @@ -101,9 +101,9 @@ B64Decode( const std::string& sB64Sou, std::string& sDest) if ( p != nullptr) nVal = char( p - EncB64) ; in[phase] = (( c < 43 || c > 122) ? -1 : (int) DecB64[ c - 43]) ; - if ( in[phase] != 0 ) - in[phase] = ((in[phase] == (int)'$') ? -1 : in[phase] - 62) ; - if ( in[phase] != -1 ) { + if ( in[phase] != 0 ) + in[phase] = ((in[phase] == (int)'$') ? -1 : in[phase] - 62) ; + if ( in[phase] != -1 ) { phase = (phase + 1) % 4 ; if ( phase == 0) { decodeblock( in, sDest) ; diff --git a/EgtKeyCodes.h b/EgtKeyCodes.h index e728d3a..da6aeaf 100644 --- a/EgtKeyCodes.h +++ b/EgtKeyCodes.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2024 +// EgalTech 2015-2025 //---------------------------------------------------------------------------- -// File : EgtKeyCodes.h Data : 16.01.24 Versione : 2.6a1 +// File : EgtKeyCodes.h Data : 07.01.25 Versione : 2.7a1 // Contenuto : Costanti per codici di protezione librerie di base. // // @@ -18,6 +18,7 @@ // 01.01.22 DS Passaggio a versione 24. // 01.01.23 DS Passaggio a versione 25. // 16.01.24 DS Passaggio a versione 26. +// 07.01.25 DS Passaggio a versione 27. // //---------------------------------------------------------------------------- @@ -25,7 +26,7 @@ //---------------------------------------------------------------------------- const int KEY_BASELIB_PROD = 207 ; -const int KEY_BASELIB_VER = 2612 ; +const int KEY_BASELIB_VER = 2701 ; const int KEY_BASELIB_LEV = 1 ; //---------------------------------------------------------------------------- From 4b73f702325d3d7cd90415e7db1886e3d5bf2b7f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 10 Jan 2025 16:27:56 +0100 Subject: [PATCH 14/24] Include : - migliorie e ottimizzazioni a ToString con interi. --- EGnStringUtils.h | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/EGnStringUtils.h b/EGnStringUtils.h index 2b20a4a..8cf93e5 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -184,45 +184,47 @@ EGN_EXPORT bool FromString( const std::string& sVal, DBLVECTOR& vdVal) ; EGN_EXPORT bool FromString( const std::string& sVal, STRVECTOR& vsVal) ; //---------------------------------------------------------------------------- +EGN_EXPORT const std::string ToStringAdv( int nVal, int nPrec = 1, int nRadix = 10, int* pnErr = nullptr) ; inline const std::string -ToString( int nVal, int nPrec = 1, int nRadix = 10) +ToString( int nVal, int nPrec = 1, int nRadix = 10, int* pnErr = nullptr) { + // se necessario processing avanzato + if ( nPrec > 1 || nRadix < 6) + return ToStringAdv( nVal, nPrec, nRadix, pnErr) ; // eseguo conversione - const int nBuffSize = 36 ; + const int nBuffSize = 16 ; char szBuff[nBuffSize]{} ; auto Res = std::to_chars( szBuff, szBuff + nBuffSize - 1, nVal, nRadix) ; if ( Res.ec != std::errc()) { - std::string sOut = make_error_code( Res.ec).message() ; - return "#Error (" + sOut + ")" ; + if ( pnErr != nullptr) + *pnErr = int( Res.ec) ; + return "#Error" ; } - // verifico lunghezza minima - int nLen = (int) strlen( szBuff) ; - if ( nLen >= nPrec) - return szBuff ; - // porto la stringa alla minima lunghezza - std::string sBuff( szBuff) ; - sBuff.insert( 0, ( nPrec - nLen), '0') ; - return sBuff ; + // gestione codice di errore + if ( pnErr != nullptr) + *pnErr = 0 ; + return szBuff ; } +EGN_EXPORT const std::string ToStringAdv( unsigned int nVal, int nPrec = 1, int nRadix = 10, int* pnErr = nullptr) ; inline const std::string -ToString( unsigned int nVal, int nPrec = 1, int nRadix = 10) +ToString( unsigned int nVal, int nPrec = 1, int nRadix = 10, int* pnErr = nullptr) { + // se necessario processing avanzato + if ( nPrec > 1 || nRadix < 6) + return ToStringAdv( nVal, nPrec, nRadix, pnErr) ; // eseguo conversione - const int nBuffSize = 36 ; + const int nBuffSize = 16 ; char szBuff[nBuffSize]{} ; auto Res = std::to_chars( szBuff, szBuff + nBuffSize - 1, nVal, nRadix) ; if ( Res.ec != std::errc()) { - std::string sOut = make_error_code( Res.ec).message() ; - return "#Error (" + sOut + ")" ; + if ( pnErr != nullptr) + *pnErr = int( Res.ec) ; + return "#Error" ; } - // verifico lunghezza minima - int nLen = (int) strlen( szBuff) ; - if ( nLen >= nPrec) - return szBuff ; - // porto la stringa alla minima lunghezza - std::string sBuff( szBuff) ; - sBuff.insert( 0, ( nPrec - nLen), '0') ; - return sBuff ; + // gestione codice di errore + if ( pnErr != nullptr) + *pnErr = 0 ; + return szBuff ; } template const std::string ToString( const int (&nVal)[size], int nPrec = 1) From c47feff3948a36b4d581ac045b29a9203e479267 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 14 Jan 2025 08:44:31 +0100 Subject: [PATCH 15/24] Include : - aggiunta seconda versione di CalcNormal per normale in un punto di un triangolo come media baricentrica di quelle ai vertici. --- EGkTriangle3d.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/EGkTriangle3d.h b/EGkTriangle3d.h index e9f4e3a..c08641c 100644 --- a/EGkTriangle3d.h +++ b/EGkTriangle3d.h @@ -455,6 +455,13 @@ CalcNormal( const Point3d& ptP, const Triangle3d& Tria, const TriNormals3d& Tnor return vtNorm.Normalize( EPS_ZERO) ; } +//---------------------------------------------------------------------------- +inline bool +CalcNormal( const Point3d& ptP, const Triangle3dEx& Tria, Vector3d& vtNorm) +{ + return CalcNormal( ptP, Tria, Tria.GetTriNormals(), vtNorm) ; +} + //---------------------------------------------------------------------------- enum TriangleType { OPEN = -1, EXACT = 0, CLOSED = 1 }; From d2f7b89b04a37124717bf5b05cdae7c8d5821c30 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 15 Jan 2025 15:21:37 +0100 Subject: [PATCH 16/24] Include : - unificata proiezione di curve su superfici trimesh e bezier. --- ...jectCurveSurfTm.h => EGkProjectCurveSurf.h | 23 +++++++----- EGkProjectCurveSurfBez.h | 37 ------------------- EXeExecutor.h | 12 ++---- 3 files changed, 18 insertions(+), 54 deletions(-) rename EGkProjectCurveSurfTm.h => EGkProjectCurveSurf.h (58%) delete mode 100644 EGkProjectCurveSurfBez.h diff --git a/EGkProjectCurveSurfTm.h b/EGkProjectCurveSurf.h similarity index 58% rename from EGkProjectCurveSurfTm.h rename to EGkProjectCurveSurf.h index 368e65d..eabe957 100644 --- a/EGkProjectCurveSurfTm.h +++ b/EGkProjectCurveSurf.h @@ -15,7 +15,7 @@ #include "/EgtDev/Include/EGkGeoPoint3d.h" #include "/EgtDev/Include/EGkCurve.h" -#include "/EgtDev/Include/EGkSurfTriMesh.h" +#include "/EgtDev/Include/EGkSurf.h" //----------------------- Macro per import/export ---------------------------- #undef EGK_EXPORT @@ -43,11 +43,16 @@ typedef std::vector PNT5AXVECTOR ; // vettore di Punti 5assi //---------------------------------------------------------------------------- // Proiezione di una curva su una superficie TriMesh lungo la direzione data. -EGK_EXPORT bool ProjectCurveOnSurfTm( const ICurve& crCrv, const ISurfTriMesh& tmSurf, const Vector3d& vtDir, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; -EGK_EXPORT bool ProjectCurveOnSurfTm( const ICurve& crCrv, const ISurfTriMesh& tmSurf, const IGeoPoint3d& gpRef, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; -EGK_EXPORT bool ProjectCurveOnSurfTm( const ICurve& crCrv, const ISurfTriMesh& tmSurf, const ICurve& crRef, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; -EGK_EXPORT bool ProjectCurveOnSurfTm( const ICurve& crCrv, const ISurfTriMesh& tmSurf, const ISurfTriMesh& tmRef, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; +EGK_EXPORT bool ProjectCurveOnSurf( const ICurve& crCrv, const ISurf& sfSurf, const Vector3d& vtDir, + double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; +// Proiezione di una curva su una superficie TriMesh in direzione del punto +EGK_EXPORT bool ProjectCurveOnSurf( const ICurve& crCrv, const ISurf& sfSurf, const IGeoPoint3d& gpRef, + double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; +// Proiezione di una curva su una superficie TriMesh in direzione della curva +EGK_EXPORT bool ProjectCurveOnSurf( const ICurve& crCrv, const ISurf& sfSurf, const ICurve& crRef, + double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; +// Proiezione di una curva su una superficie TriMesh in direzione della superficie +EGK_EXPORT bool ProjectCurveOnSurf( const ICurve& crCrv, const ISurf& sfSurf, const ISurf& sfRef, + double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; +// Eliminazione punti proiettati in eccesso +EGK_EXPORT bool RemovePointsInExcess( PNT5AXVECTOR& vMyPt5ax, double dLinTol, double dMaxSegmLen, bool bTestDir = true) ; diff --git a/EGkProjectCurveSurfBez.h b/EGkProjectCurveSurfBez.h deleted file mode 100644 index 67556fd..0000000 --- a/EGkProjectCurveSurfBez.h +++ /dev/null @@ -1,37 +0,0 @@ -//---------------------------------------------------------------------------- -// EgalTech 2024-2024 -//---------------------------------------------------------------------------- -// File : EGkProjectCurveSurfTm.h Data : 07.05.24 Versione : 2.6e3 -// Contenuto : Dichiarazione funzioni proiezione curve su superficie Bezier. -// -// -// -// Modifiche : 07.05.24 DB Creazione modulo. -// -// -//---------------------------------------------------------------------------- - -#pragma once - -#include "/EgtDev/Include/EGkGeoPoint3d.h" -#include "/EgtDev/Include/EGkCurve.h" -#include "/EgtDev/Include/EGkSurfBezier.h" - -//----------------------- Macro per import/export ---------------------------- -#undef EGK_EXPORT -#if defined( I_AM_EGK) // da definirsi solo nella DLL -#define EGK_EXPORT __declspec( dllexport) -#else -#define EGK_EXPORT __declspec( dllimport) -#endif - -//---------------------------------------------------------------------------- -// Proiezione di una curva su una superficie TriMesh lungo la direzione data. -EGK_EXPORT bool ProjectCurveOnSurfBez( const ICurve& crCrv, const ISurfBezier& surfBez, const Vector3d& vtDir, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; -EGK_EXPORT bool ProjectCurveOnSurfBez( const ICurve& crCrv, const ISurfBezier& surfBez, const IGeoPoint3d& gpRef, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; -EGK_EXPORT bool ProjectCurveOnSurfBez( const ICurve& crCrv, const ISurfBezier& surfBez, const ICurve& crRef, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; -EGK_EXPORT bool ProjectCurveOnSurfBez( const ICurve& crCrv, const ISurfBezier& surfBez, const ISurfTriMesh& tmRef, - double dLinTol, double dMaxSegmLen, PNT5AXVECTOR& vPt5ax) ; diff --git a/EXeExecutor.h b/EXeExecutor.h index e377ac1..d1b8ca6 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -629,14 +629,10 @@ EXE_EXPORT bool ExeCurveCompoSetTempProp( int nId, int nCrv, int nProp, int nPro EXE_EXPORT bool ExeCurveCompoSetTempParam( int nId, int nCrv, double dParam, int nParamInd = 0) ; EXE_EXPORT bool ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType) ; EXE_EXPORT bool ExeReorderCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType) ; -EXE_EXPORT bool ExeProjectCurveOnSurfTm( int nCurveId, int nSurfTmId, const Vector3d& vtDir, int nDestGrpId, - double dLinTol, double dMaxSegmLen, int nRefType) ; -EXE_EXPORT bool ExeProjectCurveOnSurfTmExt( int nCurveId, int nSurfTmId, int nGuideId, int nDestGrpId, - double dLinTol, double dMaxSegmLen, bool bDirFromGuide) ; -EXE_EXPORT bool ExeProjectCurveOnSurfBz( int nCurveId, int nSurfBzId, const Vector3d& vtDir, int nDestGrpId, - double dLinTol, double dMaxSegmLen, int nRefType) ; -EXE_EXPORT bool ExeProjectCurveOnSurfBzExt( int nCurveId, int nSurfBzId, int nGuideId, int nDestGrpId, - double dLinTol, double dMaxSegmLen, bool bDirFromGuide) ; +EXE_EXPORT bool ExeProjectCurveOnSurf( int nCurveId, int nSurfTmId, const Vector3d& vtProj, int nDestGrpId, + double dLinTol, double dMaxSegmLen, bool bDirFromProj, int nRefType) ; +EXE_EXPORT bool ExeProjectCurveOnSurfExt( int nCurveId, int nSurfTmId, int nGuideId, int nDestGrpId, + double dLinTol, double dMaxSegmLen, bool bDirFromGuide) ; EXE_EXPORT int ExeCurveGetVoronoi( const INTVECTOR& vIds, int nDestGrpId, int nBound, int* pnCount) ; EXE_EXPORT int ExeCurveGetMedialAxis( const INTVECTOR& vIds, int nDestGrpId, int nSide, int* pnCount) ; EXE_EXPORT int ExeCurveGetFatCurve( int nId, int nDestGrpId, double dRad, bool bSquareEnds, bool bSquareMids, int* pnCount) ; From 34e42aaecead78a83c02fc737df2ac0051f363a0 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 20 Jan 2025 08:35:36 +0100 Subject: [PATCH 17/24] Include : - aggiunte costanti per TYPE utensile (per ora Std o Float). --- EMkToolConst.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EMkToolConst.h b/EMkToolConst.h index 88bd680..9eda38c 100644 --- a/EMkToolConst.h +++ b/EMkToolConst.h @@ -122,6 +122,9 @@ const std::string TTH_BASE = "B" ; // posizione base portau const std::string TTH_LEN = "H" ; // lunghezza portautensile da naso mandrino const std::string TTH_DIAM = "D" ; // diametro massimo portautensile const std::string TTH_STEM_DIAM = "D_STEM" ; // diametro massimo gambo utensile +const std::string TTH_TYPE = "TYPE" ; // stringa tipo di portautensile +const std::string TTH_TYPE_STD = "Std" ; // tipo standard (default) +const std::string TTH_TYPE_FLOAT = "Float" ; // tipo flottante //---------------------------------------------------------------------------- // Costanti per nomi di parti di utensile From d2bc22a9c3fbe737ce9e5731ea5f35bc931268f7 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 20 Jan 2025 10:49:57 +0100 Subject: [PATCH 18/24] Include : - aggiunta costante SURFFIN_SUB_PROJECT. --- EMkMachiningConst.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/EMkMachiningConst.h b/EMkMachiningConst.h index c97246b..87a1069 100644 --- a/EMkMachiningConst.h +++ b/EMkMachiningConst.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2024 +// EgalTech 2015-2025 //---------------------------------------------------------------------------- -// File : EmkMachiningConst.h Data : 04.12.24 Versione : 2.6l2 +// File : EmkMachiningConst.h Data : 20.01.25 Versione : 2.7a1 // Contenuto : Costanti delle lavorazioni. // // @@ -15,6 +15,7 @@ // 06.09.23 DS Agg. 5AxMachining. // 29.03.24 DS Agg. MGP_APPROXLINTOL. // 04.12.24 ES Agg. SURFFIN_SUB_Z_CONST e SURFFIN_SUB_OPTIMAL. +// 20.01.25 ES Agg. SURFFIN_SUB_PROJECT. // //---------------------------------------------------------------------------- @@ -393,7 +394,8 @@ enum { SURFFIN_SUB_ZIGZAG = 0, SURFFIN_SUB_SPIRALIN = 2, SURFFIN_SUB_SPIRALOUT = 3, SURFFIN_SUB_Z_CONST = 4, - SURFFIN_SUB_OPTIMAL = 5} ; + SURFFIN_SUB_OPTIMAL = 5, + SURFFIN_SUB_PROJECT = 6} ; // Tipo di attacco enum { SURFFIN_LI_NONE = 0, SURFFIN_LI_LINEAR = 1, From 34888a1204e6bc56d364f7211da7ce5c1123f271 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 23 Jan 2025 10:09:14 +0100 Subject: [PATCH 19/24] Include : - aggiunti prototipi per camera prospettica. --- EGrScene.h | 5 +++++ EInAPI.h | 2 ++ EXeExecutor.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/EGrScene.h b/EGrScene.h index a5c649c..42b0edb 100644 --- a/EGrScene.h +++ b/EGrScene.h @@ -75,6 +75,8 @@ class IEGrScene virtual bool ZoomChange( double dCoeff) = 0 ; virtual bool ZoomOnPoint( const Point3d& ptWin, double dCoeff) = 0 ; virtual bool ZoomWin( const Point3d& ptWin1, const Point3d& ptWin2) = 0 ; + virtual bool SetCameraType( bool bOrthoOrPersp) = 0 ; + virtual bool SetZoomType( int nZoomMode) = 0 ; // ShowMode virtual bool SetShowMode( int nShowMode) = 0 ; virtual int GetShowMode( void) const = 0 ; @@ -171,6 +173,9 @@ enum CameraDir { CT_NONE = 0, CT_ISO_NE = 9, CT_ISO_NW = 10, CT_CPLANE = 11} ; +//------------------------ Costanti per tipologia di zoom nel caso prospettico --------------------- +enum PerspZoom { ZT_STD = 0, + ZT_DOLLY = 1} ; //------------------------ Costanti per tipo di visualizzazione -------------- enum ShowMode { SM_WIREFRAME = 0, SM_HIDDENLINE = 1, diff --git a/EInAPI.h b/EInAPI.h index a45d76d..d8aeba1 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -1070,6 +1070,8 @@ EIN_EXPORT BOOL __stdcall EgtGetTextureDimensions( const wchar_t* wsName, double EIN_EXPORT BOOL __stdcall EgtChangeTextureDimensions( const wchar_t* wsName, double dDimX, double dDimY) ; EIN_EXPORT BOOL __stdcall EgtGetImage( int nShowMode, const int TopCol[4], const int BottomCol[4], int nWidth, int nHeight, const wchar_t* wsName) ; +EIN_EXPORT BOOL __stdcall EgtSetCameraType( BOOL bOrthoOrPersp, BOOL bRedraw) ; +EIN_EXPORT BOOL __stdcall EgtSetZoomType( int nZoomType, BOOL bRedraw) ; // Image EIN_EXPORT BOOL __stdcall EgtGetImagePixels( const wchar_t* wsFile, int* pnPixelX, int* pnPixelY) ; diff --git a/EXeExecutor.h b/EXeExecutor.h index d1b8ca6..0498744 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -1380,6 +1380,8 @@ EXE_EXPORT bool ExeGetTextureDimensions( const std::string& sName, double& dDimX EXE_EXPORT bool ExeChangeTextureDimensions( const std::string& sName, double dDimX, double dDimY) ; EXE_EXPORT bool ExeGetImage( int nShowMode, Color colBackTop, Color colBackBottom, int nWidth, int nHeight, const std::string& sFile) ; +EXE_EXPORT bool ExeSetCameraType( bool bOrthoOrPersp, bool bRedraw) ; +EXE_EXPORT bool ExeSetZoomType( int nMode, bool bRedraw) ; // Image EXE_EXPORT bool ExeGetImagePixels( const std::string& sFile, int& nPixelX, int& nPixelY) ; From 689197717c6756597861c4b966e9b8a2f9b7770a Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 23 Jan 2025 11:37:45 +0100 Subject: [PATCH 20/24] Include : - aggiornamento prototipi. --- EExImportBtl.h | 1 + EXeExecutor.h | 1 + 2 files changed, 2 insertions(+) diff --git a/EExImportBtl.h b/EExImportBtl.h index a454c68..553eb74 100644 --- a/EExImportBtl.h +++ b/EExImportBtl.h @@ -37,5 +37,6 @@ class __declspec( novtable) IImportBtl //----------------------------------------------------------------------------- extern "C" { EEX_EXPORT bool SetBtlAuxDir( const std::string& sBtlAuxDir) ; + EEX_EXPORT bool SetBtlLuaData( const std::string& sLuaLibsDir, const std::string& sLuaLastRequire) ; EEX_EXPORT IImportBtl* CreateImportBtl( void) ; } diff --git a/EXeExecutor.h b/EXeExecutor.h index 0498744..254707e 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -334,6 +334,7 @@ EXE_EXPORT int ExeCreateSurfFrRectangle3P( int nParentId, const Point3d& ptIni, const Point3d& ptCross, const Point3d& ptDir, int nRefType) ; EXE_EXPORT int ExeCreateSurfFrStadium( int nParentId, const Point3d& ptIni, const Point3d& ptCross, int nRefType) ; EXE_EXPORT int ExeCreateSurfFrDisk( int nParentId, const Point3d& ptOrig, double dRad, int nRefType) ; +EXE_EXPORT int ExeCreateSurfTmEmpty( int nParentId) ; EXE_EXPORT int ExeCreateSurfTmPlaneInBBox( int nParentId, const Point3d& ptP, const Vector3d& vtN, const BBox3d& b3Box, int nRefType) ; EXE_EXPORT int ExeCreateSurfTmConvexHullInBBox( int nParentId, int nId, const BBox3d& b3Box, int nRefType) ; EXE_EXPORT int ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, bool bRegular, int nRefType) ; From 3ad00a017fc44eb252faa0fb4233a99dc1b8f381 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 25 Jan 2025 12:10:25 +0100 Subject: [PATCH 21/24] Include : - aggiornamento prototipi. --- EBsAPI.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/EBsAPI.h b/EBsAPI.h index 9fee245..fbbb566 100644 --- a/EBsAPI.h +++ b/EBsAPI.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2024-2024 +// EgalTech 2024-2025 //---------------------------------------------------------------------------- -// File : EBsAPI.h Data : 05.10.24 Versione : 2.6j1 +// File : EBsAPI.h Data : 24.01.25 Versione : 2.7a1 // Contenuto : API (application programming interface). // // // // Modifiche : 05.10.24 DS Creazione modulo. -// +// 24.01.25 DS Aggiunta gestione messaggi. // //---------------------------------------------------------------------------- @@ -30,12 +30,27 @@ extern "C" { #endif // API +// Protezione EGTBASIS_EXPORT BOOL __stdcall EgtSetKey( const wchar_t* wsKey) ; EGTBASIS_EXPORT BOOL __stdcall EgtGetKeyLevel( int nProd, int nVer, int nLev, int* pnKLev) ; EGTBASIS_EXPORT BOOL __stdcall EgtGetKeyOptions( int nProd, int nVer, int nLev, unsigned int* pnOpt1, unsigned int* pnOpt2) ; EGTBASIS_EXPORT BOOL __stdcall EgtGetKeyLeftDays( int* pnLeftDays) ; EGTBASIS_EXPORT BOOL __stdcall EgtGetKeyAssLeftDays( int* pnAssLeftDays) ; EGTBASIS_EXPORT BOOL __stdcall EgtGetKeyOptLeftDays( int* pnOptLeftDays) ; +// Liberazione memoria blocchi dati ritornati (di solito per stringhe) +EGTBASIS_EXPORT BOOL __stdcall EgtFreeMemory( void* pMem) ; +// Messaggi +EGTBASIS_EXPORT BOOL __stdcall EgtLoadMessages( const wchar_t* wsMsgFilePath) ; +EGTBASIS_EXPORT const wchar_t* __stdcall EgtGetMsg( int nMsg) ; +// Logger +EGTBASIS_EXPORT BOOL __stdcall EgtInitLogger( int nDebug, const wchar_t* wsLogFile) ; +EGTBASIS_EXPORT BOOL __stdcall EgtOutLog( const wchar_t* wsMsg, int nDebugLevel) ; + +// Ini File +EGTBASIS_EXPORT BOOL __stdcall EgtGetStringUtf8FromIni( const wchar_t* wsSec, const wchar_t* wsKey, + const wchar_t* wsDef, wchar_t*& wsVal, const wchar_t* wsIniFile) ; +EGTBASIS_EXPORT BOOL __stdcall EgtWriteStringUtf8ToIni( const wchar_t* wsSec, const wchar_t* wsKey, + const wchar_t* wsVal, const wchar_t* wsIniFile) ; #ifdef __cplusplus } From d9d4f8c6dc1a73ab1323058dbbc8c06fb6134030 Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Fri, 31 Jan 2025 08:43:57 +0100 Subject: [PATCH 22/24] Include : - Modifiche valori delle costanti per CurveComposite/Curve in CalcPocketing. --- EGkCalcPocketing.h | 47 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/EGkCalcPocketing.h b/EGkCalcPocketing.h index 092e668..14f63d3 100644 --- a/EGkCalcPocketing.h +++ b/EGkCalcPocketing.h @@ -33,20 +33,45 @@ EGK_EXPORT bool CalcZigZagInfill( const ISurfFlatRegion* pSfr, double dStep, boo ICRVCOMPOPOVECTOR& vCrvCompoRes) ; //----------------------------------------------------------------------------- +// Sottotipo di lavorazione enum { POCKET_ZIGZAG = 0, POCKET_ONEWAY = 1, POCKET_SPIRALIN = 2, POCKET_SPIRALOUT = 3, POCKET_CONFORMAL_ZIGZAG = 4, - POCKET_CONFORMAL_ONEWAY = 5} ; + POCKET_CONFORMAL_ONEWAY = 5 +} ; -enum { TEMP_PROP_SMOOTH = -2, - TEMP_PROP_INVALID = -1, - TEMP_PROP_CLOSE_EDGE = 0, - TEMP_PROP_OPEN_EDGE = 1, - TEMP_PROP_OUT_START = 2, - TEMP_PROP_SINGLE_CURVE = 3, - TEMP_PROP_OPT_TRAPEZOID = 4, - TEMP_PROP_BORDER_CURVE = 5, - TEMP_PROP_CURVE_ACTIVE = 6, - TEMP_PROP_CURVE_INACTIVE = 7} ; +// Definizione di lato aperto e lato chiuso +enum { + TEMP_PROP_CLOSE_EDGE = 0, + TEMP_PROP_OPEN_EDGE = 1 +} ; + +// Definizione di curva invalida +enum { + TEMP_PROP_INVALID = - 1 +} ; + +// Definizione curva di raccordo per smussi +enum { + TEMP_PROP_SMOOTH = - 2 +} ; + +// Definizione tipo di curva per casi speciali +enum { + TEMP_PROP_SINGLE_CURVE = - 3, + TEMP_PROP_OPT_TRAPEZOID = - 4, + TEMP_PROP_BORDER_CURVE = - 5, +} ; + +// Definizione tipo di curva per entrate da fuori +enum { + TEMP_PROP_OUT_START = - 6 +} ; + +// Definizione di curva attiva/non attiva +enum { + TEMP_PROP_CURVE_ACTIVE = - 7, + TEMP_PROP_CURVE_INACTIVE = - 8 +} ; From d5fcae0eec986b346dd729617f5f617a64aac46b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 31 Jan 2025 08:58:44 +0100 Subject: [PATCH 23/24] Include : - aggiornamento prototipi per SetFixtureLink. --- EInAPI.h | 1 + EMkMachMgr.h | 1 + EXeExecutor.h | 1 + 3 files changed, 3 insertions(+) diff --git a/EInAPI.h b/EInAPI.h index d8aeba1..d41c9aa 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -812,6 +812,7 @@ EIN_EXPORT int __stdcall EgtGetFirstFixture( void) ; EIN_EXPORT int __stdcall EgtGetNextFixture( int nFxtId) ; EIN_EXPORT BOOL __stdcall EgtMoveFixture( int nFxtId, const double vtMove[3]) ; EIN_EXPORT BOOL __stdcall EgtRotateFixture( int nFxtId, double dDeltaAngDeg) ; +EIN_EXPORT BOOL __stdcall EgtSetFixtureLink( int nFxtId, const wchar_t* wsTaLink) ; EIN_EXPORT BOOL __stdcall EgtMoveFixtureMobile( int nFxtId, double dDeltaMov) ; EIN_EXPORT BOOL __stdcall EgtSetFixtureMobile( int nFxtId, double dMov) ; // Tools DataBase diff --git a/EMkMachMgr.h b/EMkMachMgr.h index 177cb16..b4d49f6 100644 --- a/EMkMachMgr.h +++ b/EMkMachMgr.h @@ -129,6 +129,7 @@ class __declspec( novtable) IMachMgr virtual int GetNextFixture( int nFxtId) const = 0 ; virtual bool MoveFixture( int nId, const Vector3d& vtMove) = 0 ; virtual bool RotateFixture( int nId, double dDeltaAngDeg) = 0 ; + virtual bool SetFixtureLink( int nId, const std::string& sTaLink) = 0 ; virtual bool MoveFixtureMobile( int nId, double dDeltaMov) = 0 ; virtual bool SetFixtureMobile( int nId, double dMov) = 0 ; // Tools DataBase diff --git a/EXeExecutor.h b/EXeExecutor.h index 254707e..0ef4e37 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -1081,6 +1081,7 @@ EXE_EXPORT int ExeGetFirstFixture( void) ; EXE_EXPORT int ExeGetNextFixture( int nFxtId) ; EXE_EXPORT bool ExeMoveFixture( int nFxtId, const Vector3d& vtMove) ; EXE_EXPORT bool ExeRotateFixture( int nFxtId, double dDeltaAngDeg) ; +EXE_EXPORT bool ExeSetFixtureLink( int nFxtId, const std::string& sTaLink) ; EXE_EXPORT bool ExeMoveFixtureMobile( int nFxtId, double dDeltaMove) ; EXE_EXPORT bool ExeSetFixtureMobile( int nFxtId, double dMove) ; // Tools Database From eb75cfd6e32d46b8f998198f007a7b0f07770d12 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 4 Feb 2025 14:53:30 +0100 Subject: [PATCH 24/24] Include : - aggiunta costante per chiave info di uscite attivate in sottogruppo di CL. --- EMkMachiningGeoConst.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EMkMachiningGeoConst.h b/EMkMachiningGeoConst.h index c796322..e765599 100644 --- a/EMkMachiningGeoConst.h +++ b/EMkMachiningGeoConst.h @@ -110,6 +110,8 @@ static std::string KEY_MMAX = "MMAX" ; // Chiavi info in gruppo CL per punti assi minimo e massimo di ingombro di tutta la lavorazione static std::string KEY_MAXMIN = "MAXMIN" ; static std::string KEY_MAXMAX = "MAXMAX" ; +// Chiave info in sottogruppo di CL per uscite attivate (per forature con gang drill) +static std::string KEY_DRACEX = "DRACEX" ; // Chiave info in sottogruppo di testa per abilitarne visualizzazione in Preview (0/1 default) static std::string KEY_PREVIEWSHOW = "PreviewShow" ;