diff --git a/EE3DllMain.h b/EE3DllMain.h new file mode 100644 index 0000000..9d2418e --- /dev/null +++ b/EE3DllMain.h @@ -0,0 +1,73 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : EE3DllMain.h Data : 14.11.23 Versione : 2.5k2 +// Contenuto : Prototipi funzioni generali della DLL. +// +// +// +// Modifiche : 14.11.23 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include + +class ILogger ; + +//----------------------- Macro per import/export ---------------------------- +#undef EE3_EXPORT +#if defined( I_AM_EE3) // da definirsi solo nella DLL + #define EE3_EXPORT __declspec( dllexport) +#else + #define EE3_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +// E' necessaria l'interfaccia in C per caricare queste funzioni dinamicamente +extern "C" { + // restituisce la versione della Dll + EE3_EXPORT const char* GetEE3Version( void) ; + // permette di impostare il logger per la Dll + EE3_EXPORT void SetEE3Logger( ILogger* pLogger) ; + // imposta la chiave di protezione + EE3_EXPORT void SetEE3Key( const std::string& sKey) ; + // imposta se chiave hardware di rete + EE3_EXPORT void SetEE3NetHwKey( bool bNetHwKey) ; +} + + +//----------------------------------------------------------------------------- +#include "/EgtDev/Include/EGnStringUtils.h" +#include "/EgtDev/Include/EgtILogger.h" +#include "/EgtDev/Include/EgtKeyCodes.h" +#include "/EgtDev/Include/SELkKeyProc.h" + +//----------------------------------------------------------------------------- +// Test della chiave per caricare la DLL +inline bool +TestKeyForEE3( const std::string& sKey, int nKeyOpt, ILogger* pLogger) +{ + // verifico la chiave e le opzioni + unsigned int nOpt1, nOpt2 ; + int nOptExpDays ; + int nRet = GetKeyOptions( sKey, KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV, + nOpt1, nOpt2, nOptExpDays) ; + if ( nRet != KEY_OK && ! EqualNoCase( sKey, "EE3Base")) { + if ( nRet != KEY_OK) { + std::string sErr = "Error on Key (EE3/" + ToString( nRet) + ")" ; + LOG_ERROR( pLogger, sErr.c_str()) ; + return false ; + } + if ( ( nOpt1 & ( KEYOPT_EEX_INPBASE|KEYOPT_EEX_EXPBASE)) == 0 || + ( nKeyOpt != 0 && ( nOpt1 & nKeyOpt) == 0) || + nOptExpDays < GetCurrDay()) { + std::string sErr = "Warning on Key (EE3/OPT)" ; + LOG_ERROR( pLogger, sErr.c_str()) ; + return false ; + } + } + return true ; +} diff --git a/EE3Export3dm.h b/EE3Export3dm.h new file mode 100644 index 0000000..adbb7ad --- /dev/null +++ b/EE3Export3dm.h @@ -0,0 +1,40 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023 +//---------------------------------------------------------------------------- +// File : EE3Export3dm.h Data : 21.09.23 Versione : +// Contenuto : Dichiarazione della interfaccia IExport3dm. +// +// +// +// Modifiche : 21.09.23 DB Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkGeomDB.h" +#include "/EgtDev/Include/EExExportConst.h" +#include + +//----------------------- Macro per import/export ---------------------------- +#undef EE3_EXPORT +#if defined( I_AM_EE3) // da definirsi solo nella DLL +#define EE3_EXPORT __declspec( dllexport) +#else +#define EE3_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +class __declspec( novtable) IExport3dm +{ +public : + virtual ~IExport3dm( void) {} + virtual bool SetOptions( int nFilter) = 0 ; + virtual bool Export( IGeomDB* pGDB, int nId, const std::string& sFile) = 0 ; +} ; + +//----------------------------------------------------------------------------- +extern "C" { + EE3_EXPORT IExport3dm* CreateExport3dm(void) ; +} diff --git a/EE3Import3dm.h b/EE3Import3dm.h new file mode 100644 index 0000000..ad23959 --- /dev/null +++ b/EE3Import3dm.h @@ -0,0 +1,39 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023 +//---------------------------------------------------------------------------- +// File : EE3Import3dm.h Data : 26.06.23 Versione : 2.5f1 +// Contenuto : Dichiarazione della interfaccia IImport3dm. +// +// +// +// Modifiche : 26.06.23 DB Creazione modulo. +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkGeomDB.h" +#include + +//----------------------- Macro per import/export ---------------------------- +#undef EE3_EXPORT +#if defined( I_AM_EE3) // da definirsi solo nella DLL +#define EE3_EXPORT __declspec( dllexport) +#else +#define EE3_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +class __declspec( novtable) IImport3dm +{ +public : + virtual ~IImport3dm( void) {} + virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup, + double dTextHeight = 2.0, double dExtLine = 5.0, double dArrLen = 5.0, double dTextDist = 2.0, + bool bLenIsMM = true, int nDecDig = -2, std::string sFont = "ModernPropS.Nfe") = 0 ; +} ; + +//----------------------------------------------------------------------------- +extern "C" { + EE3_EXPORT IImport3dm* CreateImport3dm( void) ; +} diff --git a/EGkCDeBoxClosedSurfTm.h b/EGkCDeBoxClosedSurfTm.h index 5778093..733bd01 100644 --- a/EGkCDeBoxClosedSurfTm.h +++ b/EGkCDeBoxClosedSurfTm.h @@ -24,4 +24,11 @@ #endif //---------------------------------------------------------------------------- -EGK_EXPORT bool CDeBoxClosedSurfTm( const Frame3d& frBox, const Vector3d& vtDiag, double dSafeDist, const ISurfTriMesh& Stm) ; +// Il sistema di riferimento è allineato con il box e ha origine in un suo vertice. +// La distanza di sicurezza ha effetto solo se maggiore di EPS_SMALL. +// Il sistema di riferimento del box è riferito a quello della superficie. +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. +//---------------------------------------------------------------------------- +EGK_EXPORT bool CDeBoxClosedSurfTm( const Frame3d& frBox, const Vector3d& vtDiag, const ISurfTriMesh& Stm, double dSafeDist) ; diff --git a/EGkCDeClosedSurfTmClosedSurfTm.h b/EGkCDeClosedSurfTmClosedSurfTm.h index f84a1fe..142bdec 100644 --- a/EGkCDeClosedSurfTmClosedSurfTm.h +++ b/EGkCDeClosedSurfTmClosedSurfTm.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2020-2023 +// EgalTech 2020-2024 //---------------------------------------------------------------------------- -// File : EGkCDeClosedSurfTmClosedSurfTm.h Data : 14.06.23 Versione : 2.5f3 +// File : EGkCDeClosedSurfTmClosedSurfTm.h Data : 15.02.24 Versione : 2.6b2 // Contenuto : Dichiarazione funzione verifica collisione tra // SurfTm e SurfTm. // @@ -23,8 +23,10 @@ #endif //---------------------------------------------------------------------------- -// La funzione restituisce true in caso di collisone, false in caso di assenza -// di collisione o inconsistenza dei parametri di input. // Le due superfici devono essere espresse nel medesimo sistema di riferimento. // La distanza di sicurezza ha effetto solo se maggiore di EPS_SMALL. +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. +//---------------------------------------------------------------------------- EGK_EXPORT bool CDeClosedSurfTmClosedSurfTm( const ISurfTriMesh& SurfA, const ISurfTriMesh& SurfB, double dSafeDist) ; diff --git a/EGkCDeConeFrustumClosedSurfTm.h b/EGkCDeConeFrustumClosedSurfTm.h index 735c2bd..1e8666f 100644 --- a/EGkCDeConeFrustumClosedSurfTm.h +++ b/EGkCDeConeFrustumClosedSurfTm.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2020-2020 +// EgalTech 2020-2024 //---------------------------------------------------------------------------- -// File : EGkCDeConeFrustumClosedSurfTm.h Data : 09.11.20 Versione : +// File : EGkCDeConeFrustumClosedSurfTm.h Data : 15.02.24 Versione : 2.6b2 // Contenuto : Dichiarazione funzione verifica collisione tra // Cone e Closed SurfTriMesh. // @@ -23,8 +23,11 @@ #endif //---------------------------------------------------------------------------- -// Il sisitema di riferimento deve avere l'asse di simmetria del cono come asse Z e origine nel centro della base. -// La distanza di sicurezza ha effetto solo se maggiore di epsilon, altrimenti è ignorata ed è ininfluente. -// Il sistema di riferimento del cono deve essere immerso in quello della superficie. +// Il sistema di riferimento deve avere l'asse di simmetria del cono come asse Z e origine nel centro della base. +// La distanza di sicurezza ha effetto solo se maggiore di EPS_SMALL. +// Il sistema di riferimento del cono è riferito a quello della superficie. +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. EGK_EXPORT bool CDeConeFrustumClosedSurfTm( const Frame3d& frCone, double dBaseRad, double dTopRad, double dHeight, - double dSafeDist, const ISurfTriMesh& Stm) ; \ No newline at end of file + const ISurfTriMesh& Stm, double dSafeDist) ; \ No newline at end of file diff --git a/EGkCDeConvexTorusClosedSurfTm.h b/EGkCDeConvexTorusClosedSurfTm.h index 8d35834..764bd21 100644 --- a/EGkCDeConvexTorusClosedSurfTm.h +++ b/EGkCDeConvexTorusClosedSurfTm.h @@ -24,9 +24,12 @@ #endif //---------------------------------------------------------------------------- -// Il toro convesso è il disco limitato dalla sola parte esterna del toro. +// Il toro convesso è il disco solido limitato dalla sola parte esterna del toro. // Raggio principale R1, raggio secondario R2. // Il toro è posto nel piano XY del suo riferimento, centrato sull'origine. -// La funzione restituisce true in caso di collisione. +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. +//---------------------------------------------------------------------------- EGK_EXPORT bool CDeConvexTorusClosedSurfTm( const Frame3d& frTorus, double dRad1, double dRad2, - double dSafeDist, const ISurfTriMesh& tmSurf) ; + const ISurfTriMesh& tmSurf, double dSafeDist) ; diff --git a/EGkCDeCylClosedSurfTm.h b/EGkCDeCylClosedSurfTm.h index 189e1ae..4fd6fc4 100644 --- a/EGkCDeCylClosedSurfTm.h +++ b/EGkCDeCylClosedSurfTm.h @@ -23,4 +23,11 @@ #endif //---------------------------------------------------------------------------- -EGK_EXPORT bool CDeCylClosedSurfTm( const Frame3d& frCyl, double dR, double dH, double dSafeDist, const ISurfTriMesh& Stm) ; +// Il sistema di riferimento deve avere l'asse di simmetria del cilindro come asse Z e origine nel centro della base. +// La distanza di sicurezza ha effetto solo se maggiore di EPS_SMALL, altrimenti è ignorata ed è ininfluente. +// Il sistema di riferimento del cilindro è riferito a quello della superficie. +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. +//---------------------------------------------------------------------------- +EGK_EXPORT bool CDeCylClosedSurfTm( const Frame3d& frCyl, double dR, double dH, const ISurfTriMesh& Stm, double dSafeDist) ; diff --git a/EGkCDeRectPrismoidClosedSurfTm.h b/EGkCDeRectPrismoidClosedSurfTm.h index 5ad830a..4514a25 100644 --- a/EGkCDeRectPrismoidClosedSurfTm.h +++ b/EGkCDeRectPrismoidClosedSurfTm.h @@ -26,6 +26,10 @@ // Il sistema di riferimento deve avere l'origine nel centro della Base, asse X lungo // un segmento della stessa e asse Z ortogonale alle basi e diretto verso la base Top. // Il sistema di riferimento della piramide deve essere immerso in quello della superficie. +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. +//---------------------------------------------------------------------------- EGK_EXPORT bool CDeRectPrismoidClosedSurfTm( const Frame3d& frPrismoid, double dLenghtBaseX, double dLenghtBaseY, double dLenghtTopX, double dLenghtTopY, double dHeight, - double dSafeDist, const ISurfTriMesh& Stm) ; \ No newline at end of file + const ISurfTriMesh& Stm, double dSafeDist) ; \ No newline at end of file diff --git a/EGkCDeSpheClosedSurfTm.h b/EGkCDeSpheClosedSurfTm.h index abbb59a..5565721 100644 --- a/EGkCDeSpheClosedSurfTm.h +++ b/EGkCDeSpheClosedSurfTm.h @@ -23,4 +23,8 @@ #endif //---------------------------------------------------------------------------- -EGK_EXPORT bool CDeSpheClosedSurfTm( const Point3d& ptCen, double dR, double dSafeDist, const ISurfTriMesh& Stm) ; +// La funzione restituisce : +// - true in caso di collisione o inconsistenza dei parametri di input +// - false in caso di assenza di collisione. +//---------------------------------------------------------------------------- +EGK_EXPORT bool CDeSpheClosedSurfTm( const Point3d& ptCen, double dR, const ISurfTriMesh& Stm, double dSafeDist) ; diff --git a/EGkCalcPocketing.h b/EGkCalcPocketing.h new file mode 100644 index 0000000..dffa76d --- /dev/null +++ b/EGkCalcPocketing.h @@ -0,0 +1,31 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : EGkCalcPocketing.h Data : 16.11.23 Versione : 2.5j1 +// Contenuto : Calcolo dei percorsi elementari di pocketing. +// +// +// +// Modifiche : 16.11.23 RE Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurveComposite.h" +#include "/EgtDev/Include/EGkSurfFlatRegion.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 + +//----------------------------------------------------------------------------- +EGK_EXPORT bool CalcPocketing( const ISurfFlatRegion* pSfr, double dRad, double dStep, double dAngle, int nType, + bool bSmooth, ICRVCOMPOPOVECTOR& vCrv) ; +EGK_EXPORT bool CalcZigZagInfill( const ISurfFlatRegion* pSfr, double dStep, bool bSmooth, bool bRemoveOverlapLink, + ICRVCOMPOPOVECTOR& vCrvCompoRes) ; diff --git a/EGkCurveAux.h b/EGkCurveAux.h index e12d361..05221eb 100644 --- a/EGkCurveAux.h +++ b/EGkCurveAux.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2014-2014 //---------------------------------------------------------------------------- -// File : EGkCurveAux.h Data : 23.05.14 Versione : 1.5e9 +// File : EGkCurveAux.h Data : 28.01.24 Versione : 2.6a2 // Contenuto : Dichiarazione funzioni ausiliarie per ICurve. // // @@ -32,14 +32,18 @@ struct CNurbsData bool bRat ; // flag di curva razionale (pesi non tutti unitari) bool bPeriodic ; // flag per segnalare vettore dei nodi periodico bool bClosed ; // flag di curva chiusa + bool bClamped ; // flag di curva clamped bool bExtraKnotes ; // flag per segnalare presenza di nodi extra all'inizio e fine (totale 2) DBLVECTOR vU ; // vettore dei nodi PNTVECTOR vCP ; // vettore dei punti di controllo DBLVECTOR vW ; // vettore dei pesi - CNurbsData( void) : nDeg( 0), bRat( false), bPeriodic( false), bClosed( false), bExtraKnotes( false) {} + CNurbsData( void) : nDeg( 0), bRat( false), bPeriodic( false), bClosed( false), bClamped( true), bExtraKnotes(false) {} } ; +// N.B. : in caso la curva sia razionale i punti di controllo sono in forma NON OMOGENEA [ x, y, z, w] ( dove la forma OMOGENEA è [ w*x, w*y, w*z, w]) +// tutte le operazioni richiedono la forma OMOGENEA, finite le quali posso riportarmi alla forma NON OMOGENEA + //---------------------------------------------------------------------------- //! Trasforma un arco in una nuova curva di Bezier semplice o composta EGK_EXPORT ICurve* ArcToBezierCurve( const ICurve* pArc) ; @@ -74,3 +78,19 @@ EGK_EXPORT ICurve* ProjectCurveOnPlane( const ICurve& crCrv, const Plane3d& plPl //---------------------------------------------------------------------------- //! Uniforma la pendenza di una composita tra quota iniziale e finale assegnate EGK_EXPORT bool AdjustCurveSlope( ICurveComposite* pCrv, double dNini, double dNfin) ; + +//---------------------------------------------------------------------------- +//! Calcolo del diagramma di Voronoi della curva, nei TempParam dei risultati la distanza +//! Per nBound tenere valore di default. +EGK_EXPORT bool CalcCurveVoronoiDiagram( const ICurve& crvC, ICURVEPOVECTOR& vCrvs, int nBound = 3) ; + +//---------------------------------------------------------------------------- +//! Calcolo del Medial Axis della curva (sottoinsieme del diagramma di Voronoi), nei TempParam dei risultati la distanza +const int WMAT_BOTHSIDES = 0 ; +const int WMAT_LEFT = 1 ; +const int WMAT_RIGHT = 2 ; +EGK_EXPORT bool CalcCurveMedialAxis( const ICurve& crvC, ICURVEPOVECTOR& vCrvs, int nSide) ; + +//---------------------------------------------------------------------------- +//! Calcola l'offset completo di una curva +EGK_EXPORT bool CalcCurveFatCurve( const ICurve& crvC, ICURVEPOVECTOR& vCrvs, double dRadius, bool bSquareEnds, bool bSquareMids) ; diff --git a/EGkCurveComposite.h b/EGkCurveComposite.h index 48b90ec..a8d55b3 100644 --- a/EGkCurveComposite.h +++ b/EGkCurveComposite.h @@ -41,7 +41,7 @@ class __declspec( novtable) ICurveComposite : public ICurve virtual const ICurve* GetLastCurve( void) const = 0 ; virtual const ICurve* GetPrevCurve( void) const = 0 ; virtual bool IsParamAtJoint( double dU) const = 0 ; - virtual ICurve* RemoveFirstOrLastCurve( bool bLast = true) = 0 ; + virtual ICurve* RemoveFirstOrLastCurve( bool bLast = true) = 0 ; virtual bool ChangeStartPoint( double dU) = 0 ; virtual bool AddPoint( const Point3d& ptStart) = 0 ; virtual bool AddLine( const Point3d& ptNew, bool bEndOrStart = true) = 0 ; @@ -58,6 +58,7 @@ class __declspec( novtable) ICurveComposite : public ICurve virtual bool ArcsBezierCurvesToArcsPerpExtr( double dLinTol, double dAngTolDeg) = 0 ; virtual bool StraightArcsToLines( double dLinTol, double dAngTolDeg) = 0 ; virtual bool MergeCurves( double dLinTol, double dAngTolDeg, bool bStartEnd = true, bool bNeedSameProp = false) = 0 ; + virtual bool RemoveSmallParts( double dLinTol, double dAngTolDeg) = 0 ; virtual bool RemoveSmallDefects( double dLinTol, double dAngTolDeg, bool bAlsoSpikes = false) = 0 ; virtual bool RemoveUndercutOnY( double dLinTol, double dAngTolDeg) = 0 ; virtual bool IsAPoint( void) const = 0 ; @@ -67,6 +68,8 @@ class __declspec( novtable) ICurveComposite : public ICurve virtual bool IsATrapezoid( double dLinTol, Point3d& ptP, Vector3d& vtB1, Vector3d& vtL1, Vector3d& vtB2) const = 0 ; virtual bool SetCurveTempProp( int nCrv, int nProp, int nPropInd = 0) = 0 ; virtual bool GetCurveTempProp( int nCrv, int& nProp, int nPropInd = 0) const = 0 ; + virtual bool SetCurveTempParam( int nCrv, double dParam, int nParamInd = 0) = 0 ; + virtual bool GetCurveTempParam( int nCrv, double& dParam, int nParamInd = 0) const = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkCurveLine.h b/EGkCurveLine.h index 8ab95f0..380c10a 100644 --- a/EGkCurveLine.h +++ b/EGkCurveLine.h @@ -45,3 +45,10 @@ inline ICurveLine* GetCurveLine( IGeoObj* pGObj) { if ( pGObj == nullptr || pGObj->GetType() != CRV_LINE) return nullptr ; return (static_cast(pGObj)) ; } + +//---------------------------------------------------------------------------- +// Raccolte di puntatori a ICurveLine +typedef std::vector CICRVLINEVECTOR ; // vettore di puntatori a const ICurveLine +typedef std::vector ICRVLINEPVECTOR ; // vettore di puntatori a ICurveLine +typedef std::list ICRVLINEPLIST ; // lista di puntatori a ICurveLine +typedef std::vector> ICRVLINEPOVECTOR ; // vettore di puntatori esclusivi a ICurveLine diff --git a/EGkDistPointCurve.h b/EGkDistPointCurve.h index e0dca1c..b4b5b47 100644 --- a/EGkDistPointCurve.h +++ b/EGkDistPointCurve.h @@ -49,22 +49,23 @@ class DistPointCurve // Il flag bIsSegment vale solo per linee. public : - EGK_EXPORT bool GetSqDist( double& dSqDist) ; - EGK_EXPORT bool GetDist( double& dDist) ; - EGK_EXPORT bool IsEpsilon( double dTol) - { double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; } - EGK_EXPORT bool IsSmall( void) - { return IsEpsilon( EPS_SMALL) ; } - EGK_EXPORT bool IsZero( void) - { return IsEpsilon( EPS_ZERO) ; } - EGK_EXPORT int GetNbrMinDist( void) { return (int) m_Info.size() ; } - EGK_EXPORT bool GetMinDistPoint( int nInd, Point3d& ptMinDist, int& nFlag) ; - EGK_EXPORT bool GetMinDistPoint( double dNearParam, Point3d& ptMinDist, int& nFlag) ; - EGK_EXPORT bool GetParamAtMinDistPoint( int nInd, double& dParam, int& nFlag) ; - EGK_EXPORT bool GetParamAtMinDistPoint( double dNearParam, double& dParam, int& nFlag) ; - EGK_EXPORT bool GetSideAtMinDistPoint( int nInd, const Vector3d& vtN, int& nSide) ; - EGK_EXPORT bool GetSideAtMinDistPoint( double dNearParam, const Vector3d& vtN, int& nSide) ; - EGK_EXPORT bool GetMinDistInfo( int nInd, MinDistPCInfo& aInfo) ; + EGK_EXPORT bool GetSqDist( double& dSqDist) const ; + EGK_EXPORT bool GetDist( double& dDist) const ; + EGK_EXPORT bool IsEpsilon( double dTol) const + { double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; } + EGK_EXPORT bool IsSmall( void) const + { return IsEpsilon( EPS_SMALL) ; } + EGK_EXPORT bool IsZero( void) const + { return IsEpsilon( EPS_ZERO) ; } + EGK_EXPORT int GetNbrMinDist( void) const + { return (int) m_Info.size() ; } + EGK_EXPORT bool GetMinDistPoint( int nInd, Point3d& ptMinDist, int& nFlag) const ; + EGK_EXPORT bool GetMinDistPoint( double dNearParam, Point3d& ptMinDist, int& nFlag) const ; + EGK_EXPORT bool GetParamAtMinDistPoint( int nInd, double& dParam, int& nFlag) const ; + EGK_EXPORT bool GetParamAtMinDistPoint( double dNearParam, double& dParam, int& nFlag) const ; + EGK_EXPORT bool GetSideAtMinDistPoint( int nInd, const Vector3d& vtN, int& nSide) const ; + EGK_EXPORT bool GetSideAtMinDistPoint( double dNearParam, const Vector3d& vtN, int& nSide) const ; + EGK_EXPORT bool GetMinDistInfo( int nInd, MinDistPCInfo& aInfo) const ; private : DistPointCurve( void) ; diff --git a/EGkDistPointSurfTm.h b/EGkDistPointSurfTm.h index f7db94e..b37ab9d 100644 --- a/EGkDistPointSurfTm.h +++ b/EGkDistPointSurfTm.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2018-2023 //---------------------------------------------------------------------------- -// File : EGkDistPointTria.h Data : 06.07.23 Versione : 2.5g1 +// File : EGkDistPointSurfTm.h Data : 06.07.23 Versione : 2.5g1 // Contenuto : Dichiarazione della classe distanza Punto da Trimesh. // // @@ -37,16 +37,16 @@ class DistPointSurfTm EGK_EXPORT DistPointSurfTm( const Point3d& ptP, const ISurfTriMesh& tmSurf) ; public : - EGK_EXPORT bool GetDist( double& dDist) ; - EGK_EXPORT bool IsEpsilon( double dTol) + EGK_EXPORT bool GetDist( double& dDist) const ; + EGK_EXPORT bool IsEpsilon( double dTol) const { return ( m_dDist >= 0. && ( m_dDist < EPS_ZERO || m_dDist < dTol)) ; } - EGK_EXPORT bool IsSmall( void) + EGK_EXPORT bool IsSmall( void) const { return IsEpsilon( EPS_SMALL) ; } - EGK_EXPORT bool IsZero( void) + EGK_EXPORT bool IsZero( void) const { return IsEpsilon( EPS_ZERO) ; } - EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDistPoint) ; - EGK_EXPORT bool GetMinDistTriaIndex( int& nMinDistTriaIndex) ; - EGK_EXPORT bool IsPointInside( void) + EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDistPoint) const ; + EGK_EXPORT bool GetMinDistTriaIndex( int& nMinDistTriaIndex) const ; + EGK_EXPORT bool IsPointInside( void) const { return m_bIsInside ; } private : diff --git a/EGkGeoCollection.h b/EGkGeoCollection.h index a62a5c6..0e5c428 100644 --- a/EGkGeoCollection.h +++ b/EGkGeoCollection.h @@ -32,15 +32,15 @@ typedef std::list PNTILIST ; // lista di coppie punto, intero //---------------------------------------------------------------------------- // Raccolte di coppie Point3d,dU -typedef std::pair POINTU ; // coppia punto, parametro (o altro) -typedef std::vector PNTUVECTOR ; // vettore di coppie punto, parametro -typedef std::list PNTULIST ; // lista di coppie punto, parametro +typedef std::pair POINTU ; // coppia punto, parametro (o altro) +typedef std::vector PNTUVECTOR ; // vettore di coppie punto, parametro +typedef std::list PNTULIST ; // lista di coppie punto, parametro //---------------------------------------------------------------------------- // Raccolte di coppie Point3d,Point3d -typedef std::pair BIPOINT ; // coppia punto1, punto2 -typedef std::vector BIPNTVECTOR ; // vettore di coppie punto1, punto2 -typedef std::list BIPNTLIST ; // lista di coppie punto1, punto2 +typedef std::pair BIPOINT ; // coppia punto1, punto2 +typedef std::vector BIPNTVECTOR ; // vettore di coppie punto1, punto2 +typedef std::list BIPNTLIST ; // lista di coppie punto1, punto2 //---------------------------------------------------------------------------- // Raccolte di Punti di curva con loro geometria differenziale @@ -57,3 +57,9 @@ typedef std::list VCT3DLIST ; // lista di vettori 3d typedef std::vector BOXVECTOR ; // vettore di bounding box 3d typedef std::list BOXLIST ; // lista di bounding box 3d typedef std::vector> BOXIVECTOR ; // vettore di bounding box 3d e Id + +//---------------------------------------------------------------------------- +// Raccolte di coppie Point3d,Vector3d +typedef std::pair PNTVECT ; // coppia punto, vettore +typedef std::vector PNTVECTVECTOR ; // vettore di coppie punto, vettore +typedef std::list PNTVECTLIST ; // lista di coppie punto, vettore diff --git a/EGkGeoObj.h b/EGkGeoObj.h index 466dda6..36bd595 100644 --- a/EGkGeoObj.h +++ b/EGkGeoObj.h @@ -56,6 +56,8 @@ class __declspec( novtable) IGeoObj virtual const IObjGraphics* GetObjGraphics( void) const = 0 ; virtual void SetTempProp( int nProp, int nPropInd = 0) = 0 ; virtual int GetTempProp( int nPropInd = 0) const = 0 ; + virtual void SetTempParam( double dParam, int nParamInd = 0) = 0 ; + virtual double GetTempParam( int nParamInd = 0) const = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkGeoObjSave.h b/EGkGeoObjSave.h index 3d9c0b1..7f2b170 100644 --- a/EGkGeoObjSave.h +++ b/EGkGeoObjSave.h @@ -39,5 +39,40 @@ SaveGeoObj( IGeoObj* pGObj, const std::string& sFile, int nFlag = GDB_SV_BIN) // rimuovo l'oggetto dal GeomDB bOk = ( pGeomDB->RemoveGeoObjAndErase( nId) != nullptr) && bOk ; + return bOk ; +} + +//---------------------------------------------------------------------------- +bool +SaveGeoObj( std::vector vpGObj, const std::string& sFile, int nFlag = GDB_SV_BIN) +{ + for ( int i = 0 ; i < int( vpGObj.size()); ++i) { + // verifico validità oggetto + if ( vpGObj[i] == nullptr || ! vpGObj[i]->IsValid() ) + return false ; + } + // creo GeomDB temporaneo + PtrOwner pGeomDB( CreateGeomDB()) ; + if ( IsNull( pGeomDB)) + return false ; + INTVECTOR vIds ; + int nLayId = 0 ; + for ( int i = 0 ; i < int( vpGObj.size()); ++i) { + // inserisco l'oggetto nel GeomDB (sotto pezzo/layer) + if ( i == 0) { + int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ; + nLayId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ; + } + int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nLayId, vpGObj[i]) ; + 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 ; } \ No newline at end of file diff --git a/EGkIntersCurveSurfTm.h b/EGkIntersCurveSurfTm.h new file mode 100644 index 0000000..122464f --- /dev/null +++ b/EGkIntersCurveSurfTm.h @@ -0,0 +1,63 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : EGkIntersCurveSurfTm.h Data : 23.02.24 Versione : 2.6b4 +// Contenuto : Dichiarazione della classe intersezione Curva/SurfTriMesh. +// +// +// +// Modifiche : 23.02.24 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurve.h" +#include "/EgtDev/Include/EGkSurfTriMesh.h" +#include "/EgtDev/Include/EGkIntersLineTria.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 + +//----------------------------------------------------------------------------- +//! dati di intersezione curva - superficie trimesh +struct IntCrvStmInfo { + int nILTT ; //!< tipo di intersezione curva-triangolo + double dU ; //!< parametro sulla curva (non distanza) + double dU2 ; //!< secondo parametro sulla curva (non distanza) + int nT ; //!< indice del triangolo della superficie trimesh + double dCosDN ; //!< coseno dell'angolo tra la direzione della curva e la normale del triangolo + Point3d ptI ; //!< punto di intersezione + Point3d ptI2 ; //!< secondo punto di intersezione (termine di tratto sovrapposto) + // costruttori + IntCrvStmInfo( void) : nILTT( ILTT_NO), dU( 0), dU2( 0), nT(0), dCosDN(0), ptI(), ptI2() {} + IntCrvStmInfo( int nIL, double dUU, int nTT, double dCos, const Point3d& ptP) + : nILTT( nIL), dU( dUU), dU2( 0), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2() {} + IntCrvStmInfo( int nIL, double dUU, double dUU2, int nTT, double dCos, const Point3d& ptP, const Point3d& ptP2) + : nILTT( nIL), dU( dUU), dU2( dUU2), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2( ptP2) {} +} ; +//! vettore di IntCrvStmInfo +typedef std::vector ICSIVECTOR ; + +//----------------------------------------------------------------------------- +// Costanti tipo intersezione filtrata Curva-Superficie +enum CSiType { CSIT_NONE = 0, + CSIT_OUT_IN = 1, + CSIT_IN_OUT = 2, + CSIT_IN_IN = 3, + CSIT_OUT_OUT = 4, + CSIT_IN_ON = 5, + CSIT_ON_IN = 6, + CSIT_OUT_ON = 7, + CSIT_ON_OUT = 8} ; + +//----------------------------------------------------------------------------- +EGK_EXPORT bool IntersCurveSurfTm( const ICurve& Curve, const ISurfTriMesh& Stm, double dLinTol, ICSIVECTOR& vInfo) ; +EGK_EXPORT bool IntersCurveSurfTmExt( const ICurve& Curve, const ISurfTriMesh& Stm, double dLinTol, INTDBLVECTOR& vInters) ; +EGK_EXPORT bool FilterCurveSurfTmInters( const ICurve& Curve, const ICSIVECTOR& vInfo, INTDBLVECTOR& vInters) ; diff --git a/EGkIntersLineSurfTm.h b/EGkIntersLineSurfTm.h index e344c28..1aa857a 100644 --- a/EGkIntersLineSurfTm.h +++ b/EGkIntersLineSurfTm.h @@ -29,14 +29,14 @@ //! dati di intersezione linea - superficie trimesh struct IntLinStmInfo { int nILTT ; //!< tipo di intersezione linea-triangolo - double dU ; //!< parametro sulla linea - double dU2 ; //!< secondo parametro sulla linea + double dU ; //!< distanza sulla linea + double dU2 ; //!< seconda distanza sulla linea int nT ; //!< indice del triangolo della superficie trimesh double dCosDN ; //!< coseno dell'angolo tra la direzione della linea e la normale del triangolo Point3d ptI ; //!< punto di intersezione Point3d ptI2 ; //!< secondo punto di intersezione (termine di tratto sovrapposto) // costruttori - IntLinStmInfo( void) : nILTT( ILTT_NO), dU( 0), dU2( 0), nT(0), dCosDN(0), ptI(), ptI2() {} + IntLinStmInfo( void) : nILTT( ILTT_NO), dU( 0), dU2( 0), nT( 0), dCosDN( 0), ptI(), ptI2() {} IntLinStmInfo( int nIL, double dUU, int nTT, double dCos, const Point3d& ptP) : nILTT( nIL), dU( dUU), dU2( 0), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2() {} IntLinStmInfo( int nIL, double dUU, double dUU2, int nTT, double dCos, const Point3d& ptP, const Point3d& ptP2) @@ -45,6 +45,15 @@ struct IntLinStmInfo { //! vettore di IntLinStmInfo typedef std::vector ILSIVECTOR ; +//----------------------------------------------------------------------------- +// Costanti tipo intersezione Linea SurfTriMesh dopo filtraggio +enum LSiType { LST_NONE = 0, + LST_IN = 1, + LST_OUT = 2, + LST_TG_INI = 3, + LST_TG_FIN = 4, + LST_TOUCH = 5} ; + //----------------------------------------------------------------------------- EGK_EXPORT bool IntersLineSurfTm( const Point3d& ptL, const Vector3d& vtL, double dLen, const ISurfTriMesh& Stm, ILSIVECTOR& vInfo, bool bFinite = true) ; @@ -62,3 +71,6 @@ class IntersParLinesSurfTm const ISurfTriMesh* m_pSTm ; HashGrids2d m_HGrids ; } ; + +//----------------------------------------------------------------------------- +EGK_EXPORT bool FilterLineSurfTmInters( const ILSIVECTOR& vInfo, INTDBLVECTOR& vInters) ; diff --git a/EGkIntersLineTria.h b/EGkIntersLineTria.h index 3cf11f0..77660fc 100644 --- a/EGkIntersLineTria.h +++ b/EGkIntersLineTria.h @@ -23,12 +23,6 @@ #define EGK_EXPORT __declspec( dllimport) #endif -//----------------------------------------------------------------------------- -EGK_EXPORT int IntersLineTria( const Point3d& ptL1, const Point3d& ptL2, const Triangle3d& trTria, - Point3d& ptInt, Point3d& ptInt2, bool bFinite = true) ; -EGK_EXPORT int IntersLineTria( const Point3d& ptL, const Vector3d& vtL, double dLen, const Triangle3d& trTria, - Point3d& ptInt, Point3d& ptInt2, bool bFinite = true) ; - //----------------------------------------------------------------------------- // Tipo di intersezione linea-triangolo enum IntLineTriaType { ILTT_NO = 0, // non c'è intersezione @@ -37,3 +31,9 @@ enum IntLineTriaType { ILTT_NO = 0, // non c' ILTT_VERT = 3, // intersezione coincide con un vertice ILTT_EDGE = 4, // intersezione coincide con interno di un lato ILTT_IN = 5} ; // intersezione in interno del triangolo + +//----------------------------------------------------------------------------- +EGK_EXPORT int IntersLineTria( const Point3d& ptL1, const Point3d& ptL2, const Triangle3d& trTria, + Point3d& ptInt, Point3d& ptInt2, bool bFinite = true) ; +EGK_EXPORT int IntersLineTria( const Point3d& ptL, const Vector3d& vtL, double dLen, const Triangle3d& trTria, + Point3d& ptInt, Point3d& ptInt2, bool bFinite = true) ; diff --git a/EGkIntersLineVolZmap.h b/EGkIntersLineVolZmap.h new file mode 100644 index 0000000..d083264 --- /dev/null +++ b/EGkIntersLineVolZmap.h @@ -0,0 +1,62 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : EGkIntersLineVolZmap.h Data : 22.02.24 Versione : 2.6b4 +// Contenuto : Dichiarazione prototipi intersezione Linea/VolZmap. +// +// +// +// Modifiche : 22.02.24 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkVolZmap.h" +#include "/EgtDev/Include/EGkIntersLineTria.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 + +//----------------------------------------------------------------------------- +// dati di intersezione linea - volume Zmap +struct IntLineZmapInfo { + int nILTT ; // Tipo di intersezione linea-triangolo + double dU ; // Distanza sulla linea + double dU2 ; // Seconda distanza sulla linea + int nVox ; // Indice del voxel del triangolo + int nBlock ; // Indice del blocco del triangolo + Triangle3d trTria ; // Triangolo + double dCosDN ; // Coseno dell'angolo tra la direzione della linea e la normale del triangolo + Point3d ptI ; // Punto di intersezione + Point3d ptI2 ; // Secondo punto di intersezione (termine di tratto sovrapposto) + // Costruttori + IntLineZmapInfo( void) + : nILTT( ILTT_NO), dU( 0), dU2( 0), nVox( -1), nBlock( -1), trTria(), dCosDN( 0), ptI(), ptI2() {} + IntLineZmapInfo( int nIL, double dUU, int nVx, int nBl, Triangle3d& trTr, double dCos, const Point3d& ptP) + : nILTT( nIL), dU( dUU), dU2( 0), nVox( nVx), nBlock( nBl), dCosDN( dCos), trTria( trTr), ptI( ptP), ptI2() {} + IntLineZmapInfo( int nIL, double dUU, double dUU2, int nVx, int nBl, Triangle3d& trTr, double dCos, + const Point3d& ptP, const Point3d& ptP2) + : nILTT( nIL), dU( dUU), dU2( dUU2), nVox( nVx), nBlock( nBl), trTria( trTr), dCosDN( dCos), ptI( ptP), ptI2( ptP2) {} +} ; +// Vettore di IntLineZmapInfo +typedef std::vector ILZIVECTOR ; + +//----------------------------------------------------------------------------- +// Costanti tipo intersezione Linea VolZmap dopo filtraggio +enum LZiType { LZT_NONE = 0, + LZT_IN = 1, + LZT_OUT = 2, + LZT_TG_INI = 3, + LZT_TG_FIN = 4, + LZT_TOUCH = 5} ; + +//----------------------------------------------------------------------------- +EGK_EXPORT bool IntersLineVolZmap( const Point3d& ptL, const Vector3d& vtL, const IVolZmap& Vzm, ILZIVECTOR& vInfo) ; +EGK_EXPORT bool FilterLineVolZmapInters( const ILZIVECTOR& vInfo, INTDBLVECTOR& vInters) ; diff --git a/EGkIntersPlaneSurfTm.h b/EGkIntersPlaneSurfTm.h index 2d5ef79..a517f9f 100644 --- a/EGkIntersPlaneSurfTm.h +++ b/EGkIntersPlaneSurfTm.h @@ -32,13 +32,13 @@ EGK_EXPORT bool IntersPlaneSurfTm( const Plane3d& plPlane, const ISurfTriMesh& S //----------------------------------------------------------------------------- class IntersParPlanesSurfTm { -public : - EGK_EXPORT IntersParPlanesSurfTm( const Frame3d& frPlanes, const ISurfTriMesh& Stm) ; - EGK_EXPORT bool GetInters( double dDist, PNTVECTOR& vPnt, BIPNTVECTOR& vBpt, TRIA3DVECTOR& vTria) const ; + public : + EGK_EXPORT IntersParPlanesSurfTm( const Frame3d& frPlanes, const ISurfTriMesh& Stm) ; + EGK_EXPORT bool GetInters( double dDist, PNTVECTOR& vPnt, BIPNTVECTOR& vBpt, TRIA3DVECTOR& vTria) const ; -private : - bool m_bOk ; - const Frame3d m_frPlanes ; - const ISurfTriMesh* m_pSTm ; - HashGrids1d m_HGrids ; + private : + bool m_bOk ; + const Frame3d m_frPlanes ; + const ISurfTriMesh* m_pSTm ; + HashGrids1d m_HGrids ; } ; \ No newline at end of file diff --git a/EGkIntersPlaneVolZmap.h b/EGkIntersPlaneVolZmap.h new file mode 100644 index 0000000..fac31b5 --- /dev/null +++ b/EGkIntersPlaneVolZmap.h @@ -0,0 +1,27 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : EGkIntersPlaneVolZmap.h Data : 22.02.24 Versione : 2.6b4 +// Contenuto : Dichiarazione prototipi intersezione Piano/VolZmap. +// +// +// +// Modifiche : 22.02.24 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkVolZmap.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 + +//----------------------------------------------------------------------------- +EGK_EXPORT bool IntersPlaneVolZmap( const Plane3d& plPlane, const IVolZmap& Vzm, ICURVEPOVECTOR& vpLoop) ; diff --git a/EGkOffsetCurve.h b/EGkOffsetCurve.h index 0b6ffc1..26a6cab 100644 --- a/EGkOffsetCurve.h +++ b/EGkOffsetCurve.h @@ -26,6 +26,8 @@ class OffsetCurve { public : + EGK_EXPORT OffsetCurve(): m_dLinTol( 10 * EPS_SMALL) {} ; + EGK_EXPORT OffsetCurve( double dLinTol) : m_dLinTol( dLinTol) {} ; EGK_EXPORT ~OffsetCurve( void) ; public : @@ -35,7 +37,10 @@ class OffsetCurve EGK_EXPORT ICurve* GetCurve( void) ; EGK_EXPORT ICurve* GetLongerCurve( void) ; EGK_EXPORT ICurve* GetShorterCurve( void) ; + EGK_EXPORT double GetLinTol( void) const { return m_dLinTol ; } + EGK_EXPORT void SetLinTol( double dTol) { m_dLinTol = dTol ; } private : ICURVEPLIST m_CrvLst ; + double m_dLinTol ; } ; \ No newline at end of file diff --git a/EGkPoint3d.h b/EGkPoint3d.h index 3d23f4c..eb82b46 100644 --- a/EGkPoint3d.h +++ b/EGkPoint3d.h @@ -1,12 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2022 +// EgalTech 2013-2023 //---------------------------------------------------------------------------- -// File : EGkPoint3d.h Data : 22.08.224 Versione : 2.4h2 +// File : EGkPoint3d.h Data : 23.08.23 Versione : 2.5h2 // Contenuto : Dichiarazione della classe Punto 3d. // // // // Modifiche : 30.12.12 DS Creazione modulo. +// 23.08.23 DS Aggiunto P_INVALID. // // //---------------------------------------------------------------------------- @@ -99,6 +100,8 @@ class EGK_EXPORT Point3d //---------------------------------------------------------------------------- // Punti notevoli //---------------------------------------------------------------------------- +//! Punto non valido +const Point3d P_INVALID( NAN, NAN, NAN) ; //! Punto origine const Point3d ORIG( 0, 0, 0) ; diff --git a/EGkPolyLine.h b/EGkPolyLine.h index 61d0e42..88de9de 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -116,6 +116,11 @@ class PolyLine 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) ; + EGK_EXPORT void SetTempProp( int nProp, int nPropInd = 0) + { if ( nPropInd >= 0 && nPropInd < 2) + m_nTempProp[nPropInd] = nProp ; } + EGK_EXPORT int GetTempProp( int nPropInd = 0) const + { return (( nPropInd >= 0 && nPropInd < 2) ? m_nTempProp[nPropInd] : 0) ; } private : bool MyChangeStart( int nPos) ; @@ -123,15 +128,17 @@ class PolyLine bool MyMakeConvex( const Vector3d& vtN, bool bLeftSide) ; private : - int m_nRejected ; - PNTULIST m_lUPoints ; - mutable PNTULIST::const_iterator m_iter ; + int m_nRejected ; // numero punti rifiutati perchè coincidenti + int m_nTempProp[2] ; // vettore proprietà temporanee + PNTULIST m_lUPoints ; // lista dei punti + mutable PNTULIST::const_iterator m_iter ; // iteratore corrente } ; //---------------------------------------------------------------------------- // Raccolte di PolyLine -typedef std::vector POLYLINEVECTOR ; // vettore di PolyLine -typedef std::list POLYLINELIST ; // lista di PolyLine +typedef std::vector POLYLINEVECTOR ; // vettore di PolyLine +typedef std::list POLYLINELIST ; // lista di PolyLine +typedef std::vector POLYLINEMATRIX ; // matrice di PolyLine //---------------------------------------------------------------------------- EGK_EXPORT bool DistPointPolyLine( const Point3d& ptP, const PolyLine& plPoly, double& dDist) ; diff --git a/EGkPolygon3d.h b/EGkPolygon3d.h index 02c9541..a859ab8 100644 --- a/EGkPolygon3d.h +++ b/EGkPolygon3d.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2020 +// EgalTech 2015-2023 //---------------------------------------------------------------------------- -// File : Polygon3d.h Data : 02.10.20 Versione : 2.2j1 +// File : EGkPolygon3d.h Data : 17.12.23 Versione : 2.5l3 // Contenuto : Dichiarazione della classe Polygon3d (poligono nello spazio). // // @@ -58,7 +58,7 @@ class Polygon3d EGK_EXPORT bool ToGlob( const Frame3d& frRef) ; EGK_EXPORT bool ToLoc( const Frame3d& frRef) ; EGK_EXPORT bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ; - + EGK_EXPORT bool GetLocalBBox( BBox3d& b3Loc) const ; EGK_EXPORT bool IsValid( void) const { return ! m_Plane.GetVersN().IsSmall() ; } EGK_EXPORT const Plane3d& GetPlane( void) const diff --git a/EGkPolygonElevation.h b/EGkPolygonElevation.h new file mode 100644 index 0000000..dfa0c18 --- /dev/null +++ b/EGkPolygonElevation.h @@ -0,0 +1,32 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : EGkPolygonElevation.h Data : 02.10.20 Versione : 2.2j1 +// Contenuto : Dichiarazione della classe Polygon3d (poligono nello spazio). +// +// +// +// Modifiche : 30.08.15 DS Creazione modulo. +// 19.06.19 DS Aggiunta GetVertices. +// 23.07.19 DS Aggiunte Offset e Invert. +// 02.10.20 DS A FromPlaneTrimmedWithBox aggiunto parametro dToler. +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkPolygon3d.h" +#include "/EgtDev/Include/EGkSurfTriMesh.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 + + +//---------------------------------------------------------------------------- +EGK_EXPORT bool PolygonElevationInBBox( const Polygon3d& pgFacet, const BBox3d& b3Box, bool bAcceptOutFacet, double& dElev) ; +EGK_EXPORT bool PolygonElevationInClosedSurfTm( const Polygon3d& pgFacet, const ISurfTriMesh& CldStm, bool bAcceptOutFacet, double& dElev) ; diff --git a/EGkProjectCurveSurfTm.h b/EGkProjectCurveSurfTm.h new file mode 100644 index 0000000..2d2320b --- /dev/null +++ b/EGkProjectCurveSurfTm.h @@ -0,0 +1,43 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : EGkProjectCurveSurfTm.h Data : 31.08.23 Versione : 2.5h3 +// Contenuto : Dichiarazione funzioni proiezione curve su superficie Trimesh. +// +// +// +// Modifiche : 31.08.23 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurve.h" +#include "/EgtDev/Include/EGkSurfTriMesh.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 + +//---------------------------------------------------------------------------- +// Definizione di Punto 5assi e sue raccolte +struct Point5ax { + Point3d ptP ; + Vector3d vtDir ; + double dPar ; + int nFlag ; + Point5ax( void) : ptP(), vtDir(), dPar(), nFlag() {} ; + Point5ax( const Point3d& ptBase, const Vector3d& vtTool, double dU, int nData) + : ptP( ptBase), vtDir( vtTool), dPar( dU), nFlag( nData) {} ; +} ; +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) ; diff --git a/EGkSfrCreate.h b/EGkSfrCreate.h index c81c3c7..0066574 100644 --- a/EGkSfrCreate.h +++ b/EGkSfrCreate.h @@ -30,7 +30,7 @@ EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionRectangle( double dWidth, double dL EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionStadium( double dWidth, double dLen) ; EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionDisk( double dRadius) ; EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionFromFatCurve( ICurve* pCrv, double dRadius, - bool bSquareEnds, bool bSquareMids) ; + bool bSquareEnds, bool bSquareMids, double dOffsLinTol = 10 * EPS_SMALL) ; // NB : la curva ingrassata non deve autointersecarsi EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionFromTriangle( const Triangle3d& Tria) ; EGK_EXPORT ISurfFlatRegion* GetSurfFlatRegionFromPolyLine( const PolyLine& ContourPolyLine) ; diff --git a/EGkStmFromCurves.h b/EGkStmFromCurves.h index b5bfb8f..92c662a 100644 --- a/EGkStmFromCurves.h +++ b/EGkStmFromCurves.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2015 +// EgalTech 2015-2024 //---------------------------------------------------------------------------- -// File : EGkStmFromCurves.h Data : 01.02.15 Versione : 1.6b1 +// File : EGkStmFromCurves.h Data : 27.02.24 Versione : 2.6b4 // Contenuto : Dichiarazione della classe StmFromTriangleSoup. // // // // Modifiche : 19.05.14 DS Creazione modulo. -// +// 27.02.24 DS Aggiunta GetSurfTriMeshTransSwept. // //---------------------------------------------------------------------------- @@ -39,7 +39,8 @@ EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByRevolve( const ICurve* pCurve, const Po EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByScrewing( const ICurve* pCurve, const Point3d& ptAx, const Vector3d& vtAx, double dAngRotDeg, double dMove, bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshRectSwept( double dDimH, double dDimV, double dBevelH, double dBevelV, - const ICurve* pGuide, int nCapType, double dLinTol) ; + const ICurve* pGuide, int nCapType, double dLinTol = 10 * EPS_SMALL) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSwept( const ICurve* pSect, const ICurve* pGuide, bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshTransSwept( const ICurve* pSect, const ICurve* pGuide, bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshRuled( const Point3d& ptP, const ICurve* pCurve, double dLinTol = 10 * EPS_SMALL) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshRuled( const ICurve* pCurve1, const ICurve* pCurve2, int nType, double dLinTol = 10 * EPS_SMALL) ; diff --git a/EGkStmFromTriangleSoup.h b/EGkStmFromTriangleSoup.h index 354e90a..e444c0a 100644 --- a/EGkStmFromTriangleSoup.h +++ b/EGkStmFromTriangleSoup.h @@ -35,13 +35,14 @@ class StmFromTriangleSoup EGK_EXPORT ~StmFromTriangleSoup( void) ; EGK_EXPORT bool Start( int nBuckets = GRID_STD_BUCKETS) ; EGK_EXPORT bool AddTriangle( const Triangle3d& Tria) ; - EGK_EXPORT bool AddTriangle( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2) ; + EGK_EXPORT bool AddTriangle( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2, + double dU0 = -1, double dV0 = -1, double dU1 = -1, double dV1 = -1, double dU2 = -1, double dV2 = -1) ; EGK_EXPORT bool AddSurfTriMesh( const ISurfTriMesh& stmSource) ; EGK_EXPORT bool End( void) ; EGK_EXPORT ISurfTriMesh* GetSurf( void) ; private : - inline int AddVertex( const Point3d& ptP) ; + inline int AddVertex( const Point3d& ptP, double dU = -1, double dV = -1) ; private : ISurfTriMesh* m_pSTM ; diff --git a/EGkSubtractProjectedFacesOnStmFace.h b/EGkSubtractProjectedFacesOnStmFace.h new file mode 100644 index 0000000..0cd252d --- /dev/null +++ b/EGkSubtractProjectedFacesOnStmFace.h @@ -0,0 +1,29 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : EGkSubtractProjectedFacesOnStmFace.h Data : 26.09.23 Versione : 2.5j1 +// Contenuto : Dichiarazione della funzione per proiettare facce di TriMesh su una superficie di TriMesh. +// +// +// +// Modifiche : 26.09.23 RE Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkSurfTriMesh.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 + +//----------------------------------------------------------------------------- +EGK_EXPORT bool SubtractProjectedFacesOnStmFace( const ISurfTriMesh& Stm, int nFaceInd, ISURFTMPOVECTOR& vStmOthers, + bool bOCFlag, bool& bExistProjection, ISurfTriMesh*& pStmRes, + int& nNewFaceNbr) ; diff --git a/EGkSurfAux.h b/EGkSurfAux.h new file mode 100644 index 0000000..15254a2 --- /dev/null +++ b/EGkSurfAux.h @@ -0,0 +1,61 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : EGkSurfAux.h Data : 09.08.23 Versione : +// Contenuto : Dichiarazione funzioni ausiliarie per ISurf. +// +// +// +// Modifiche : 09.08.23 DB Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurveComposite.h" +#include "/EgtDev/Include/EGkSurf.h" +#include "/EgtDev/Include/EGkGeoCollection.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 + +//---------------------------------------------------------------------------- +//! Struttura dati per superficie Nurbs +struct SNurbsSurfData +{ + int nDegU ; // grado in U + int nDegV ; // grado in V + bool bRat ; // flag di superficie razionale (pesi non tutti unitari) + bool bPeriodicU ; // flag per segnalare vettore dei nodi periodico in U + bool bPeriodicV ; // flag per segnalare vettore dei nodi periodico in V + bool bClosedU ; // flag di superficie chiusa sul parametro U + bool bClosedV ; // flag di superficie chiusa sul parametro V + bool bClampedU ; // flag di superficie clamped sul parametro U + bool bClampedV ; // flag di superficie clamped sul parametro V + bool bExtraKnotes ; // flag per segnalare presenza di nodi extra all'inizio e fine (totale 2) + DBLVECTOR vU ; // vettore dei nodi in U + DBLVECTOR vV ; // vettore dei nodi in V + int nCPU ; // numero di punti di controllo in U + int nCPV ; // numero di punti di controllo in V + PNTVECTOR vCP ; // vettore dei punti di controllo + PNTMATRIX mCP ; // matrice dei punti di controllo + DBLMATRIX mW ; // matrice dei pesi + + SNurbsSurfData( void) : nDegU( 0), nDegV( 0), bRat( false), bPeriodicU( false), bPeriodicV( false), bClosedU( false), bClosedV( false), + bClampedU( false), bClampedV( false), bExtraKnotes(false) {} +} ; + +// N.B. : in caso la superficie sia razionale i punti di controllo sono in forma NON OMOGENEA [ x, y, z, w] ( dove la forma omogenea è [ w*x, w*y, w*z, w]) +// tutte le operazioni richiedono la forma OMOGENEA, finite le quali posso riportarmi alla forma NON OMOGENEA + +//---------------------------------------------------------------------------- +//! Trasforma una superficie Nurbs standard in una nuova superficie di Bezier semplice o composta +EGK_EXPORT bool NurbsSurfaceCanonicalize( SNurbsSurfData& snData) ; +EGK_EXPORT ISurf* NurbsToBezierSurface( const SNurbsSurfData& snData) ; diff --git a/EGkSurfFlatRegion.h b/EGkSurfFlatRegion.h index 819b471..d975ded 100644 --- a/EGkSurfFlatRegion.h +++ b/EGkSurfFlatRegion.h @@ -36,6 +36,7 @@ class __declspec( novtable) ISurfFlatRegion : public ISurf virtual bool Subtract( const ISurfFlatRegion& Other) = 0 ; virtual bool Intersect( const ISurfFlatRegion& Other) = 0 ; virtual bool Offset( double dDist, int nType) = 0 ; + virtual ISurfFlatRegion* CreateOffsetSurf( double dDist, int nType) const = 0 ; virtual bool GetGrossArea( double& dArea) const = 0 ; virtual const Point3d& GetPlanePoint( void) const = 0 ; virtual const Vector3d& GetNormVersor( void) const = 0 ; @@ -48,7 +49,8 @@ class __declspec( novtable) ISurfFlatRegion : public ISurf virtual bool GetChunkCentroid( int nChunk, Point3d& ptCen) const ; virtual bool GetCurveClassification( const ICurve& Crv, double dLenMin, CRVCVECTOR& ccClass) const = 0 ; virtual int GetChunkSimpleClassification( int nChunk, const ISurfFlatRegion& Other, int nOthChunk) const ; // compare only outsides - virtual bool GetZigZagInfill( double dSideStep, bool bAllowStepCorrection, bool bInvert, ICRVCOMPOPOVECTOR& vpCrvs) const = 0 ; + virtual bool CalcVoronoiDiagram( ICURVEPOVECTOR& vCrvs, int nBound = 3) const = 0 ; + virtual bool CalcMedialAxis( ICURVEPOVECTOR& vCrvs, int nSide = 1) const = 0 ; } ; //----------------------------------------------------------------------------- @@ -82,3 +84,9 @@ const int REGC_IN2 = 2 ; //!< La seconda regione const int REGC_SAME = 3 ; //!< Le due regioni coincidono const int REGC_OUT = 4 ; //!< Le due regioni sono esterne const int REGC_INTERS = 5 ; //!< Le due regioni si intersecano + +//----------------------------------------------------------------------------- +// Costanti per zona calcolo medial axis della regione +const int WMAT_IN_OUT = 0 ; +const int WMAT_IN = 1 ; +const int WMAT_OUT = 2 ; diff --git a/EGkSurfTriMesh.h b/EGkSurfTriMesh.h index e37521a..3510e12 100644 --- a/EGkSurfTriMesh.h +++ b/EGkSurfTriMesh.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2014-2023 //---------------------------------------------------------------------------- -// File : EGkSurfTriMesh.h Data : 07.07.23 Versione : 2.5g1 +// File : EGkSurfTriMesh.h Data : 10.12.23 Versione : 2.5l2 // Contenuto : Dichiarazione della interfaccia ISurfTriMesh. // // @@ -43,7 +43,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual void SetLinearTolerance( double dLinTol) = 0 ; virtual void SetBoundaryAngle( double dBoundaryAngDeg) = 0 ; virtual void SetSmoothAngle( double dSmoothAngDeg) = 0 ; - virtual int AddVertex( const Point3d& ptVert) = 0 ; + virtual int AddVertex( const Point3d& ptVert, double dU = -1, double dV = -1) = 0 ; virtual bool MoveVertex( int nInd, const Point3d& ptNewVert) = 0 ; virtual int AddTriangle( const int nIdVert[3], int nTFlag = 0) = 0 ; virtual bool RemoveTriangle( int nId) = 0 ; @@ -68,6 +68,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual double GetLinearTolerance( void) const = 0 ; virtual double GetSmoothAngle( void) const = 0 ; virtual bool GetVertex( int nId, Point3d& ptP) const = 0 ; + virtual bool GetVertexParam( int nId, double& dU, double& dV) const = 0 ; virtual int GetFirstVertex( Point3d& ptP) const = 0 ; virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ; virtual bool GetTriangle( int nId, int nIdVert[3]) const = 0 ; @@ -85,7 +86,7 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual bool GetTriangleSmoothNormals( int nId, TriNormals3d& TNrms) const = 0 ; virtual ISurfTriMesh* CloneTriangle( int nTria) const = 0 ; virtual bool GetLoops( POLYLINEVECTOR& vPL) const = 0 ; - virtual bool GetSilhouette( const Vector3d& vtDir, double dTol, POLYLINEVECTOR& vPL) const = 0 ; + virtual bool GetSilhouette( const Vector3d& vtDir, double dTol, POLYLINEVECTOR& vPL, bool bAllTria = false) const = 0 ; virtual int GetFacetCount( void) const = 0 ; virtual int GetFacetSize( void) const = 0 ; virtual int GetFacetFromTria( int nT) const = 0 ; @@ -104,6 +105,11 @@ class __declspec( novtable) ISurfTriMesh : public ISurf virtual bool SwapFacets( int nF1, int nF2) = 0 ; virtual bool GetFacetLocalBBox( int nF, BBox3d& b3Loc, int nFlag = BBF_STANDARD) const = 0 ; virtual bool GetFacetBBox( int nF, const Frame3d& frRef, BBox3d& b3Ref, int nFlag = BBF_STANDARD) const = 0 ; + virtual int GetEdgeCount( void) const = 0 ; + virtual int GetEdgeSize( void) const = 0 ; + virtual bool GetEdge( int nInd, int& nV1, int& nV2, int& nFl, int& nFr, double& dAng) const = 0 ; + virtual bool GetEdge( int nInd, Point3d& ptP1, Point3d& ptP2, double& dAng) const = 0 ; + virtual bool GetEdges( ICURVEPOVECTOR& vpCurve) const = 0 ; virtual bool Cut( const Plane3d& plPlane, bool bSaveOnEq) = 0 ; virtual bool GeneralizedCut( const ICurve& cvCurve, bool bSaveOnEq) = 0 ; virtual bool Add( const ISurfTriMesh& Other) = 0 ; diff --git a/EGkVector3d.h b/EGkVector3d.h index a4f0f69..2dc1764 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -1,13 +1,14 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2022 +// EgalTech 2013-2023 //---------------------------------------------------------------------------- -// File : EGkVector3d.h Data : 27.08.22 Versione : 2.4h2 +// File : EGkVector3d.h Data : 23.08.23 Versione : 2.5h2 // Contenuto : Dichiarazione della classe Vettore 3d. // // // // Modifiche : 31.12.13 DS Creazione modulo. // 14.12.19 DS Aggiunti confronti con Epsilon. +// 23.08.23 DS Aggiunto V_INVALID. // //---------------------------------------------------------------------------- @@ -170,6 +171,8 @@ class EGK_EXPORT Vector3d //---------------------------------------------------------------------------- // Vettori notevoli //---------------------------------------------------------------------------- +//! Vettore non valido +const Vector3d V_INVALID( NAN, NAN, NAN) ; //! Vettore nullo const Vector3d V_NULL( 0, 0, 0) ; //! Versore asse X diff --git a/EGkVolZmap.h b/EGkVolZmap.h index f63d7b4..f1a1245 100644 --- a/EGkVolZmap.h +++ b/EGkVolZmap.h @@ -1,12 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2020 +// EgalTech 2015-2023 //---------------------------------------------------------------------------- -// File : EGkVolZmap.h Data : 12.05.19 Versione : 2.2k1 +// File : EGkVolZmap.h Data : 12.09.23 Versione : 2.5i1 // Contenuto : Dichiarazione della interfaccia IVolZmap. // // // // Modifiche : 22.01.15 DS Creazione modulo. +// 12.09.23 DS Aggiunto metodo IsTriDexel. // // //---------------------------------------------------------------------------- @@ -14,35 +15,9 @@ #pragma once #include "/EgtDev/Include/EGkGeoObj.h" -#include "/EgtDev/Include/EGkPolyLine.h" #include "/EgtDev/Include/EGkCurveComposite.h" #include "/EgtDev/Include/EGkSurfFlatRegion.h" #include "/EgtDev/Include/EGkSurfTriMesh.h" -#include "/EgtDev/Include/EGkTriangle3d.h" -#include "/EgtDev/Include/EGkIntersLineTria.h" - -// ------------------------- STRUTTURE ----------------------------------------------------------- -// Informazioni su intersezione linea - volume Zmap -struct IntLineZmapInfo { - int nILTT ; // Tipo di intersezione linea-triangolo - double dU ; // Parametro sulla linea - double dU2 ; // Secondo parametro sulla linea - int nVox ; // Indice del voxel del triangolo - int nBlock ; // Indice del blocco del triangolo - Point3d ptI ; // Punto di intersezione - Point3d ptI2 ; // Secondo punto di intersezione (termine di tratto sovrapposto) - Triangle3d trTria ; // Triangolo - // Costruttori - IntLineZmapInfo( void) - : nILTT( ILTT_NO), dU( 0), dU2( 0), nVox( -1), nBlock( -1), ptI(), ptI2(), trTria() {} - IntLineZmapInfo( int nIL, double dUU, int nVx, int nBl, const Point3d& ptP, Triangle3d& trTr) - : nILTT( nIL), dU( dUU), dU2( 0), nVox( nVx), nBlock( nBl), ptI( ptP), ptI2(), trTria( trTr) {} - IntLineZmapInfo( int nIL, double dUU, double dUU2, int nVx, int nBl, - const Point3d& ptP, const Point3d& ptP2, Triangle3d& trTr) - : nILTT( nIL), dU( dUU), dU2( dUU2), nVox( nVx), nBlock( nBl), ptI( ptP), ptI2( ptP2), trTria( trTr) {} -} ; -// Vettore di IntLineZmapInfo -typedef std::vector ILZIVECTOR ; //---------------------------------------------------------------------------- class __declspec( novtable) IVolZmap : public IGeoObj @@ -60,6 +35,7 @@ class __declspec( novtable) IVolZmap : public IGeoObj virtual bool GetBlockTriangles( int nBlock, TRIA3DEXVECTOR& vTria) const = 0 ; virtual bool GetEdges( ICURVEPOVECTOR& vpCurve) const = 0 ; virtual bool GetVolume( double& dVol) const = 0 ; + virtual bool IsTriDexel( void) const = 0 ; virtual bool GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) const = 0 ; virtual int GetResolution( void) const = 0 ; virtual bool ChangeResolution( int nDexvoxRatio) = 0 ; @@ -87,19 +63,17 @@ class __declspec( novtable) IVolZmap : public IGeoObj const Point3d& ptPs, const Vector3d& vtDs, const Vector3d& vtAs, const Point3d& ptPe, const Vector3d& vtDe, const Vector3d& vtAe) = 0 ; virtual bool GetDepth( const Point3d& ptP, const Vector3d& vtDir, double& dInLength, double& dOutLength, bool bExact) const = 0 ; - virtual bool GetLineIntersection( const Point3d& ptP, const Vector3d& vtD, ILZIVECTOR& vIntersInfo) const = 0 ; - virtual bool GetPlaneIntersection( const Plane3d& plPlane, ICURVEPOVECTOR& vpLoop) const = 0 ; - virtual bool AvoidBox( const Frame3d& frBox, const Vector3d& vtDiag, double dSafeDist, bool bPrecise = false) const = 0 ; - virtual bool AvoidSphere( const Point3d& ptCenter, double dRad, double dSafeDist, bool bPrecise = false) const = 0 ; - virtual bool AvoidCylinder( const Frame3d& frCyl, double dR, double dH, double dSafeDist, bool bPrecise = false) const = 0 ; - virtual bool AvoidConeFrustum( const Frame3d& frCone, double dRadBot, double dRadTop, double dHeight, - double dSafeDist, bool bPrecise = false) const = 0 ; - virtual bool AvoidRectPrismoid( const Frame3d& frPrismoid, double dLenghtBaseX, double dLenghtBaseY, - double dLenghtTopX, double dLenghtTopY, double dHeight, - double dSafeDist, bool bPrecise = false) const = 0 ; - virtual bool AvoidTorus( const Frame3d& frTorus, double dRadMax, double dRadMin, - double dSafeDist, bool bPrecise = false) const = 0 ; - virtual bool AvoidSurfTm( const ISurfTriMesh& tmSurf, double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeBox( const Frame3d& frBox, const Vector3d& vtDiag, double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeSphere( const Point3d& ptCenter, double dRad, double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeCylinder( const Frame3d& frCyl, double dR, double dH, double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeConeFrustum( const Frame3d& frCone, double dRadBot, double dRadTop, double dHeight, + double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeRectPrismoid( const Frame3d& frPrismoid, double dLenghtBaseX, double dLenghtBaseY, + double dLenghtTopX, double dLenghtTopY, double dHeight, + double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeTorus( const Frame3d& frTorus, double dRadMax, double dRadMin, + double dSafeDist, bool bPrecise = false) const = 0 ; + virtual bool CDeSurfTm( const ISurfTriMesh& tmSurf, double dSafeDist, bool bPrecise = false) const = 0 ; virtual bool Cut( const Plane3d& plPlane) = 0 ; virtual bool Compact( void) = 0 ; virtual int GetPartCount( void) const = 0 ; diff --git a/EGnGetKeyData.h b/EGnGetKeyData.h index 6b050bd..dd0c352 100644 --- a/EGnGetKeyData.h +++ b/EGnGetKeyData.h @@ -33,3 +33,4 @@ EGN_EXPORT bool SetEGnKeyOptions( int nRet, int nKeyOpt1, int nKeyOpt2, int nKey EGN_EXPORT int GetEGnKeyOptions( int nProd, int nVer, int nLev, unsigned int& nKeyOpt1, unsigned int& nKeyOpt2, int& nKeyOptExpDays) ; // Interpretazione della stringa di LockId EGN_EXPORT bool GetLockIdStringInfo( const std::string& sLockId, int& nKeyType, bool& bNetKey, int& nUserId) ; +EGN_EXPORT bool GetLockIdStringNetData( const std::string& sLockId, std::string& sAddrPort) ; diff --git a/EGnStringUtils.h b/EGnStringUtils.h index 8e51f5b..34002ac 100644 --- a/EGnStringUtils.h +++ b/EGnStringUtils.h @@ -245,7 +245,7 @@ const std::string ToString( const int (&nVal)[size], int nPrec = 1) inline const std::string ToString( bool bVal) { return std::string( ( bVal ? "1" : "0")) ; } -EGN_EXPORT const std::string ToString( double dVal, int nPrec = 6) ; +EGN_EXPORT const std::string ToString( double dVal, int nPrec = 6, int* pnErr = nullptr) ; template const std::string ToString( const double (&dVal)[size], int nPrec = 6) { std::string sDest ; sDest.reserve( 14 * size) ; diff --git a/EGrScene.h b/EGrScene.h index aecb3c9..84345c1 100644 --- a/EGrScene.h +++ b/EGrScene.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2022 +// EgalTech 2014-2024 //---------------------------------------------------------------------------- -// File : EGrScene.h Data : 22.10.22 Versione : 2.4j1 +// File : EGrScene.h Data : 16.02.24 Versione : 2.6b4 // Contenuto : Dichiarazione della interfaccia IEGrScene per scena OpenGL. // // // // Modifiche : 13.02.14 DS Creazione modulo. -// +// 16.02.24 DS Aggiunte Set/Get CameraDirOrizzOffset. // //---------------------------------------------------------------------------- @@ -60,10 +60,12 @@ class IEGrScene Color cColEdge, Color cColCorner) = 0 ; // Camera virtual bool SetCenter( const Point3d& ptCenter) = 0 ; + virtual bool SetCameraDirOrizzOffset( int nRightStepOffset = 0) = 0 ; virtual bool SetCamera( double dAngVertDeg, double dAngOrizzDeg, double dDist) = 0 ; virtual bool SetCamera( int nDir, double dDist = 0) = 0 ; virtual const Point3d& GetCenter( void) const = 0 ; virtual Point3d GetProjectedCenter( void) const = 0 ; + virtual int GetCameraDirOrizzOffset( void) const = 0 ; virtual void GetCamera( double* pdAngVertDeg, double* pdAngOrizzDeg, double* pdDist = nullptr) const = 0 ; virtual int GetCameraDir( void) const = 0 ; virtual const Vector3d& GetCameraUp( void) const = 0 ; @@ -96,6 +98,8 @@ class IEGrScene // Grid virtual bool SetGridShow( bool bShowGrid, bool bShowFrame) = 0 ; virtual bool SetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep) = 0 ; + virtual bool SetGridGeoAdv( double dSnapStep, int nMinLineSstep, int nMajLineSstep, + double dXmin, double dXmax, double dYmin, double dYmax) = 0 ; virtual bool SetGridColor( Color colMinLine, Color colMajLine) = 0 ; virtual void GetGridParam( double& dSnapStep, int& nExtStep) const = 0 ; virtual bool SetGlobGridParameters( int nPosFlag, double dLenX, double dLenY) = 0 ; diff --git a/EInAPI.h b/EInAPI.h index 10b24fb..3476840 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2022 +// EgalTech 2014-2024 //---------------------------------------------------------------------------- -// File : EInAPI.h Data : 06.05.22 Versione : 2.4e1 +// File : EInAPI.h Data : 09.01.24 Versione : 2.5l6 // Contenuto : API (application programming interface). // // @@ -34,6 +34,8 @@ extern "C" { // General EIN_EXPORT BOOL __stdcall EgtInit( int nDebug, const wchar_t* wsLogFile, const wchar_t* wsLogMsg) ; EIN_EXPORT BOOL __stdcall EgtExit( void) ; +typedef bool (__stdcall * pfOnTerminateProcess) ( int) ; +EIN_EXPORT BOOL __stdcall EgtSetOnTerminateProcess( pfOnTerminateProcess pFun) ; EIN_EXPORT BOOL __stdcall EgtSetUserLevel( int nUserLev) ; EIN_EXPORT int __stdcall EgtGetUserLevel( void) ; EIN_EXPORT BOOL __stdcall EgtSetKey( const wchar_t* wsKey) ; @@ -55,6 +57,7 @@ EIN_EXPORT BOOL __stdcall EgtSetNetHwKey( BOOL bNetHwKey) ; EIN_EXPORT BOOL __stdcall EgtGetKeyLevel( int nProd, int nVer, int nLev, int* pnKLev) ; EIN_EXPORT BOOL __stdcall EgtGetKeyOptions( int nProd, int nVer, int nLev, unsigned int* pnOpt2) ; EIN_EXPORT BOOL __stdcall EgtGetKeyLeftDays( int* pnLeftDays) ; +EIN_EXPORT BOOL __stdcall EgtGetKeyAssLeftDays( int* pnAssLeftDays) ; EIN_EXPORT BOOL __stdcall EgtGetKeyOptLeftDays( int* pnOptLeftDays) ; EIN_EXPORT BOOL __stdcall EgtGetOsInfo( wchar_t*& wsOs) ; EIN_EXPORT BOOL __stdcall EgtGetCpuInfo( wchar_t*& wsCpu) ; @@ -113,11 +116,13 @@ 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 EgtImport3MF( const wchar_t* wsFilePath) ; +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) ; EIN_EXPORT BOOL __stdcall EgtExportDxf( int nId, const wchar_t* wsFilePath, int nFlag, int nFilter) ; EIN_EXPORT BOOL __stdcall EgtExportStl( int nId, const wchar_t* wsFilePath, int nFilter) ; EIN_EXPORT BOOL __stdcall EgtExport3MF( int nId, const wchar_t* wsFilePath, int nFilter) ; +EIN_EXPORT BOOL __stdcall EgtExport3dm( int nId, const wchar_t* wsFilePath, int nFilter) ; EIN_EXPORT BOOL __stdcall EgtExportSvg( int nId, const wchar_t* wsFilePath, int nFilter) ; EIN_EXPORT BOOL __stdcall EgtSetThreeJSLibDir( const wchar_t* wsThreeJSLibDir) ; EIN_EXPORT BOOL __stdcall EgtExportThreeJS( int nId, const wchar_t* wsFilePath, int nFilter) ; @@ -335,6 +340,8 @@ EIN_EXPORT BOOL __stdcall EgtSelectPathObjs( int nId, BOOL bHaltOnFork) ; EIN_EXPORT int __stdcall EgtDuploNew( int nSouId) ; EIN_EXPORT BOOL __stdcall EgtDuploCount( int nSouId, int* pnCount) ; EIN_EXPORT BOOL __stdcall EgtDuploList( int nSouId, int*& vInd, int* pnCount) ; +EIN_EXPORT BOOL __stdcall EgtDuploInRawCount( int nSouId, int* pnCount) ; +EIN_EXPORT BOOL __stdcall EgtDuploWithoutRawList( int*& vInd, int* pnCount) ; EIN_EXPORT BOOL __stdcall EgtDuploSetModified( int nSouId) ; EIN_EXPORT BOOL __stdcall EgtDuploGetModified( int nSouId, BOOL* pbModif) ; EIN_EXPORT BOOL __stdcall EgtDuploSetLocked( int nDupId) ; @@ -716,7 +723,9 @@ EIN_EXPORT int __stdcall EgtGetLastMachGroup( void) ; EIN_EXPORT int __stdcall EgtGetPrevMachGroup( int nId) ; EIN_EXPORT BOOL __stdcall EgtGetMachGroupNewName( const wchar_t* wsName, wchar_t*& wsNewName) ; EIN_EXPORT int __stdcall EgtAddMachGroup( const wchar_t* wsName, const wchar_t* wsMachineName) ; +EIN_EXPORT int __stdcall EgtCopyMachGroup( const wchar_t* wsSouName, const wchar_t* wsName) ; EIN_EXPORT BOOL __stdcall EgtRemoveMachGroup( int nMGroupId) ; +EIN_EXPORT BOOL __stdcall EgtChangeMachGroupName( int nMGroupInd, const wchar_t* wsNewName) ; EIN_EXPORT BOOL __stdcall EgtGetMachGroupName( int nMGroupId, wchar_t*& wsName) ; EIN_EXPORT BOOL __stdcall EgtGetMachGroupMachineName( int nMGroupId, wchar_t*& wsMachineName) ; EIN_EXPORT int __stdcall EgtGetMachGroupId( const wchar_t* wsName) ; @@ -972,6 +981,8 @@ EIN_EXPORT BOOL __stdcall EgtSetWinRectAttribs( BOOL bOutline, const int WrCol[4 EIN_EXPORT BOOL __stdcall EgtSetGlobFrameShow( BOOL bShow) ; EIN_EXPORT BOOL __stdcall EgtSetGridShow( BOOL bShowGrid, BOOL bShowFrame) ; EIN_EXPORT BOOL __stdcall EgtSetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep) ; +EIN_EXPORT BOOL __stdcall EgtSetGridGeoAdv( double dSnapStep, int nMinLineSstep, int nMajLineSstep, + double dXmin, double dXmax, double dYmin, double dYmax) ; EIN_EXPORT BOOL __stdcall EgtSetGridColor( const int nMinCol[4], const int nMajCol[4]) ; EIN_EXPORT BOOL __stdcall EgtResize( int nW, int nH) ; EIN_EXPORT BOOL __stdcall EgtDraw( void) ; diff --git a/EMkMachMgr.h b/EMkMachMgr.h index aa95c54..bf72fd5 100644 --- a/EMkMachMgr.h +++ b/EMkMachMgr.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2022 +// EgalTech 2015-2023 //---------------------------------------------------------------------------- -// File : EMkMachMgr.h Data : 21.09.22 Versione : 2.4i4 +// File : EMkMachMgr.h Data : 28.10.23 Versione : 2.5j4 // Contenuto : Dichiarazione della interfaccia IMachMgr. // // @@ -13,6 +13,8 @@ // 10.11.20 DS Portate in interfaccia funzioni di calcolo con vettori di angoli. // 13.01.21 DS Aggiunte in interfaccia GetCalcHead e GetCalcExit. // 21.09.22 DS Aggiunta in interfaccia GetAxisOffset. +// 25.08.23 DS Aggiunta in interfaccia CopyMachGroup. +// 28.10.23 DS Aggiunte in interfaccia GetClEntAxesVal, GetToolSetupPosInCurrSetup e GetAllCurrAxesName. // //---------------------------------------------------------------------------- @@ -57,7 +59,9 @@ class __declspec( novtable) IMachMgr virtual int GetPrevMachGroup( int nId) const = 0 ; virtual bool GetMachGroupNewName( std::string& sName) const = 0 ; virtual int AddMachGroup( const std::string& sName, const std::string& sMachineName) = 0 ; + virtual int CopyMachGroup( const std::string& sSouName, const std::string& sName) = 0 ; virtual bool RemoveMachGroup( int nId) = 0 ; + virtual bool ChangeMachGroupName( int nId, const std::string& sNewName) = 0 ; virtual std::string GetMachGroupName( int nId) const = 0 ; virtual std::string GetMachGroupMachineName( int nId) const = 0 ; virtual int GetMachGroupId( const std::string& sName) const = 0 ; @@ -164,6 +168,7 @@ class __declspec( novtable) IMachMgr virtual bool ImportSetup( const std::string& sName) = 0 ; virtual bool VerifyCurrSetup( STRVECTOR& vsErrors) = 0 ; virtual bool FindToolInCurrSetup( const std::string& sTool) = 0 ; + virtual bool GetToolSetupPosInCurrSetup( const std::string& sTool, std::string& sTcPos) = 0 ; virtual bool GetToolsInCurrSetupPos( const std::string& sTcPos, STRVECTOR& vsTools) = 0 ; virtual bool UpdateCurrSetup( void) = 0 ; virtual bool EraseCurrSetup( void) = 0 ; @@ -199,7 +204,7 @@ class __declspec( novtable) IMachMgr virtual bool MdbToBeImported( const std::string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const = 0 ; virtual bool MdbImport( const std::string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported) = 0 ; - // Operations : general + // Operations : general virtual int GetOperationCount( void) const = 0 ; virtual int GetFirstOperation( void) const = 0 ; virtual int GetNextOperation( int nId) const = 0 ; @@ -262,8 +267,9 @@ class __declspec( novtable) IMachMgr virtual bool GetMachiningEndPoint( Point3d& ptEnd) const = 0 ; // CL Entities Interrogations virtual bool GetClEntMove( int nEntId, int& nMove) const = 0 ; - virtual bool GetClEntFlag( int nEntId, int& nFlag) const = 0 ; + virtual bool GetClEntFlag( int nEntId, int& nFlag, int& nFlag2) const = 0 ; virtual bool GetClEntIndex( int nEntId, int& nIndex) const = 0 ; + virtual bool GetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) const = 0 ; // Simulation virtual bool SimInit( void) = 0 ; virtual bool SimStart( bool bFirst) = 0 ; @@ -282,6 +288,7 @@ class __declspec( novtable) IMachMgr // Machine Calc virtual bool SetCalcTable( const std::string& sTable) = 0 ; virtual bool SetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) = 0 ; + virtual bool GetAllCurrAxesName( STRVECTOR& vAxName) const = 0 ; virtual bool SetRotAxisBlock( const std::string& sAxis, double dVal) = 0 ; virtual bool GetRotAxisBlocked( int nInd, std::string& sAxis, double& dVal) const = 0 ; virtual bool GetCalcTool( std::string& sTool) const = 0 ; diff --git a/EMkMachiningConst.h b/EMkMachiningConst.h index 5d70b5b..d65834a 100644 --- a/EMkMachiningConst.h +++ b/EMkMachiningConst.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2022 +// EgalTech 2015-2023 //---------------------------------------------------------------------------- -// File : EmkMachiningConst.h Data : 04.02.22 Versione : 2.4b1 +// File : EmkMachiningConst.h Data : 06.09.23 Versione : 2.5i1 // Contenuto : Costanti delle lavorazioni. // // @@ -12,6 +12,7 @@ // 03.06.20 DS Agg. MPA_TABMIN e MPA_TABMAX. // 09.11.20 DS Agg. MPA_SIDEANGFEED e MPA_STEPLAST. // 04.02.22 DS Agg. MPA_EPICYCLESRAD e MPA_EPICYCLESDIST. +// 06.09.23 DS Agg. 5AxMachining. // //---------------------------------------------------------------------------- @@ -62,7 +63,8 @@ enum MachiningType { MT_CHISELING = OPER_CHISELING, MT_SURFROUGHING = OPER_SURFROUGHING, MT_SURFFINISHING = OPER_SURFFINISHING, - MT_WATERJETTING = OPER_WATERJETTING + MT_WATERJETTING = OPER_WATERJETTING, + MT_5AXMACHINING = OPER_5AXMACHINING } ; //---------------------------------------------------------------------------- diff --git a/EMkMachiningGeoConst.h b/EMkMachiningGeoConst.h index f9e80c1..8fa2f8b 100644 --- a/EMkMachiningGeoConst.h +++ b/EMkMachiningGeoConst.h @@ -33,6 +33,7 @@ static std::string MCH_TABS = "TABS" ; static std::string MCH_PV = "PV" ; static std::string MCH_ST = "ST" ; static std::string MCH_CL = "CL" ; +static std::string MCH_DBL = "DBL" ; static std::string MCH_PATH = "P" ; // Nomi di entità CL speciali static std::string MCH_CL_CLIMB = "CLIMB" ; diff --git a/EMkOperationConst.h b/EMkOperationConst.h index 8a9f649..56b379e 100644 --- a/EMkOperationConst.h +++ b/EMkOperationConst.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2019 +// EgalTech 2015-2023 //---------------------------------------------------------------------------- -// File : EmkOperationConst.h Data : 08.07.19 Versione : 2.1g2 +// File : EmkOperationConst.h Data : 06.09.23 Versione : 2.5i1 // Contenuto : Costanti delle operazioni. // // @@ -12,6 +12,7 @@ // 03.02.17 DS Agg. Chiseling. // 25.05.19 DS Agg. SurfRoughing e SurfFinishing. // 08.07.19 DS Agg. WaterJetting. +// 06.09.23 DS Agg. 5AxMachining. // //---------------------------------------------------------------------------- @@ -31,7 +32,8 @@ enum OperType { OPER_NULL = 0, // nulla OPER_CHISELING = 0x020000, // scalpellatura OPER_SURFROUGHING = 0x040000, // sgrossatura superficie OPER_SURFFINISHING = 0x080000, // finitura superficie - OPER_WATERJETTING = 0x100000} ; // taglio water jet + OPER_WATERJETTING = 0x100000, // taglio water jet + OPER_5AXMACHINING = 0x200000} ; // lavorazione 5 assi // Controllo tipo valido bool inline IsValidDispositionType( int nType) { @@ -50,5 +52,6 @@ bool inline IsValidMachiningType( int nType) nType == OPER_CHISELING || nType == OPER_SURFROUGHING || nType == OPER_SURFFINISHING || - nType == OPER_WATERJETTING ) ; + nType == OPER_WATERJETTING || + nType == OPER_5AXMACHINING) ; } diff --git a/ENkDijkstra.h b/ENkDijkstra.h new file mode 100644 index 0000000..2118f89 --- /dev/null +++ b/ENkDijkstra.h @@ -0,0 +1,39 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : ENkDijkstra.h Data : 08.02.24 Versione : 2.6b1 +// Contenuto : Classe per calcolo del percorso a peso minimo su un grafo orientato. +// +// +// Modifiche : 02.02.2024 RE Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EgtNumCollection.h" + +//----------------------- Macro per import/export ---------------------------- +#undef ENK_EXPORT +#if defined( I_AM_ENK) // da definirsi solo nella DLL + #define ENK_EXPORT __declspec( dllexport) +#else + #define ENK_EXPORT __declspec( dllimport) +#endif + +//---------------------------------------------------------------------------- +class __declspec( novtable) IDijkstra +{ + public : + virtual ~IDijkstra( void) {} + virtual bool SetGraph( DBLMATRIX AdjMatrix, int nDestInd = -1) = 0 ; + virtual bool GetPath( INTVECTOR& vNodePath) = 0 ; +} ; + +//----------------------------------------------------------------------------- +ENK_EXPORT IDijkstra* CreateDijkstra( void) ; + +//----------------------------------------------------------------------------- +// costante per arco non presente +const double WEIGHT_NO_ADJ = 1073741823U ; diff --git a/EXeConst.h b/EXeConst.h index 446021e..181478a 100644 --- a/EXeConst.h +++ b/EXeConst.h @@ -29,6 +29,7 @@ enum FileType { FT_NULL = 0, FT_BTLX = 19, FT_3MF = 20, FT_OBJ = 21, + FT_3DM = 22 , FT_IGES = 31, FT_STEP = 32, FT_ACIS = 33, @@ -66,13 +67,16 @@ enum ApprType{ APP_LINES = 0, // come ICurve::APL_STD APP_RIGHT_CONVEX_LINES = 12, // come ICurve::APL_RIGHT_CONVEX APP_ARCS = 3} ; -//----------------- Costanti tipo punto intersezione Linea SurfTriMesh --------- -enum SLiType { SLT_NONE = 0, - SLT_IN = 1, - SLT_OUT = 2, - SLT_TG_INI = 3, - SLT_TG_FIN = 4, - SLT_TOUCH = 5} ; +//----------------- Costanti tipo punto intersezione Linea Curva --------------- +enum CLiType { CLT_NONE = 0, + CLT_IN = 1, + CLT_OUT = 2, + CLT_TOUCH_IN = 3, + CLT_TOUCH_OUT = 4, + CLT_TGINI_IN = 5, + CLT_TGFIN_IN = 6, + CLT_TGINI_OUT = 7, + CLT_TGFIN_OUT = 8} ; //----------------- Costanti tipo di costruzione di superficie rigata ---------- enum RuledType{ RUL_TYPE_ISOPAR = 0, // come ISurfTrimesh::RLT_ISOPAR diff --git a/EXeExecutor.h b/EXeExecutor.h index e997a69..34a1238 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2022 +// EgalTech 2015-2024 //---------------------------------------------------------------------------- -// File : EXcExecutor.h Data : 06.05.22 Versione : 2.4e1 +// File : EXcExecutor.h Data : 09.01.24 Versione : 2.5l6 // Contenuto : Interfaccia Executor. // // @@ -37,6 +37,8 @@ class LuaMgr ; // General EXE_EXPORT bool ExeInit( int nDebug, const std::string& sLogFile, const std::string& sLogMsg) ; EXE_EXPORT bool ExeExit( void) ; +EXE_EXPORT bool ExeSetOnTerminateProcess( pfOnTerminateProcess pFun) ; +EXE_EXPORT bool ExeOnTerminateProcess( int nExitCode) ; EXE_EXPORT int ExeGetDebugLevel( void) ; EXE_EXPORT bool ExeSetUserLevel( int nUserLev) ; EXE_EXPORT int ExeGetUserLevel( void) ; @@ -56,10 +58,11 @@ EXE_EXPORT bool ExeGetVersionInfo( std::string& sVer, const char* szNewLine) ; EXE_EXPORT bool ExeGetKeyInfo( std::string& sKey) ; EXE_EXPORT bool ExeSetLockType( int nType) ; EXE_EXPORT bool ExeSetLockId( const std::string& sLockId) ; -EXE_EXPORT bool ExeSetNetHwKey( bool bNetHwKey, int nUserId = 0) ; +EXE_EXPORT bool ExeSetNetHwKey( bool bNetHwKey, int nUserId = 0, const std::string& sAddrPort = "") ; EXE_EXPORT bool ExeGetKeyLevel( int nProd, int nVer, int nLev, int& nKLev) ; EXE_EXPORT bool ExeGetKeyOptions( int nProd, int nVer, int nLev, unsigned int& nOpt2) ; EXE_EXPORT bool ExeGetKeyLeftDays( int& nLeftDays) ; +EXE_EXPORT bool ExeGetKeyAssLeftDays( int& nAssLeftDays) ; EXE_EXPORT bool ExeGetKeyOptLeftDays( int& nOptLeftDays) ; EXE_EXPORT bool ExeGetOsInfo( std::string& sOs) ; EXE_EXPORT bool ExeGetCpuInfo( std::string& sCpu) ; @@ -121,11 +124,13 @@ 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 ExeImport3MF( const std::string& sFilePath) ; +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) ; EXE_EXPORT bool ExeExportDxf( int nId, const std::string& sFilePath, int nFlag = 1, int nFilter = 393) ; EXE_EXPORT bool ExeExportStl( int nId, const std::string& sFilePath, int nFilter = 393) ; EXE_EXPORT bool ExeExport3MF( int nId, const std::string& sFilePath, int nFilter = 393) ; +EXE_EXPORT bool ExeExport3dm( int nId, const std::string& sFilePath, int nFilter = 393) ; EXE_EXPORT bool ExeExportSvg( int nId, const std::string& sFilePath, int nFilter = 393) ; EXE_EXPORT bool ExeSetThreeJSLibDir( const std::string & sThreeJSLibDir) ; EXE_EXPORT bool ExeExportThreeJS( int nId, const std::string& sFilePath, int nFilter = 393) ; @@ -314,7 +319,7 @@ EXE_EXPORT int ExeCreateCirclesAlongCurve( int nParentId, int nCrvId, double dO double dStartAdd, double dEndAdd, double dDiam, int* pnCount) ; // GeomDB Create Surf EXE_EXPORT int ExeCreateSurfFlatRegion( int nParentId, const INTVECTOR& vCrvIds, int* pnCount) ; -EXE_EXPORT int ExeCreateSurfFrFatCurve( int nParentId, int nCrvId, double dRad, bool bSquared) ; +EXE_EXPORT int ExeCreateSurfFrFatCurve( int nParentId, int nCrvId, double dRad, bool bSquaredEnds, bool bSquaredMids, double dLinTol) ; EXE_EXPORT int ExeCreateSurfFrRectangle( int nParentId, const Point3d& ptIni, const Point3d& ptCross, int nRefType) ; EXE_EXPORT int ExeCreateSurfFrRectangle3P( int nParentId, const Point3d& ptIni, const Point3d& ptCross, const Point3d& ptDir, int nRefType) ; @@ -333,6 +338,8 @@ EXE_EXPORT int ExeCreateSurfTmCone( int nParentId, const Point3d& ptOrig, const double dRad, double dHeight, double dLinTol, int nRefType) ; EXE_EXPORT int ExeCreateSurfTmSphere( int nParentId, const Point3d& ptOrig, double dRad, double dLinTol, int nRefType) ; +EXE_EXPORT int ExeCreateSurfTmTriangle( int nParentId, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3, int nRefType) ; +EXE_EXPORT int ExeCreateSurfTmRectangle( int nParentId, const Point3d& ptO, const Point3d& ptL, const Point3d& ptT, int nRefType) ; EXE_EXPORT int ExeCreateSurfTmByFlatContour( int nParentId, int nCrvId, double dLinTol) ; EXE_EXPORT int ExeCreateSurfTmByRegion( int nParentId, const INTVECTOR& vCrvIds, double dLinTol) ; EXE_EXPORT int ExeCreateSurfTmByExtrusion( int nParentId, const INTVECTOR& vCrvIds, const Vector3d& vtExtr, @@ -348,6 +355,7 @@ EXE_EXPORT int ExeCreateSurfTmByScrewing( int nParentId, int nCrvId, EXE_EXPORT int ExeCreateSurfTmRectSwept( int nParentId, double dDimH, double dDimV, double dBevelH, double dBevelV, int nGuideId, int nCapType, double dLinTol) ; EXE_EXPORT int ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, double dLinTol) ; +EXE_EXPORT int ExeCreateSurfTmTransSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, double dLinTol) ; EXE_EXPORT int ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, int nType, double dLinTol) ; EXE_EXPORT int ExeCreateSurfTmByTriangles( int nParentId, const INTVECTOR& vIds, bool bErase) ; EXE_EXPORT int ExeCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase) ; @@ -355,6 +363,7 @@ EXE_EXPORT int ExeCreateSurfTmBySurfBezier( int nParentId, int nSbezId) ; EXE_EXPORT int ExeCreateSurfTmByVolZmap( int nParentId, int nZmapId, int nPart) ; EXE_EXPORT int ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV, const PNTVECTOR& vPnt, int nRefType) ; EXE_EXPORT int ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV, const PNTUVECTOR& vPntW, int nRefType) ; +EXE_EXPORT int ExeCreateSurfBezierLeaves( int nParentId, int nSurfBzId, int nTextHeight = 50, bool bShowTrim = false, int* pnCount = nullptr) ; // GeomDB Create Volume EXE_EXPORT int ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX, @@ -378,6 +387,7 @@ EXE_EXPORT int ExeGetFirstLayer( int nPartId, bool bOnlyVisible) ; EXE_EXPORT int ExeGetNextLayer( int nId, bool bOnlyVisible) ; EXE_EXPORT int ExeGetLastLayer( int nPartId, bool bOnlyVisible) ; EXE_EXPORT int ExeGetPrevLayer( int nId, bool bOnlyVisible) ; +EXE_EXPORT bool ExeIsGhostPart( int nGhostId) ; EXE_EXPORT int ExeGetFirstGhostPart( void) ; EXE_EXPORT int ExeGetNextGhostPart( int nId) ; EXE_EXPORT bool ExeEraseEmptyParts( void) ; @@ -389,6 +399,8 @@ EXE_EXPORT bool ExeSelectPathObjs( int nId, bool bHaltOnFork) ; EXE_EXPORT int ExeDuploNew( int nSouId) ; EXE_EXPORT bool ExeDuploCount( int nSouId, int& nCount) ; EXE_EXPORT bool ExeDuploList( int nSouId, INTVECTOR& vnRef) ; +EXE_EXPORT bool ExeDuploInRawCount( int nSouId, int& nCount) ; +EXE_EXPORT bool ExeDuploWithoutRawList( INTVECTOR& vnRef) ; EXE_EXPORT bool ExeDuploSetModified( int nSouId) ; EXE_EXPORT bool ExeDuploGetModified( int nSouId, bool& bModif) ; EXE_EXPORT bool ExeDuploSetLocked( int nDupId) ; @@ -527,9 +539,9 @@ EXE_EXPORT int ExeSplitText( int nId, int* pnCount) ; // GeomDb Curve Modify EXE_EXPORT bool ExeInvertCurve( const INTVECTOR& vIds) ; EXE_EXPORT bool ExeOffsetCurve( int nId, double dDist, int nType) ; -EXE_EXPORT int ExeOffsetCurveAdv( int nId, double dDist, int nType, int* pnCount) ; +EXE_EXPORT int ExeOffsetCurveAdv( int nId, double dDist, int nType, int* pnCount, double dLinTol = 10 * EPS_SMALL) ; EXE_EXPORT int ExeCurveMedialAxis( int nId) ; -EXE_EXPORT bool ExeApproxCurve( int nId, int nApprType, double dLinTol) ; +EXE_EXPORT bool ExeApproxCurve( int nId, int nApprType, double dLinTol, double dMaxSegmLen = INFINITO) ; EXE_EXPORT bool ExeProjectCurveOnPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, int nRefType) ; EXE_EXPORT bool ExeChangeClosedCurveStart( int nId, double dU) ; EXE_EXPORT bool ExeChangeClosedCurveStartPoint( int nId, const Point3d& ptP, int nRefType) ; @@ -581,6 +593,11 @@ EXE_EXPORT bool ExeMergeCurvesInCurveCompo( int nId, double dLinTol, bool bStart EXE_EXPORT bool ExeRemoveCurveCompoUndercutOnY( int nId, double dLinTol) ; 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 int ExeCurveGetVoronoi( int nId, int nDestGrpId, int nBound, int* pnCount) ; +EXE_EXPORT int ExeCurveGetMedialAxis( int nId, int nDestGrpId, int nSide, int* pnCount) ; +EXE_EXPORT int ExeCurveGetFatCurve( int nId, int nDestGrpId, double dRad, bool bSquareEnds, bool bSquareMids, int* pnCount) ; // GeomDb Surf Modify EXE_EXPORT bool ExeInvertSurface( const INTVECTOR& vIds) ; @@ -590,6 +607,7 @@ EXE_EXPORT bool ExeSurfFrAdd( int nId1, int nId2) ; EXE_EXPORT bool ExeSurfFrSubtract( int nId1, int nId2) ; EXE_EXPORT bool ExeSurfFrIntersect( int nId1, int nId2) ; EXE_EXPORT bool ExeSurfFrOffset( int nId, double dDist, int nType) ; +EXE_EXPORT bool ExeSurfFrOffsetAdv( int nId, double dDist, int nType, int& nNewId) ; EXE_EXPORT bool ExeSurfFrMoveSimpleNoCollision( int nId1, int nId2, const Vector3d& vtDir, double& dLen, int nRefType) ; EXE_EXPORT bool ExeSurfFrRotateSimpleNoCollision( int nId1, int nId2, const Point3d& ptCen, double& dAngDeg, int nRefType) ; EXE_EXPORT bool ExeSurfTmMoveVertex( int nId, int nVert, const Point3d& ptNewVert, int nRefType, bool bUpdate) ; @@ -605,6 +623,10 @@ EXE_EXPORT bool ExeSurfTmIntersect( int nId1, int nId2, bool bTwoColors = false) EXE_EXPORT bool ExeSurfTmResetTwoColors( int nId) ; EXE_EXPORT int ExeSurfTmSplit( int nId, int nSplitterId, int* pnCount) ; EXE_EXPORT bool ExeSurfTmCut( int nId, int nCutterId, bool bInVsOut, bool bSaveOnEq) ; +EXE_EXPORT bool ExeSurfTmSubtractProjectedFacesOnFace( int nSurfId, int nFaceInd, int nDestGrpId, + INTVECTOR vSurfsId, bool bOCFlag, + bool& bExistProjection, int& nNewId, int& nNewFaceNbr) ; +EXE_EXPORT bool ExeSurfBzTrim( int nId, int nCutterId) ; // GeomDb Volume Modify EXE_EXPORT int ExeExplodeVolume( int nId, int* pnCount) ; @@ -636,6 +658,10 @@ EXE_EXPORT bool ExeTextGetFont( int nId, std::string& sFont) ; EXE_EXPORT bool ExeTextGetHeight( int nId, double& dH) ; EXE_EXPORT bool ExeTextGetItalic( int nId, bool& bItl) ; +// GeomDb Get Pocketing +EXE_EXPORT bool ExePocketing( const int nId, double dRad, double dStep, double dAngle, int nType, bool bSmooth, int nDestGrpId, int& nFirstId, int& nCrvCount) ; +EXE_EXPORT int ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bool bSmooth, bool bRemoveOverlapLink,int* pnCount) ; + // GeomDb Curve Get EXE_EXPORT bool ExeCurveDomain( int nId, double* pdStart, double* pdEnd) ; EXE_EXPORT bool ExeCurveLength( int nId, double* pdLen) ; @@ -676,8 +702,7 @@ EXE_EXPORT bool ExeSurfFrTestExternal( int nId1, int nId2, double dMinDist) ; EXE_EXPORT int ExeSurfFrChunkCount( int nId) ; EXE_EXPORT int ExeSurfFrChunkSimpleClassify( int nId1, int nChunk1, int nId2, int nChunk2, double dToler = 0) ; EXE_EXPORT int ExeExtractSurfFrChunkLoops( int nId, int nChunk, int nDestGrpId, int* pnCount) ; -EXE_EXPORT int ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bool bStepCorrection, - bool bInvert, int* pnCount) ; +EXE_EXPORT int ExeSurfFrGetZigZagInfill( int nId, int nDestGrpId, double dStep, double dAng, bool bSmooth, int* pnCount) ; EXE_EXPORT int ExeSurfTmVertexCount( int nId) ; EXE_EXPORT int ExeSurfTmFacetCount( int nId) ; EXE_EXPORT int ExeSurfTmPartCount( int nId) ; @@ -692,19 +717,22 @@ EXE_EXPORT bool ExeSurfTmFacetNearestMidPoint( int nId, int nFacet, const Point3 EXE_EXPORT bool ExeSurfTmFacetCenter( int nId, int nFacet, int nRefId, Point3d& ptCen, Vector3d& vtN) ; EXE_EXPORT bool ExeSurfTmFacetNormVersor( int nId, int nFacet, int nRefId, Vector3d& vtNorm) ; EXE_EXPORT bool ExeSurfTmFacetMinAreaRectangle( int nId, int nFacet, int nRefId, Frame3d& frRect, double& dDimX, double& dDimY) ; +EXE_EXPORT bool ExeSurfTmFacetElevationInBBox( int nId, int nFacet, const BBox3d& b3Box, bool bAcceptOutFacet, int nRefId, double& dElev) ; +EXE_EXPORT bool ExeSurfTmFacetElevationInClosedSurfTm( int nFacetStmId, int nFacet, int nClosedStmId, bool bAcceptOutFacet, double& dElev) ; EXE_EXPORT bool ExeSurfTmFacetOppositeSide( int nId, int nFacet, const Vector3d& vtDir, int nRefId, Point3d& ptP1, Point3d& ptP2) ; EXE_EXPORT bool ExeSurfTmFacetOppositeSideEx( int nId, int nFacet, const Vector3d& vtDir, int nRefId, Point3d& ptP1, Point3d& ptPm, Point3d& ptP2, Vector3d& vtIn1, Vector3d& vtOut2, double& dLen, double& dWidth) ; EXE_EXPORT bool ExeSurfTmFacetsContact( int nId, int nF1, int nF2, int nRefId, bool& bAdjac, Point3d& ptP1, Point3d& ptP2, double& dAng) ; EXE_EXPORT int ExeExtractSurfTmLoops( int nId, int nDestGrpId, int* pnCount) ; -EXE_EXPORT int ExeGetSurfTmSilhouette( int nId, const Vector3d& vtDir, double dToler, int nDestGrpId, int nRefType, int* pnCount) ; +EXE_EXPORT int ExeGetSurfTmSilhouette( int nId, const Vector3d& vtDir, double dToler, int nDestGrpId, int nRefType, int* pnCount, bool bAllTria = false) ; EXE_EXPORT int ExeExtractSurfTmFacetLoops( int nId, int nFacet, int nDestGrpId, int* pnCount) ; EXE_EXPORT int ExeCopySurfTmFacet( int nId, int nFacet, int nDestGrpId) ; EXE_EXPORT bool ExeSurfTmGetAllVertInFacet( int nId, int nFacet, INTVECTOR& vVert) ; EXE_EXPORT bool ExeSurfTmGetFacetBBox( int nId, int nFacet, int nFlag, BBox3d& b3Box) ; EXE_EXPORT bool ExeSurfTmGetFacetBBoxGlob( int nId, int nFacet, int nFlag, BBox3d& b3Box) ; EXE_EXPORT bool ExeSurfTmGetFacetBBoxRef( int nId, int nFacet, int nFlag, const Frame3d& frRef, BBox3d& b3Box) ; +EXE_EXPORT int ExeSurfTmGetEdges( int nId, int nDestGrpId, bool bSmoothAng, int* pnCount) ; EXE_EXPORT bool ExeSurfBezierGetPoint( int nSurfId, double dU, double dV, int nRefId, Point3d& ptP) ; EXE_EXPORT bool ExeSurfBezierGetPointD1( int nSurfId, double dU, double dV, int nUsd, int nVsd, int nRefId, Point3d& ptP, Vector3d& vtDerU, Vector3d& vtDerV) ; @@ -775,21 +803,30 @@ EXE_EXPORT bool ExePointSurfTmDist( const Point3d& ptP, int nStmId, int nRefType double* pdDist, Point3d& ptMin, int* pnTria) ; // Geo Intersect -EXE_EXPORT bool ExeLineBoxInters( const Point3d& ptP, const Vector3d& vtDir, const BBox3d& b3Box, INTDBLVECTOR& vInters) ; +EXE_EXPORT bool ExeLineCurveInters( const Point3d& ptP, const Vector3d& vtDir, const int nId, const int nRefType, + INTDBLVECTOR& vInters) ; +EXE_EXPORT bool ExeLineBoxInters( const Point3d& ptP, const Vector3d& vtDir, const BBox3d& b3Box, + INTDBLVECTOR& vInters) ; +EXE_EXPORT bool ExeLineSurfTmInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, + INTDBLVECTOR& vInters) ; +EXE_EXPORT bool ExeLineVolZmapInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, + INTDBLVECTOR& vInters) ; +EXE_EXPORT int ExePlaneCurveInters( const Point3d& ptOn, const Vector3d& vtN, const int nId, const int nDestGrpId, const int nRefType, + int* pnCount) ; EXE_EXPORT int ExePlaneBoxInters( const Point3d& ptOn, const Vector3d& vtN, const BBox3d& b3Box, int nDestGrpId, int nRefType, int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ; -EXE_EXPORT bool ExeLineSurfTmInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters) ; EXE_EXPORT int ExePlaneSurfTmInters( const Point3d& ptOn, const Vector3d& vtN, int nId, int nDestGrpId, int nRefType, double dToler, int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ; -EXE_EXPORT int ExeParPlanesSurfTmInters( const Point3d& ptOn, const Vector3d& vtN, const DBLVECTOR& vdDist, int nId, int nDestGrpId, int nRefType, double dToler, - int* pnGrpCount) ; -EXE_EXPORT int ExeSurfTmSurfTmInters( int nId1, int nId2, int nDestGrpId, double dToler, - int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ; -EXE_EXPORT int ExePlaneCurveInters( const Point3d& ptOn, const Vector3d& vtN, const int nId, const int nDestGrpId, const int nRefType, int* pnCount) ; -EXE_EXPORT int ExeCurveCurveInters( const int nId1, const int nId2, const int nDestGrpId, int* pnPntCount, int* pnCrvCount) ; -EXE_EXPORT bool ExeLineVolZmapInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters) ; +EXE_EXPORT int ExeParPlanesSurfTmInters( const Point3d& ptOn, const Vector3d& vtN, const DBLVECTOR& vdDist, int nId, int nDestGrpId, int nRefType, double dToler, + int* pnGrpCount) ; EXE_EXPORT int ExePlaneVolZmapInters( const Point3d& ptOn, const Vector3d& vtN, int nId, int nDestGrpId, int nRefType, int* pnCount) ; +EXE_EXPORT int ExeCurveCurveInters( const int nId1, const int nId2, const int nDestGrpId, + int* pnPntCount, int* pnCrvCount) ; +EXE_EXPORT int ExeCurveSurfTmInters( const int nCrvId, const int nStmId, const int nDestGrpId, + int* pnPntCount, int* pnCrvCount) ; +EXE_EXPORT int ExeSurfTmSurfTmInters( int nId1, int nId2, int nDestGrpId, double dToler, + int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ; // Collision Detection EXE_EXPORT int ExeCDeBoxSolid( const Frame3d& frBox, const Vector3d& vtDiag, int nSolidId, double dSafeDist, int nRefType) ; @@ -875,6 +912,7 @@ EXE_EXPORT bool ExeCAvSetAdvTool( double dToolLen, double dToolDiam, double dTip EXE_EXPORT bool ExeCAvSetSawTool( double dToolLen, double dToolDiam, double dThickness, double dStemDiam, double dToolCornR) ; EXE_EXPORT bool ExeCAvSetGenTool( int nToolSectId) ; EXE_EXPORT int ExeCAvGetToolOutline( int nDestGrpId, bool bApprox = false) ; +EXE_EXPORT double ExeCAvToolPosBox( const Point3d& ptP, const Vector3d& vtAx, const BBox3d& b3Box, const Vector3d& vtMove) ; EXE_EXPORT double ExeCAvToolPosStm( const Point3d& ptP, const Vector3d& vtAx, int nSurfTmId, const Vector3d& vtMove, int nRefType) ; EXE_EXPORT bool ExeCAvToolPathStm( int nCrvId, const Vector3d& vtAx, int nSurfTmId, const Vector3d& vtMove, double dLinTol, int nRefType) ; @@ -899,7 +937,9 @@ EXE_EXPORT int ExeGetLastMachGroup( void) ; EXE_EXPORT int ExeGetPrevMachGroup( int nId) ; EXE_EXPORT bool ExeGetMachGroupNewName( std::string& sName) ; EXE_EXPORT int ExeAddMachGroup( const std::string& sName, const std::string& sMachineName) ; +EXE_EXPORT int ExeCopyMachGroup( const std::string& sSouName, const std::string& sName) ; EXE_EXPORT bool ExeRemoveMachGroup( int nMGroupId) ; +EXE_EXPORT bool ExeChangeMachGroupName( int nId, const std::string& sNewName) ; EXE_EXPORT bool ExeGetMachGroupName( int nId, std::string& sName) ; EXE_EXPORT bool ExeGetMachGroupMachineName( int nId, std::string& sMachineName) ; EXE_EXPORT int ExeGetMachGroupId( const std::string& sName) ; @@ -1006,6 +1046,7 @@ EXE_EXPORT bool ExeGetDefaultSetupName( std::string& sName) ; EXE_EXPORT bool ExeImportSetup( const std::string& sName) ; EXE_EXPORT bool ExeVerifyCurrSetup( STRVECTOR& vsErrors) ; EXE_EXPORT bool ExeFindToolInCurrSetup( const std::string& sTool) ; +EXE_EXPORT bool ExeGetToolSetupPosInCurrSetup( const std::string& sTool, std::string& sTcPos) ; EXE_EXPORT bool ExeGetToolsInCurrSetupPos( const std::string& sTcPos, STRVECTOR& vsTools) ; EXE_EXPORT bool ExeUpdateCurrSetup( void) ; EXE_EXPORT bool ExeEraseCurrSetup( void) ; @@ -1104,8 +1145,10 @@ EXE_EXPORT bool ExeUpdateAllMachinings( bool bStopOnFirstErr, std::string& sErrL EXE_EXPORT bool ExeUpdateAllMachiningsEx( bool bStopOnFirstErr, std::string& sErrList, std::string& sWarnList) ; // CL Entities Interrogations EXE_EXPORT bool ExeGetClEntMove( int nEntId, int& nMove) ; -EXE_EXPORT bool ExeGetClEntFlag( int nEntId, int& nFlag) ; +EXE_EXPORT bool ExeGetClEntFlag( int nEntId, int& nFlag, int& nFlag2) ; EXE_EXPORT bool ExeGetClEntIndex( int nEntId, int& nIndex) ; +EXE_EXPORT bool ExeGetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) ; + // Simulation EXE_EXPORT bool ExeSimInit( void) ; EXE_EXPORT bool ExeSimStart( bool bFirst) ; @@ -1139,6 +1182,7 @@ EXE_EXPORT bool ExeGetAllTcPosNames( STRVECTOR& vNames) ; // Machine Calc EXE_EXPORT bool ExeSetCalcTable( const std::string& sTable) ; EXE_EXPORT bool ExeSetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) ; +EXE_EXPORT bool ExeGetAllCurrAxesName( STRVECTOR& vAxName) ; EXE_EXPORT bool ExeSetRotAxisBlock( const std::string& sAxis, double dVal) ; EXE_EXPORT bool ExeGetCalcTool( std::string& sTool, std::string& sHead, int& nExit) ; EXE_EXPORT bool ExeGetRotAxisBlocked( int nInd, std::string& sAxis, double& dVal) ; @@ -1185,6 +1229,8 @@ EXE_EXPORT bool ExeSetWinRectAttribs( bool bOutline, Color WrCol) ; EXE_EXPORT bool ExeSetGlobFrameShow( bool bShow) ; EXE_EXPORT bool ExeSetGridShow( bool bShowGrid, bool bShowFrame) ; EXE_EXPORT bool ExeSetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep) ; +EXE_EXPORT bool ExeSetGridGeoAdv( double dSnapStep, int nMinLineSstep, int nMajLineSstep, + double dXmin, double dXmax, double dYmin, double dYmax) ; EXE_EXPORT bool ExeSetGridColor( Color colMin, Color colMaj) ; EXE_EXPORT bool ExeResize( int nW, int nH) ; EXE_EXPORT bool ExeDraw( void) ; @@ -1220,11 +1266,13 @@ EXE_EXPORT bool ExeResetGeoTria( bool bRedraw) ; EXE_EXPORT bool ExeSetWinRect( int nPrevX, int nPrevY, int nCurrX, int nCurrY, bool bRedraw) ; EXE_EXPORT bool ExeResetWinRect( bool bRedraw) ; EXE_EXPORT bool ExeZoomWin( int nPrevX, int nPrevY, int nCurrX, int nCurrY, bool bRedraw) ; +EXE_EXPORT bool ExeSetViewOrizzOffsStep( int nDirOffsStep = 0) ; EXE_EXPORT bool ExeSetView( int nDir, bool bRedraw) ; EXE_EXPORT bool ExeSetGenericView( double dAngVertDeg, double dAngHorizDeg, bool bRedraw) ; EXE_EXPORT bool ExeSetViewCenter( const Point3d& ptP, bool bRedraw) ; EXE_EXPORT bool ExePanView( int nPrevX, int nPrevY, int nCurrX, int nCurrY, bool bRedraw) ; EXE_EXPORT bool ExeRotateView( int nPrevX, int nPrevY, int nCurrX, int nCurrY, bool bRedraw) ; +EXE_EXPORT bool ExeGetViewOrizzOffsStep( int* pnDirOffsStep) ; EXE_EXPORT bool ExeGetView( int* pnDir) ; EXE_EXPORT bool ExeGetGenericView( double* pdAngVertDeg, double* pdAngHorizDeg) ; EXE_EXPORT bool ExeGetViewUp( Vector3d& vtUp) ; diff --git a/EgtExecMgr.h b/EgtExecMgr.h index 92ad538..c54d5e9 100644 --- a/EgtExecMgr.h +++ b/EgtExecMgr.h @@ -37,7 +37,7 @@ class ExecManager { return m_pExecMap.insert( std::pair< std::string, Exec>( sName, eFunc)).second ; } int Execute( T& Executor, const std::string& sCmd1, const std::string& sCmd2, const STRVECTOR& vsParams) - { KeyExecMap::iterator Iter = m_pExecMap.find( sCmd1) ; + { const auto Iter = m_pExecMap.find( sCmd1) ; if ( Iter != m_pExecMap.end() && (Iter->second) != nullptr) { if ( ( Executor.*(Iter->second))( sCmd2, vsParams)) return ER_OK ; diff --git a/EgtFunPtrType.h b/EgtFunPtrType.h index fe4c6dd..853e7a1 100644 --- a/EgtFunPtrType.h +++ b/EgtFunPtrType.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2018-2018 +// EgalTech 2018-2023 //---------------------------------------------------------------------------- -// File : EgtFunPtrType.h Data : 19.07.18 Versione : 1.9g2 +// File : EgtFunPtrType.h Data : 23.11.23 Versione : 2.5k5 // Contenuto : Dichiarazione tipi puntatori a funzione. // // // // Modifiche : 19.07.18 DS Creazione modulo. -// +// 23.11.23 DS Aggiunta pfOnTerminateProcess. // //---------------------------------------------------------------------------- @@ -16,5 +16,6 @@ #include //---------------------------------------------------------------------------- -typedef int (__stdcall * pfProcEvents) (int, int) ; +typedef bool (__stdcall * pfOnTerminateProcess) ( int) ; +typedef int (__stdcall * pfProcEvents) ( int, int) ; typedef bool (__stdcall * pfOutText) ( const std::string&) ; diff --git a/EgtKeyCodes.h b/EgtKeyCodes.h index b19d875..cf707a4 100644 --- a/EgtKeyCodes.h +++ b/EgtKeyCodes.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2015-2023 +// EgalTech 2015-2024 //---------------------------------------------------------------------------- -// File : EgtKeyCodes.h Data : 01.01.23 Versione : 2.5a1 +// File : EgtKeyCodes.h Data : 16.01.24 Versione : 2.6a1 // Contenuto : Costanti per codici di protezione librerie di base. // // @@ -17,6 +17,7 @@ // 01.01.21 DS Nuova gestione KEY_BASELIB_VER con versione prodotto e mese. // 01.01.22 DS Passaggio a versione 24. // 01.01.23 DS Passaggio a versione 25. +// 16.01.24 DS Passaggio a versione 26. // //---------------------------------------------------------------------------- @@ -24,7 +25,7 @@ //---------------------------------------------------------------------------- const int KEY_BASELIB_PROD = 207 ; -const int KEY_BASELIB_VER = 2508 ; +const int KEY_BASELIB_VER = 2603 ; const int KEY_BASELIB_LEV = 1 ; //---------------------------------------------------------------------------- diff --git a/EgtLogger.h b/EgtLogger.h index 24a52a7..66a6051 100644 --- a/EgtLogger.h +++ b/EgtLogger.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- -// EgalTech 2013-2013 +// EgalTech 2013-2023 //---------------------------------------------------------------------------- -// File : EgtLogger.h Data : 06.12.13 Versione : 1.4a4 +// File : EgtLogger.h Data : 15.12.23 Versione : 2.5l3 // Contenuto : Classi per logger. // // // // Modifiche : 06.12.13 DS Creazione modulo. -// +// 15.12.23 DS Ora default è thread safe. // //---------------------------------------------------------------------------- @@ -76,7 +76,7 @@ namespace egtlogger } ; public : - Logger( LogLevel nLevel, const char* szName, bool bThreadSafe = false, + Logger( LogLevel nLevel, const char* szName, bool bThreadSafe = true, int nLoggableItems = LI_DATETIME | LI_LOGGERNAME | LI_LOGGERLEVEL | LI_FUNCTION | LI_LINENUMBER) : m_nLevel( nLevel), m_name( szName), m_threadProtect( bThreadSafe), m_loggableItem( nLoggableItems) {} @@ -109,8 +109,7 @@ namespace egtlogger void ClearOutputStreams( void) { - std::vector::iterator iter ; - for ( iter = m_outputStreams.begin(); iter < m_outputStreams.end() ; ++iter) { + for ( auto iter = m_outputStreams.cbegin() ; iter < m_outputStreams.cend() ; ++iter) { if ( iter->bOwned) delete iter->pStream ; } @@ -127,8 +126,7 @@ namespace egtlogger { m_threadProtect.Lock() ; - std::vector::iterator iter ; - for ( iter = m_outputStreams.begin() ; iter < m_outputStreams.end() ; ++iter) { + for ( auto iter = m_outputStreams.cbegin() ; iter < m_outputStreams.cend() ; ++iter) { if ( nLevel < iter->nLevel) continue ; diff --git a/SELkKeyProc.h b/SELkKeyProc.h index 8a74a06..673d6ac 100644 --- a/SELkKeyProc.h +++ b/SELkKeyProc.h @@ -1,13 +1,14 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2015 +// EgalTech 2014-2024 //---------------------------------------------------------------------------- -// File : SELkKeyProc.h Data : 27.07.15 Versione : 1.6g1 +// File : SELkKeyProc.h Data : 25.01.24 Versione : 2.6a1 // Contenuto : Dichiarazione funzioni per la gestione della chiave. // // // // Modifiche : 10.09.14 DS Creazione modulo. // 27.02.15 DS Agg. gestione chiavi hardware OxySec. +// 25.01.24 DS Agg. GetKeyLevelEx per scadenza assistenza. // //---------------------------------------------------------------------------- @@ -25,6 +26,8 @@ bool ReadKey( const std::string& sKey, const std::string& sScramKey, int VerifyKey( const std::string& sKey, int nProd, int nVer, int nLev) ; int GetKeyLevel( const std::string& sKey, int nProd, int nVer, int nLev, int& nKLev, int& nKExpDays) ; +int GetKeyLevelEx( const std::string& sKey, int nProd, int nVer, int nLev, + int& nKLev, int& nKExpDays, int& nKAssExpDays) ; int GetKeyOptions( const std::string& sKey, int nProd, int nVer, int nLev, unsigned int& nKOpt1, unsigned int& nKOpt2, int& nKOptExpDays) ; int GetCurrDay( void) ; diff --git a/SELkLockId.h b/SELkLockId.h index 4758594..f7a6b09 100644 --- a/SELkLockId.h +++ b/SELkLockId.h @@ -19,8 +19,8 @@ //------------------------------------------------------------------------------- // Imposto il tipo di protezione ammessa (ANY, HW, SW) bool SetLockType( int nType) ; -// Imposto chiave di rete e identificativo utente (0-9) -bool SetNetHwKey( bool bNetHwKey, int nUserId) ; +// Imposto chiave di rete, identificativo utente (0-9) e indirizzo +bool SetNetHwKey( bool bNetHwKey, int nUserId, const std::string& sAddrPort) ; // Libero chiave di rete (da eseguire al termine del programma) bool CloseNetHwKey( void) ; // Recupero l'identificativo in chiaro della protezione