From 9fc0e7b51d40d769e460875405687b8e75f07c98 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sun, 21 Jun 2015 17:02:56 +0000 Subject: [PATCH] Include : - sistemazioni varie. --- EGkCurve.h | 5 ++++- EGkCurveComposite.h | 1 + EGkPolyArc.h | 5 ++--- EGkPolyLine.h | 13 +++++++------ EInAPI.h | 4 +--- EXeConst.h | 8 +++++++- EXeExecutor.h | 5 ++--- 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/EGkCurve.h b/EGkCurve.h index 48e4d37..1713c2c 100644 --- a/EGkCurve.h +++ b/EGkCurve.h @@ -28,6 +28,9 @@ class __declspec( novtable) ICurve : public IGeoObj PP_START = 1, // punto coincidente con l'inizio PP_MID = 2, // punto appartenente all'interno della curva PP_END = 3} ; // punto coincidente con la fine + enum ApprLineType { APL_STD = 0, // approssimazione standard + APL_LEFT = 1, // linee sempre a sinistra + APL_RIGHT = 2} ; // linee sempre a destra enum OffType { OFF_FILLET = 0, // si raccordano con arco gli spigoli esterni OFF_CHAMFER = 1, // si raccordano con smusso gli spigoli esterni OFF_EXTEND = 2, // si prolungano all'intersezione gli spigoli esterni @@ -66,7 +69,7 @@ class __declspec( novtable) ICurve : public IGeoObj virtual bool GetLengthAtPoint( const Point3d& ptP, double& dLen, double dTol = EPS_SMALL) const = 0 ; virtual bool GetNearestExtremityToPoint( const Point3d& ptP, bool& bStart) const = 0 ; virtual bool GetAreaXY( double& dArea) const = 0 ; - virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, PolyLine& PL) const = 0 ; + virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, int nType, PolyLine& PL) const = 0 ; virtual bool ApproxWithArcs( double dLinTol, double dAngTolDeg, PolyArc& PA) const = 0 ; virtual ICurve* CopyParamRange( double dUStart, double dUEnd) const = 0 ; virtual bool Invert( void) = 0 ; diff --git a/EGkCurveComposite.h b/EGkCurveComposite.h index 8af2353..45a1540 100644 --- a/EGkCurveComposite.h +++ b/EGkCurveComposite.h @@ -41,6 +41,7 @@ class __declspec( novtable) ICurveComposite : public ICurve virtual bool ChangeStartPoint( double dU) = 0 ; virtual bool ArcsToBezierCurves( void) = 0 ; virtual bool ArcsBezierCurvesToArcsPerpExtr( double dLinTol, double dAngTolDeg) = 0 ; + virtual bool MergeCurves( double dLinTol, double dAngTolDeg) = 0 ; } ; //----------------------------------------------------------------------------- diff --git a/EGkPolyArc.h b/EGkPolyArc.h index 53bb15c..9446ce8 100644 --- a/EGkPolyArc.h +++ b/EGkPolyArc.h @@ -62,7 +62,7 @@ class PolyArc EGK_EXPORT int GetRejectedNbr( void) const { return m_nRejected ; } EGK_EXPORT int GetPointNbr( void) const - { return m_nCount ; } + { return int( m_lUPointBs.size()) ; } EGK_EXPORT bool GetFirstUPoint( double* pdPar, Point3d* pptP, double* pdBulge, bool bNotLast = false) const ; EGK_EXPORT bool GetNextUPoint( double* pdPar, Point3d* pptP, double* pdBulge, bool bNotLast = false) const ; EGK_EXPORT bool GetFirstU( double& dPar, bool bNotLast = false) const @@ -74,7 +74,7 @@ class PolyArc EGK_EXPORT bool GetNextPoint( Point3d& ptP, double& dBulge, bool bNotLast = false) const { return GetNextUPoint( nullptr, &ptP, &dBulge, bNotLast) ; } EGK_EXPORT int GetArcNbr( void) const - { return ( m_nCount > 1 ? ( m_nCount - 1) : 0) ; } + { return int( m_lUPointBs.size() > 1 ? ( m_lUPointBs.size() - 1) : 0) ; } EGK_EXPORT bool GetFirstUArc( double* pdIni, Point3d* pptIni, double* pdFin, Point3d* pptFin, double* pdBulge) const ; EGK_EXPORT bool GetNextUArc( double* pdIni, Point3d* pptIni, double* pdFin, Point3d* pptFin, double* pdBulge) const ; EGK_EXPORT bool GetFirstArc( Point3d& ptIni, Point3d& ptFin, double& dBulge) const @@ -98,7 +98,6 @@ class PolyArc private : Vector3d m_vtExtr ; int m_nRejected ; - int m_nCount ; UPNTBLIST m_lUPointBs ; mutable UPNTBLIST::const_iterator m_iter ; } ; diff --git a/EGkPolyLine.h b/EGkPolyLine.h index 172810a..0306b4d 100644 --- a/EGkPolyLine.h +++ b/EGkPolyLine.h @@ -56,7 +56,7 @@ class PolyLine EGK_EXPORT int GetRejectedNbr( void) const { return m_nRejected ; } EGK_EXPORT int GetPointNbr( void) const - { return m_nCount ; } + { return int( m_lUPoints.size()) ; } EGK_EXPORT bool GetFirstUPoint( double* pdPar, Point3d* pptP, bool bNotLast = false) const ; EGK_EXPORT bool GetNextUPoint( double* pdPar, Point3d* pptP, bool bNotLast = false) const ; EGK_EXPORT bool GetFirstU( double& dPar, bool bNotLast = false) const @@ -83,7 +83,7 @@ class PolyLine EGK_EXPORT bool GetCurrPoint( Point3d& ptP) const { return GetCurrUPoint( nullptr, &ptP) ; } EGK_EXPORT int GetLineNbr( void) const - { return ( m_nCount > 1 ? ( m_nCount - 1) : 0) ; } + { return int( m_lUPoints.size() > 1 ? ( m_lUPoints.size() - 1) : 0) ; } EGK_EXPORT bool GetFirstULine( double* pdIni, Point3d* pptIni, double* pdFin, Point3d* pptFin) const ; EGK_EXPORT bool GetNextULine( double* pdIni, Point3d* pptIni, double* pdFin, Point3d* pptFin) const ; EGK_EXPORT bool GetFirstLine( Point3d& ptIni, Point3d& ptFin) const @@ -101,14 +101,15 @@ class PolyLine EGK_EXPORT bool GetApproxLength( double& dLen) const ; EGK_EXPORT bool GetLength( double& dLen) const ; EGK_EXPORT bool GetAreaXY( double& dArea) const ; - EGK_EXPORT bool GetMaxDistanceFromLine( double& dMaxDist, const Point3d& ptAx, - const Vector3d& vtAx, double dLen, bool bIsSegment = true) const ; - EGK_EXPORT bool AdjustForMaxSegmentLen( double& dMaxLen) ; + EGK_EXPORT bool GetMaxDistanceFromLine( const Point3d& ptLine, const Vector3d& vtLine, double dLen, + double& dMaxDist, bool bIsSegment = true) const ; + EGK_EXPORT bool AdjustForMaxSegmentLen( double dMaxLen) ; + EGK_EXPORT bool RemoveAlignedPoints( double dToler = EPS_SMALL) ; + EGK_EXPORT bool ApproxOnSide( const Vector3d& vtN, bool bLeftSide, double dToler = EPS_SMALL) ; EGK_EXPORT bool Invert( bool bInvertU = true) ; private : int m_nRejected ; - int m_nCount ; PNTULIST m_lUPoints ; mutable PNTULIST::const_iterator m_iter ; } ; diff --git a/EInAPI.h b/EInAPI.h index c6c269e..ad8d4d2 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -156,7 +156,6 @@ EIN_EXPORT int __stdcall EgtCreateCurveCompoByChain( int nParentId, int nNumId, const double ptNear[3], BOOL bErase, int nRefType) ; EIN_EXPORT int __stdcall EgtCreateCurveCompoFromPoints( int nParentId, int nP, const double ptPs[/*3 x nP*/], int nRefType) ; EIN_EXPORT int __stdcall EgtCreateCurveCompoFromPointBulges( int nParentId, int nPB, const double ptPBs[/*4 x nPB*/], int nRefType) ; -EIN_EXPORT int __stdcall EgtCreateCurveCompoByApprox( int nParentId, int nSouId, BOOL bArcsVsLines, double dLinTol) ; EIN_EXPORT int __stdcall EgtCreateRectangle3P( int nParentId, const double ptIni[3], const double ptCross[3], const double ptDir[3], int nRefType) ; EIN_EXPORT int __stdcall EgtCreatePolygonFromRadius( int nParentId, int nNumSides, const double ptCen[3], @@ -324,8 +323,7 @@ EIN_EXPORT BOOL __stdcall EgtModifyCurveArcRadius( int nId, double dRad) ; EIN_EXPORT BOOL __stdcall EgtModifyCurveArcC2PN( int nId, const double ptEnd[3], int nRefType) ; EIN_EXPORT BOOL __stdcall EgtModifyCurveArc3P( int nId, const double ptMid[3], int nRefType) ; EIN_EXPORT int __stdcall EgtExplodeCurveCompo( int nId, int* pnCount) ; -EIN_EXPORT int __stdcall EgtApproxCurveArc( int nId, double dLinTol) ; -EIN_EXPORT int __stdcall EgtApproxCurveBezier( int nId, BOOL bArcsVsLines, double dLinTol) ; +EIN_EXPORT int __stdcall EgtApproxCurve( int nId, int nApprType, double dLinTol) ; // GeomDb Surf Modify EIN_EXPORT BOOL __stdcall EgtInvertSurface( int nId) ; diff --git a/EXeConst.h b/EXeConst.h index d39b188..f774f66 100644 --- a/EXeConst.h +++ b/EXeConst.h @@ -24,4 +24,10 @@ enum EinSep { SEP_STD = 0, enum RefType{ RTY_GLOB = 0, RTY_GRID = -3, // come GDB_ID_GRID RTY_LOC = -4} ; -const int RTY_DEFAULT = RTY_LOC ; \ No newline at end of file +const int RTY_DEFAULT = RTY_LOC ; + +//----------------- Costanti tipo di approssimazione di curve ------------------ +enum ApprType{ APP_LINES = 0, // come ICurve::APL_STD + APP_LEFT_LINES = 1, // come ICurve::APL_LEFT + APP_RIGHT_LINES = 2, // come ICurve::APL_RIGHT + APP_ARCS = 3} ; \ No newline at end of file diff --git a/EXeExecutor.h b/EXeExecutor.h index 007cbb4..67f4866 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -153,7 +153,6 @@ EXE_EXPORT int ExeCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds const Point3d& ptNear, bool bErase, int nRefType, int* pnCount) ; EXE_EXPORT int ExeCreateCurveCompoFromPoints( int nParentId, const PolyLine& PL, int nRefType) ; EXE_EXPORT int ExeCreateCurveCompoFromPointBulges( int nParentId, const PolyArc& PA, int nRefType) ; -EXE_EXPORT int ExeCreateCurveCompoByApprox( int nParentId, int nSouId, bool bArcsVsLines, double dLinTol) ; EXE_EXPORT int ExeCreateRectangle3P( int nParentId, const Point3d& ptIni, const Point3d& ptCross, const Point3d& ptDir, int nRefType) ; EXE_EXPORT int ExeCreatePolygonFromRadius( int nParentId, int nNumSides, const Point3d& ptCen, @@ -321,8 +320,8 @@ EXE_EXPORT bool ExeModifyCurveArcRadius( int nId, double dRad) ; EXE_EXPORT bool ExeModifyCurveArcC2PN( int nId, const Point3d& ptEnd, int nRefType) ; EXE_EXPORT bool ExeModifyCurveArc3P( int nId, const Point3d& ptMid, int nRefType) ; EXE_EXPORT int ExeExplodeCurveCompo( int nId, int* pnCount) ; -EXE_EXPORT int ExeApproxCurveArc( int nId, double dLinTol) ; -EXE_EXPORT int ExeApproxCurveBezier( int nId, bool bArcsVsLines, double dLinTol) ; +EXE_EXPORT bool ExeMergeCurvesInCurveCompo( int nId, double dLinTol) ; +EXE_EXPORT int ExeApproxCurve( int nId, int nApprType, double dLinTol) ; // GeomDb Surf Modify EXE_EXPORT bool ExeInvertSurface( const INTVECTOR& vIds) ;