diff --git a/EGkChainCurves.h b/EGkChainCurves.h index bb70224..22ee429 100644 --- a/EGkChainCurves.h +++ b/EGkChainCurves.h @@ -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 INTUSET ; diff --git a/EGkDistPointTria.h b/EGkDistPointTria.h new file mode 100644 index 0000000..8cd93c4 --- /dev/null +++ b/EGkDistPointTria.h @@ -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 ; +} ; + diff --git a/EGkIntersLineTria.h b/EGkIntersLineTria.h index 3628979..3cf11f0 100644 --- a/EGkIntersLineTria.h +++ b/EGkIntersLineTria.h @@ -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 diff --git a/EGkIntersPlaneSurfTm.h b/EGkIntersPlaneSurfTm.h new file mode 100644 index 0000000..ebb5891 --- /dev/null +++ b/EGkIntersPlaneSurfTm.h @@ -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) ; diff --git a/EGkIntersPlaneTria.h b/EGkIntersPlaneTria.h new file mode 100644 index 0000000..02f42c0 --- /dev/null +++ b/EGkIntersPlaneTria.h @@ -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 + \ No newline at end of file diff --git a/EGkTriangle3d.h b/EGkTriangle3d.h index 1828e05..63cd81e 100644 --- a/EGkTriangle3d.h +++ b/EGkTriangle3d.h @@ -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) diff --git a/EXeExecutor.h b/EXeExecutor.h index af1c307..2f96a1d 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -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 diff --git a/EgtPointerOwner.h b/EgtPointerOwner.h index 09ac7ea..a58734f 100644 --- a/EgtPointerOwner.h +++ b/EgtPointerOwner.h @@ -21,7 +21,7 @@ class PtrOwner public : explicit PtrOwner( void) : m_pT( nullptr) {} explicit PtrOwner( T* pT) : m_pT( pT) {} - explicit PtrOwner( PtrOwner&& RPT) : m_pT( Release( RPT)) {} + PtrOwner( PtrOwner&& RPT) : m_pT( Release( RPT)) {} PtrOwner( const PtrOwner& 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& operator=( PtrOwner&& RPT) + { if ( this != &RPT) + Set( Release( RPT)) ; + return (*this) ; + } + PtrOwner& operator=( const PtrOwner& RPT) = delete ; private : T* m_pT ;