From a0244abf468797732883025c2e0699da3d50bca7 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 5 Apr 2024 16:50:05 +0200 Subject: [PATCH] Include : - aggiornamento prototipi - aggiunti prototipi per RotationMinimazingFrame e RotationXplaneFrame. --- EGkGeoCollection.h | 7 +++++ EGkRotationMinimizingFrame.h | 50 +++++++++++++++++++++++++++++++++++ EGkRotationXplaneFrame.h | 51 ++++++++++++++++++++++++++++++++++++ EGkStmFromCurves.h | 10 ++++--- EInAPI.h | 7 ++--- EXeExecutor.h | 3 ++- 6 files changed, 120 insertions(+), 8 deletions(-) create mode 100644 EGkRotationMinimizingFrame.h create mode 100644 EGkRotationXplaneFrame.h diff --git a/EGkGeoCollection.h b/EGkGeoCollection.h index 0e5c428..075e681 100644 --- a/EGkGeoCollection.h +++ b/EGkGeoCollection.h @@ -15,6 +15,7 @@ #include "/EgtDev/Include/EGkPoint3d.h" #include "/EgtDev/Include/EGkBBox3d.h" +#include "/EgtDev/Include/EGkFrame3d.h" #include "/EgtDev/Include/EGkCurvePointDiffGeom.h" #include "/EgtDev/Include/EgtNumCollection.h" @@ -52,6 +53,12 @@ typedef std::list CPDGLIST ; // lista di CrvPointDiffGe typedef std::vector VCT3DVECTOR ; // vettore di vettori 3d typedef std::list VCT3DLIST ; // lista di vettori 3d +//---------------------------------------------------------------------------- +// Raccolte di Frame3d +typedef std::vector FRAME3DVECTOR ; // vettore di riferimenti 3d +typedef std::list FRAME3DLIST ; // lista di riferimenti 3d +typedef std::vector> FRAME3DIVECTOR ; // vettore di riferimenti 3d e Id + //---------------------------------------------------------------------------- // Raccolte di BBox3d typedef std::vector BOXVECTOR ; // vettore di bounding box 3d diff --git a/EGkRotationMinimizingFrame.h b/EGkRotationMinimizingFrame.h new file mode 100644 index 0000000..5159ddd --- /dev/null +++ b/EGkRotationMinimizingFrame.h @@ -0,0 +1,50 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : EGkRotationMinimizingFrame.h Data : 05.04.24 Versione : 2.6d1 +// Contenuto : Dichiarazione della classe RotationMinimizingFrame. +// +// +// +// Modifiche : 05.04.24 RE Creazione modulo. + +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurve.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 + +//---------------------------------------------------------------------------- +class EGK_EXPORT RotationMinimizingFrame +{ + public : + RotationMinimizingFrame( void) + : m_pCrv( nullptr), m_Frame0() {} + ~RotationMinimizingFrame( void) + { Clear() ; } + bool Set( const ICurve* pCrv, const Frame3d& fr_Start) ; + + public : + bool GetFramesByStep( double dStep, bool bUniform, FRAME3DVECTOR& vRMFrames) ; + bool GetFramesBySplit( int nIntervals, FRAME3DVECTOR& vRMFrames) ; + bool GetFramesByTolerance( double dTol, FRAME3DVECTOR& vRMFrames) ; + + private : + bool Clear( void) ; + bool IsValid( void) ; + bool GetFrameAtParam( const Frame3d& frAct, const double dParNext, Frame3d& frNext) ; + + private : + ICurve* m_pCrv ; // curva per il calcolo del rotation Xplane frame + Frame3d m_Frame0 ; // frame iniziale della curva +} ; diff --git a/EGkRotationXplaneFrame.h b/EGkRotationXplaneFrame.h new file mode 100644 index 0000000..309f629 --- /dev/null +++ b/EGkRotationXplaneFrame.h @@ -0,0 +1,51 @@ +//---------------------------------------------------------------------------- +// EgalTech 2024-2024 +//---------------------------------------------------------------------------- +// File : EGkRotationXplaneFrame.h Data : 05.04.24 Versione : 2.6d1 +// Contenuto : Dichiarazione della classe RotationXplaneFrame. +// +// +// +// Modifiche : 05.04.24 DS Creazione modulo. + +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGkCurve.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 + +//---------------------------------------------------------------------------- +class EGK_EXPORT RotationXplaneFrame +{ + public : + RotationXplaneFrame( void) + : m_pCrv( nullptr), m_vtNorm(), m_vtNearX() {} + ~RotationXplaneFrame( void) + { Clear() ; } + bool Set( const ICurve* pCrv, const Vector3d& vtNorm, const Vector3d& vtNearX = V_NULL) ; + + public : + bool GetFramesByStep( double dStep, bool bUniform, FRAME3DVECTOR& vRXFrames) ; + bool GetFramesBySplit( int nIntervals, FRAME3DVECTOR& vRXFrames) ; + bool GetFramesByTolerance( double dTol, FRAME3DVECTOR& vRXFrames) ; + + private : + bool Clear( void) ; + bool IsValid( void) ; + bool GetFrameAtParam( const Frame3d& frAct, const double dParNext, Frame3d& frNext) ; + + private : + ICurve* m_pCrv ; // curva per il calcolo del rotation Xplane frame + Vector3d m_vtNorm ; // vettore normale al piano in cui deve sempre giacere l'asse X + Vector3d m_vtNearX ; // vettore a cui deve essere il pił vicino possibile la direzione X iniziale +} ; diff --git a/EGkStmFromCurves.h b/EGkStmFromCurves.h index 2ad4d49..70d9c99 100644 --- a/EGkStmFromCurves.h +++ b/EGkStmFromCurves.h @@ -1,8 +1,8 @@ //---------------------------------------------------------------------------- // EgalTech 2015-2024 //---------------------------------------------------------------------------- -// File : EGkStmFromCurves.h Data : 27.02.24 Versione : 2.6b4 -// Contenuto : Dichiarazione della classe StmFromTriangleSoup. +// File : EGkStmFromCurves.h Data : 27.02.24 Versione : 2.6d1 +// Contenuto : Prototipi funzioni di creazione TriMesh a partire da curve. // // // @@ -41,8 +41,10 @@ EGK_EXPORT ISurfTriMesh* GetSurfTriMeshByScrewing( const ICurve* pCurve, const P 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 = 10 * EPS_SMALL) ; -EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSwept( const ICurve* pSect, const ICurve* pGuide, bool bCapEnds, double dLinTol = 10 * EPS_SMALL, Vector3d* vtStatic = nullptr) ; -EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSwept( const ISurfFlatRegion* pSfrSect, const ICurve* pGuide, bool bCapEnds, double dLinTol = 10 * EPS_SMALL, Vector3d* vtStatic = nullptr) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSwept( const ICurve* pSect, const ICurve* pGuide, const Vector3d& vtAx, + bool bCapEnds, double dLinTol = 10 * EPS_SMALL) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSwept( const ISurfFlatRegion* pSfrSect, const ICurve* pGuide, const Vector3d& vtAx, + 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/EInAPI.h b/EInAPI.h index d6340b8..e1e4345 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -315,9 +315,10 @@ EIN_EXPORT int __stdcall EgtCreateSurfTmByRevolve( int nParentId, int nCrvId, const double ptAx[3], const double vtAx[3], BOOL bCapEnds, double dLinTol, int nRefType) ; EIN_EXPORT int __stdcall EgtCreateSurfTmByScrewing( int nParentId, int nCrvId, - const double ptAx[3], const double vtAx[3], - double dAngRotDeg, double dMove, BOOL bCapEnds, double dLinTol, int nRefType) ; -EIN_EXPORT int __stdcall EgtCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, BOOL bCapEnds, double dLinTol) ; + const double ptAx[3], const double vtAx[3], + double dAngRotDeg, double dMove, BOOL bCapEnds, double dLinTol, int nRefType) ; +EIN_EXPORT int __stdcall EgtCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, const double vtAx[3], + BOOL bCapEnds, double dLinTol, int nRefType) ; EIN_EXPORT int __stdcall EgtCreateSurfTmRuled( int nParentId, int nPntOrCrvId1, int nCrvId2, int nType, double dLinTol) ; EIN_EXPORT int __stdcall EgtCreateSurfTmByTriangles( int nParentId, int nNumId, const int nIds[], BOOL bErase) ; EIN_EXPORT int __stdcall EgtCreateSurfTmBySewing( int nParentId, int nNumId, const int nIds[], BOOL bErase) ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 3445df7..cc88e0c 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -357,7 +357,8 @@ EXE_EXPORT int ExeCreateSurfTmByScrewing( int nParentId, int nCrvId, double dAngRotDeg, double dMove, bool bCapEnds, double dLinTol, int nRefType) ; 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, Vector3d* vtStatic = nullptr) ; +EXE_EXPORT int ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, const Vector3d& vtAx, + bool bCapEnds, double dLinTol, int nRefType) ; 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) ;