Include :
- aggiunto PointGrid3d - modifiche a interfacce.
This commit is contained in:
+3
-3
@@ -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 ;
|
||||
} ;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
+4
-4
@@ -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 :
|
||||
|
||||
@@ -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 <unordered_map>
|
||||
|
||||
//----------------------- 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<int,std::pair<Point3d,int>> IPNTI_UMMAP ;
|
||||
|
||||
private :
|
||||
double m_dCellDim ;
|
||||
IPNTI_UMMAP m_MMap ;
|
||||
} ;
|
||||
+8
-2
@@ -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 ;
|
||||
|
||||
Reference in New Issue
Block a user