diff --git a/EExImportStl.h b/EExImportStl.h index a6504c9..f75d09e 100644 --- a/EExImportStl.h +++ b/EExImportStl.h @@ -1,13 +1,13 @@ //---------------------------------------------------------------------------- // EgalTech 2014-2014 //---------------------------------------------------------------------------- -// File : EExImportStl.h Data : 04.04.14 Versione : 1.5d1 +// File : EExImportStl.h Data : 16.05.14 Versione : 1.5e3 // Contenuto : Dichiarazione della interfaccia IImportStl. // // // // Modifiche : 04.04.14 DS Creazione modulo. -// +// 16.05.15 DS Aggiunto il fattore di scala. // //---------------------------------------------------------------------------- @@ -29,7 +29,7 @@ class __declspec( novtable) IImportStl { public : virtual ~IImportStl( void) {} - virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup) = 0 ; + virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup, double dScaleFactor = 1) = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkBBox3d.h b/EGkBBox3d.h index 7b122bf..6eda641 100644 --- a/EGkBBox3d.h +++ b/EGkBBox3d.h @@ -30,20 +30,20 @@ class EGK_EXPORT BBox3d BBox3d( void) // Box vuoto (min > MAX) : m_ptMin( +INFINITO, +INFINITO, +INFINITO), m_ptMax( -INFINITO, -INFINITO, -INFINITO) {} - BBox3d( const Point3d ptP) + BBox3d( const Point3d& ptP) : m_ptMin( ptP), m_ptMax( ptP) {} BBox3d( double dX, double dY, double dZ) : m_ptMin( dX, dY, dZ), m_ptMax( dX, dY, dZ) {} - BBox3d( const Point3d ptP1, const Point3d ptP2) ; + BBox3d( const Point3d& ptP1, const Point3d& ptP2) ; BBox3d( double dX1, double dY1, double dZ1, double dX2, double dY2, double dZ2) ; void Reset( void) { m_ptMin = Point3d( +INFINITO, +INFINITO, +INFINITO) ; m_ptMax = Point3d( -INFINITO, -INFINITO, -INFINITO) ; } - void Set( const Point3d ptP) + void Set( const Point3d& ptP) { m_ptMin = ptP ; m_ptMax = ptP ; } void Set( double dX, double dY, double dZ) { m_ptMin = Point3d( dX, dY, dZ) ; m_ptMax = m_ptMin ; } - void Set( const Point3d ptP1, const Point3d ptP2) ; + void Set( const Point3d& ptP1, const Point3d& ptP2) ; void Set( double dX1, double dY1, double dZ1, double dX2, double dY2, double dZ2) ; public : diff --git a/EGkPointGrid3d.h b/EGkPointGrid3d.h new file mode 100644 index 0000000..83d2be7 --- /dev/null +++ b/EGkPointGrid3d.h @@ -0,0 +1,47 @@ +//---------------------------------------------------------------------------- +// EgalTech 2014-2014 +//---------------------------------------------------------------------------- +// File : EGkPointGrid3d.h Data : 15.05.14 Versione : 1.5e5 +// Contenuto : Dichiarazione della classe PointGrid3d. +// Indicizzazione spaziale di Point3d mediante hash grid. +// +// +// Modifiche : 15.05.14 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EGKPoint3d.h" +#include "/EgtDev/Include/EgtNumCollection.h" +#include + +//----------------------- 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 PointGrid3d +{ + public : + EGK_EXPORT bool Init( int nBuckets, double dCellDim = 10 * EPS_SMALL) ; + EGK_EXPORT bool InsertPoint( const Point3d& ptP, int nId) ; + EGK_EXPORT bool Find( const Point3d& ptTest, double dTol, INTVECTOR& vnIds) ; + EGK_EXPORT bool Find( const Point3d& ptTest, double dTol, int& nId) ; + + private : + inline int Get1dCellNbr( double dCoord) ; + inline int PointHash( int nX, int nY, int nZ) ; + + private : + typedef std::unordered_multimap> IPNTI_UMMAP ; + + private : + double m_dCellDim ; + IPNTI_UMMAP m_MMap ; +} ; diff --git a/EgkSurfTriMesh.h b/EgkSurfTriMesh.h index 920cce9..af82759 100644 --- a/EgkSurfTriMesh.h +++ b/EgkSurfTriMesh.h @@ -28,6 +28,8 @@ class __declspec( novtable) ISurfTriMesh : public ISurf public : virtual bool Copy( const IGeoObj* pGObjSrc) = 0 ; virtual bool Init( int nNumVert, int nNumTria) = 0 ; + virtual void SetLinearTolerance( double dLinTol) = 0 ; + virtual void SetSmoothAngle( double dSmoothAngDeg) = 0 ; virtual int AddVertex( const Point3d& ptVert) = 0 ; virtual int AddTriangle( const int nIdVert[3]) = 0 ; virtual bool AdjustTopology( void) = 0 ; @@ -38,8 +40,12 @@ class __declspec( novtable) ISurfTriMesh : public ISurf double dAngRot, double dStepRot) = 0 ; virtual bool CreateByScrewing( const PolyLine& PL, const Point3d& ptAx, const Vector3d& vtAx, double dAngRot, double dStepRot, double dMove) = 0 ; - virtual int GetVertexNum( void) const = 0 ; - virtual int GetTriangleNum( void) const = 0 ; + virtual bool DoCompacting( void) = 0 ; + virtual bool DoSewing( const ISurfTriMesh& stmOther, const Frame3d& frOther = GLOB_FRM) = 0 ; + virtual int GetVertexSize( void) const = 0 ; + virtual int GetTriangleSize( void) const = 0 ; + virtual double GetLinearTolerance( void) = 0 ; + virtual double GetSmoothAngle( void) = 0 ; virtual int GetFirstVertex( Point3d& ptP) const = 0 ; virtual int GetNextVertex( int nId, Point3d& ptP) const = 0 ; virtual int GetFirstTriangle( Triangle3d& Tria) const = 0 ;