Include :

- migliorie a PtrOwner
- aggiunti prototipi per intersezioni Plane/Tria Plane/SurfTm
- aggiunto prototipo per distanza Point/Tria.
This commit is contained in:
Dario Sassi
2017-10-21 17:03:08 +00:00
parent 23bb013dec
commit df006e7e19
8 changed files with 136 additions and 8 deletions
-3
View File
@@ -55,9 +55,6 @@ class ChainCurves
{ return m_bIsFork ; }
//! Restituisce il vettore con gli Id delle entità tra cui scegliere sulla biforcazione
EGK_EXPORT bool GetForkIds( INTVECTOR& vForkIds) ;
//! Restituisce la tolleranza effettivamente usata
EGK_EXPORT double GetTolerance( void)
{ return m_dToler ; }
private :
typedef std::unordered_set<int> INTUSET ;
+49
View File
@@ -0,0 +1,49 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2017
//----------------------------------------------------------------------------
// File : EGkDistPointTria.h Data : 19.10.17 Versione : 1.8j4
// Contenuto : Dichiarazione della classe distanza Punto da Triangolo.
//
//
//
// Modifiche : 19.10.17 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkTriangle3d.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 DistPointTriangle
{
public :
EGK_EXPORT DistPointTriangle( const Point3d& ptP, const Triangle3d& Tria) ;
public :
EGK_EXPORT bool GetSqDist( double& dSqDist) ;
EGK_EXPORT bool GetDist( double& dDist) ;
EGK_EXPORT bool IsSmall( void)
{ double dSqDist ; return ( GetSqDist( dSqDist) && dSqDist < SQ_EPS_SMALL) ; }
EGK_EXPORT bool IsZero( void)
{ double dSqDist ; return ( GetSqDist( dSqDist) && dSqDist < SQ_EPS_ZERO) ; }
EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDist) ;
private :
void Calculate( const Point3d& ptP, const Triangle3d& Tria) ;
private :
double m_dSqDist ;
double m_dDist ;
Point3d m_ptMinDist ;
} ;
+4 -4
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2017
//----------------------------------------------------------------------------
// File : EGkIntersLineTria.h Data : 18.02.15 Versione : 1.6b7
// File : EGkIntersLineTria.h Data : 16.10.17 Versione : 1.8j4
// Contenuto : Dichiarazione della classe intersezione linea/triangolo.
//
//
@@ -25,9 +25,9 @@
//-----------------------------------------------------------------------------
EGK_EXPORT int IntersLineTria( const Point3d& ptL1, const Point3d& ptL2, const Triangle3d& trTria,
Point3d& ptInt, Point3d& ptInt2) ;
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) ;
Point3d& ptInt, Point3d& ptInt2, bool bFinite = true) ;
//-----------------------------------------------------------------------------
// Tipo di intersezione linea-triangolo
+29
View File
@@ -0,0 +1,29 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2017
//----------------------------------------------------------------------------
// File : EGkIntersPlaneSurfTm.h Data : 16.10.17 Versione : 1.8j4
// Contenuto : Dichiarazione delle funzioni intersezione Piano/SurfTriMesh.
//
//
//
// Modifiche : 16.10.17 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkCurve.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 IntersPlaneSurfTm( const Plane3d& plPlane, const ISurfTriMesh& Stm,
PNTVECTOR& vPnt, BIPNTVECTOR& vBpt, TRIA3DVECTOR& vTria) ;
+38
View File
@@ -0,0 +1,38 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2017
//----------------------------------------------------------------------------
// File : EGkIntersPlanePlane.h Data : 15.10.17 Versione : 1.8j3
// Contenuto : Dichiarazione della classe intersezione piano/piano.
//
//
//
// Modifiche : 15.10.17 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkPlane3d.h"
#include "/EgtDev/Include/EGkTriangle3d.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 int IntersPlaneTria( const Plane3d& plPlane, const Triangle3d& trTria,
Point3d& ptInt, Point3d& ptInt2) ;
//-----------------------------------------------------------------------------
// Tipo di intersezione piano-triangolo
enum IntPlaneTriaType { IPTT_NO = 0, // non c'è intersezione
IPTT_OVERLAPS = 1, // il triangolo giace nel piano
IPTT_VERT = 2, // l'intersezione coincide con un vertice
IPTT_EDGE = 3, // l'intersezione coincide con un lato del triangolo
IPTT_YES = 4} ; // intersezione
+7
View File
@@ -45,6 +45,13 @@ class Triangle3d
}
return AreSameVectorApprox( vtV, vtN) ;
}
bool IsValid( void) const
{ if ( AreSamePointApprox( ptP[0], ptP[1]) || AreSamePointApprox( ptP[0], ptP[2]))
return false ;
Vector3d vtV = ( ptP[1] - ptP[0]) ^ ( ptP[2] - ptP[0]) ;
vtV.Normalize() ;
return AreSameVectorApprox( vtV, vtN) ;
}
bool ToGlob( const Frame3d& frRef)
{ return ( ptP[0].ToGlob( frRef) && ptP[1].ToGlob( frRef) && ptP[2].ToGlob( frRef)) ; }
bool ToLoc( const Frame3d& frRef)
+2
View File
@@ -467,6 +467,8 @@ EXE_EXPORT int ExeExtractSurfTmLoops( int nId, int nDestGrpId, int* pnCount) ;
EXE_EXPORT int ExeGetSurfTmSilhouette( int nId, const Vector3d& vtDir, int nDestGrpId, int nRefType, int* pnCount) ;
EXE_EXPORT int ExeExtractSurfTmFacetLoops( int nId, int nFacet, int nDestGrpId, int* pnCount) ;
EXE_EXPORT int ExeCopySurfTmFacet( int nId, int nFacet, int nDestGrpId) ;
EXE_EXPORT int ExeGetSurfTmPlaneInters( int nId, const Point3d& ptOn, const Vector3d& vtN, int nDestGrpId, int nRefType,
int* pnPntCount, int* pnCrvCount, int* pnSrfCount) ;
EXE_EXPORT bool ExeCutSurfTm( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSaveOnEq, int nRefType) ;
// GeomDb Volume Modify
+7 -1
View File
@@ -21,7 +21,7 @@ class PtrOwner
public :
explicit PtrOwner( void) : m_pT( nullptr) {}
explicit PtrOwner( T* pT) : m_pT( pT) {}
explicit PtrOwner( PtrOwner<T>&& RPT) : m_pT( Release( RPT)) {}
PtrOwner( PtrOwner<T>&& RPT) : m_pT( Release( RPT)) {}
PtrOwner( const PtrOwner<T>& RPT) = delete ;
~PtrOwner( void) { Reset() ; }
bool Set( T* pT) { Reset() ; m_pT = pT ; return ( m_pT != nullptr) ; }
@@ -29,6 +29,12 @@ class PtrOwner
T& operator*() const { return *m_pT ; }
T* operator->() const { return m_pT ; }
operator T*() const { return m_pT ; }
PtrOwner<T>& operator=( PtrOwner<T>&& RPT)
{ if ( this != &RPT)
Set( Release( RPT)) ;
return (*this) ;
}
PtrOwner<T>& operator=( const PtrOwner<T>& RPT) = delete ;
private :
T* m_pT ;