From cb0cf8592f604bddfa9039eb0f1b4fe7d792dfa1 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 7 Jul 2015 18:34:39 +0000 Subject: [PATCH] Include : - EGkIntersCurveCurve.h rinominata in EGkIntersCurves.h - aggiornamenti vari. --- EGkGeomDB.h | 1 + EGkIntersCurveCurve.h => EGkIntersCurves.h | 40 +++++++++++++++++++--- EXeExecutor.h | 3 ++ 3 files changed, 40 insertions(+), 4 deletions(-) rename EGkIntersCurveCurve.h => EGkIntersCurves.h (76%) diff --git a/EGkGeomDB.h b/EGkGeomDB.h index 5133883..b5a2173 100644 --- a/EGkGeomDB.h +++ b/EGkGeomDB.h @@ -79,6 +79,7 @@ class __declspec( novtable) IGeomDB virtual bool Relocate( int nId, int nRefId, int nSonBeforeAfter = GDB_LAST_SON) = 0 ; virtual bool RelocateGlob( int nId, int nRefId, int nSonBeforeAfter = GDB_LAST_SON) = 0 ; virtual bool GroupSwap( int nId1, int nId2, bool bSwapRef, bool bMark = false) = 0 ; + virtual int GetNewId( void) const = 0 ; virtual bool ChangeId( int nId, int nNewId) = 0 ; virtual bool Erase( int nId) = 0 ; virtual bool EmptyGroup( int nId) = 0 ; diff --git a/EGkIntersCurveCurve.h b/EGkIntersCurves.h similarity index 76% rename from EGkIntersCurveCurve.h rename to EGkIntersCurves.h index 4ef3b10..de7a1df 100644 --- a/EGkIntersCurveCurve.h +++ b/EGkIntersCurves.h @@ -1,13 +1,14 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2014 +// EgalTech 2014-2015 //---------------------------------------------------------------------------- -// File : EGkIntersCurveCurve.h Data : 20.06.14 Versione : 1.5f6 +// File : EGkIntersCurves.h Data : 06.07.15 Versione : 1.6g2 // Contenuto : Dichiarazione della classe intersezione curva/curva. // // // // Modifiche : 20.06.14 DS Creazione modulo. -// +// 06.07.15 DS Aggiunta dichiarazione classe SelfIntersCurve e +// cambiato nome da EGkIntersCurveCurve a EGkIntersCurves. // //---------------------------------------------------------------------------- @@ -25,7 +26,6 @@ #define EGK_EXPORT __declspec( dllimport) #endif - //----------------------------------------------------------------------------- //! dati di intersezione relativi ad una curva struct IntCrvInfo { @@ -136,3 +136,35 @@ class IntersCurveCurve PtrOwner m_pTmpCrv[2] ; // eventuale esplosione temporanea delle curve } ; +//----------------------------------------------------------------------------- +//! Classe per calcolo auto-intersezioni di una curva nel piano XY locale +class SelfIntersCurve +{ + public : + //! Le intersezioni sono calcolate nel piano XY locale.
+ EGK_EXPORT SelfIntersCurve( const ICurve& Curve) ; + + public : + //! Indica la presenza di intersezioni con sovrapposizioni + EGK_EXPORT bool GetOverlaps( void) ; + //! Restituisce il numero di auto-intersezioni (intersezioni doppie coincidenti e sovrapposte contano uno) + EGK_EXPORT int GetNumInters( void) ; + //! Restituisce informazioni sull'auto-intersezione di indice nInd ( 0 based) + EGK_EXPORT bool GetIntCrvCrvInfo( int nInd, IntCrvCrvInfo& aInfo) ; + //! Restituisce il punto di auto-intersezione pił vicino al punto passato + EGK_EXPORT bool GetIntersPointNearTo( const Point3d& ptNear, Point3d& ptI) ; + + private : + SelfIntersCurve( void) ; + bool IsArcToApprox( const ICurve& Curve) ; + void CrvCompoCrvCompoCalculate( const ICurve& CurveA, const ICurve& CurveB) ; + bool SwapInfoAB( ICCIVECTOR& Info, int IndCrvOrd) ; + + private : + bool m_bOverlaps ; + int m_nNumInters ; + ICCIVECTOR m_Info ; + const ICurve* m_pOriCrv ; // puntatore alla curva originale + const ICurve* m_pCurve ; // puntatore alla curva usata nei calcoli (originale o temporanea) + PtrOwner m_pTmpCrv ; // eventuale esplosione temporanea della curva +} ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 3fe5370..782c4da 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -231,6 +231,7 @@ EXE_EXPORT int ExeCopy( int nSouId, int nRefId, int nSonBeforeAfter) ; EXE_EXPORT int ExeCopyGlob( int nSouId, int nRefId, int nSonBeforeAfter) ; EXE_EXPORT bool ExeRelocate( int nSouId, int nRefId, int nSonBeforeAfter) ; EXE_EXPORT bool ExeRelocateGlob( int nSouId, int nRefId, int nSonBeforeAfter) ; +EXE_EXPORT int ExeGetNewId( void) ; EXE_EXPORT bool ExeChangeId( int nId, int nNewId) ; EXE_EXPORT bool ExeErase( const INTVECTOR& vIds) ; EXE_EXPORT bool ExeEmptyGroup( int nId) ; @@ -315,6 +316,7 @@ EXE_EXPORT bool ExeExtendCurveEndByLen( int nId, double dLen) ; EXE_EXPORT bool ExeTrimExtendCurveByLen( int nId, double dLen, const Point3d& ptNear, int nRefType) ; EXE_EXPORT int ExeSplitCurve( int nId, int nParts) ; EXE_EXPORT int ExeSplitCurveAtPoint( int nId, const Point3d& ptOn, int nRefType) ; +EXE_EXPORT int ExeSplitCurveAtSelfInters( int nId, int* pnCount) ; EXE_EXPORT bool ExeModifyCurveCircleCPN( int nId, const Point3d& ptOn, int nRefType) ; EXE_EXPORT bool ExeModifyCurveArcRadius( int nId, double dRad) ; EXE_EXPORT bool ExeModifyCurveArcC2PN( int nId, const Point3d& ptEnd, int nRefType) ; @@ -348,6 +350,7 @@ EXE_EXPORT bool ExeCurveLengthAtPoint( int nId, const Point3d& ptOn, double dExt EXE_EXPORT bool ExeCurveNearestExtremityToPoint( int nId, const Point3d& ptP, bool& bStart) ; EXE_EXPORT bool ExeCurveExtrusion( int nId, int nRefId, Vector3d& vtExtr) ; EXE_EXPORT bool ExeCurveThickness( int nId, double* pdThick) ; +EXE_EXPORT bool ExeCurveSelfIntersNbr( int nId, int* pnCount) ; EXE_EXPORT bool ExeGetMinDistPointCurve( const Point3d& ptP, int nId, double* pdDist, double* pdU) ; EXE_EXPORT bool ExeGetMinDistPntSidePointCurve( const Point3d& ptP, int nId, const Vector3d& vtN, double* pdDist, Point3d& ptMin, int* pnSide) ;