From 8e3eea5b5cd3046d59a66b9b9b134a94932fb2f0 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 13 Apr 2020 09:12:49 +0000 Subject: [PATCH] Include : - aggiornamento prototipi. --- EGkCurve.h | 2 +- EGkCurveArc.h | 2 +- EGkPolygon3d.h | 9 +++++---- EGkStmStandard.h | 2 +- EGkVector3d.h | 18 ++++++++++++++++++ EInAPI.h | 2 +- EXeExecutor.h | 3 ++- 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/EGkCurve.h b/EGkCurve.h index 39a0438..8c62f97 100644 --- a/EGkCurve.h +++ b/EGkCurve.h @@ -46,7 +46,7 @@ class __declspec( novtable) ICurve : public IGeoObj public : virtual bool IsSimple( void) const = 0 ; virtual bool IsClosed( void) const = 0 ; - virtual bool IsFlat( Plane3d& plPlane, double dToler = EPS_SMALL) const = 0 ; + virtual bool IsFlat( Plane3d& plPlane, bool bUseExtrusion = true, double dToler = EPS_SMALL) const = 0 ; virtual bool GetStartPoint( Point3d& ptStart) const = 0 ; virtual bool GetEndPoint( Point3d& ptEnd) const = 0 ; virtual bool GetMidPoint( Point3d& ptMid) const = 0 ; diff --git a/EGkCurveArc.h b/EGkCurveArc.h index a4b2f4f..c6d4e7d 100644 --- a/EGkCurveArc.h +++ b/EGkCurveArc.h @@ -37,7 +37,7 @@ class __declspec( novtable) ICurveArc : public ICurve virtual bool SetCPAN( const Point3d& ptCen, const Point3d& ptStart, double dAngCenDeg, double dDeltaZ, const Vector3d& vtN) = 0 ; virtual bool SetC2P( const Point3d& ptCen, const Point3d& ptStart, const Point3d& ptNearEnd) = 0 ; virtual bool SetC2PN( const Point3d& ptCen, const Point3d& ptStart, const Point3d& ptNearEnd, const Vector3d& vtN) = 0 ; - virtual bool IsFlat( double dToler = EPS_SMALL) const = 0 ; + virtual bool IsPlane( double dToler = EPS_SMALL) const = 0 ; virtual bool IsACircle( void) const = 0 ; virtual bool IsInPlaneXY( void) const = 0 ; virtual bool IsInPlanePerpExtr( void) const = 0 ; diff --git a/EGkPolygon3d.h b/EGkPolygon3d.h index f903c8e..562499e 100644 --- a/EGkPolygon3d.h +++ b/EGkPolygon3d.h @@ -36,11 +36,12 @@ class Polygon3d EGK_EXPORT bool FromTriangle( const Triangle3d& trTria) ; EGK_EXPORT bool FromRectangle( double dDimX, double dDimY) ; EGK_EXPORT bool FromPolyLine( const PolyLine& PL) ; - EGK_EXPORT bool FromPlaneTrimmedWithBox( const Plane3d& plPlane, const Point3d& ptMin, const Point3d& ptMax) ; + EGK_EXPORT bool FromPlaneTrimmedWithBox( const Plane3d& plPlane, + const Point3d& ptMin, const Point3d& ptMax, bool bOnEq = false, bool bOnCt = false) ; EGK_EXPORT bool FromPlaneTrimmedWithBox( const Point3d& ptOn, const Vector3d& vtN, - const Point3d& ptMin, const Point3d& ptMax) ; - EGK_EXPORT bool Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq) ; - EGK_EXPORT bool Trim( const Polygon3d& plyOther, bool bInVsOut, bool bOnEq) ; + const Point3d& ptMin, const Point3d& ptMax, bool bOnEq = false, bool bOnCt = false) ; + EGK_EXPORT bool Trim( const Plane3d& plPlane, bool bInVsOut, bool bOnEq = false, bool bOnCt = false) ; + EGK_EXPORT bool Trim( const Polygon3d& plyOther, bool bInVsOut, bool bOnEq = false, bool bOnCt = false) ; EGK_EXPORT bool Add( const Polygon3d& plyOther) ; EGK_EXPORT bool IsValid( void) const { return ! m_Plane.GetVersN().IsSmall() ; } diff --git a/EGkStmStandard.h b/EGkStmStandard.h index f24550e..0e9578c 100644 --- a/EGkStmStandard.h +++ b/EGkStmStandard.h @@ -29,5 +29,5 @@ EGK_EXPORT ISurfTriMesh* GetSurfTriMeshPyramid( double dDimX, double dDimY, doub EGK_EXPORT ISurfTriMesh* GetSurfTriMeshCylinder( double dRadius, double dHeight, double dLinTol) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshCone( double dRadius, double dHeight, double dLinTol) ; EGK_EXPORT ISurfTriMesh* GetSurfTriMeshSphere( double dRadius, double dLinTol) ; -EGK_EXPORT ISurfTriMesh* GetSurfTriMeshPlaneInBox( const Plane3d& plPlane, const BBox3d& b3Box) ; +EGK_EXPORT ISurfTriMesh* GetSurfTriMeshPlaneInBox( const Plane3d& plPlane, const BBox3d& b3Box, bool bOnEq = false, bool bOnCt = false) ; diff --git a/EGkVector3d.h b/EGkVector3d.h index 5160ac1..78e6362 100644 --- a/EGkVector3d.h +++ b/EGkVector3d.h @@ -276,6 +276,24 @@ Media( const Vector3d& vtV1, const Vector3d& vtV2, double dCoeff) ( 1 - dCoeff) * vtV1.z + dCoeff * vtV2.z)) ; } +//---------------------------------------------------------------------------- +//! Restituisce il componente del vettore parallelo a quello di riferimento +//---------------------------------------------------------------------------- +inline Vector3d +ParallCompo( const Vector3d& vtV, const Vector3d& vtRef) +{ + return ( ( vtV * vtRef) * vtRef) ; +} + +//---------------------------------------------------------------------------- +//! Restituisce il componente del vettore ortogonale a quello di riferimento +//---------------------------------------------------------------------------- +inline Vector3d +OrthoCompo( const Vector3d& vtV, const Vector3d& vtRef) +{ + return ( vtV - ( vtV * vtRef) * vtRef) ; +} + //---------------------------------------------------------------------------- //! Verifica se due vettori sono quasi coincidenti (tolleranza come parametro) //---------------------------------------------------------------------------- diff --git a/EInAPI.h b/EInAPI.h index e630882..a74f3bb 100644 --- a/EInAPI.h +++ b/EInAPI.h @@ -469,7 +469,7 @@ EIN_EXPORT BOOL __stdcall EgtCurveDomain( int nId, double* pdStart, double* pdEn EIN_EXPORT BOOL __stdcall EgtCurveLength( int nId, double* pdLen) ; EIN_EXPORT BOOL __stdcall EgtCurveLengthAtPoint( int nId, const double ptOn[3], double dExtend, double* pdLen) ; EIN_EXPORT BOOL __stdcall EgtCurveIsClosed( int nId) ; -EIN_EXPORT BOOL __stdcall EgtCurveIsFlat( int nId, double vtN[3], double* pdDist) ; +EIN_EXPORT BOOL __stdcall EgtCurveIsFlat( int nId, BOOL bUseExtrusion, double dToler, double vtN[3], double* pdDist) ; EIN_EXPORT BOOL __stdcall EgtCurveAreaXY( int nId, double* pdArea) ; EIN_EXPORT BOOL __stdcall EgtCurveArea( int nId, double vtN[3], double* pdDist, double* pdArea) ; EIN_EXPORT BOOL __stdcall EgtCurveNearestExtremityToPoint( int nId, const double ptP[3], BOOL* pbStart) ; diff --git a/EXeExecutor.h b/EXeExecutor.h index 003c8dd..04460b6 100644 --- a/EXeExecutor.h +++ b/EXeExecutor.h @@ -463,6 +463,7 @@ EXE_EXPORT bool ExeExtendCurveStartByLen( int nId, double dLen) ; EXE_EXPORT bool ExeExtendCurveEndByLen( int nId, double dLen) ; EXE_EXPORT bool ExeTrimExtendCurveByLen( int nId, double dLen, const Point3d& ptNear, int nRefType) ; EXE_EXPORT int ExeTrimCurveWithRegion( int nCrvId, int nRegId, bool bInVsOut, bool bOn, int* pnCount) ; +EXE_EXPORT int ExeTrimFlatCurveWithBox( int nCrvId, const Frame3d& frBox, const Vector3d& vtDiag, bool bInVsOut, bool bOn, int nRefType, int* pnCount) ; EXE_EXPORT int ExeSplitCurve( int nId, int nParts) ; EXE_EXPORT int ExeSplitCurveAtPoint( int nId, const Point3d& ptOn, int nRefType) ; EXE_EXPORT int ExeSplitCurveAtParam( int nId, double dParam) ; @@ -549,7 +550,7 @@ EXE_EXPORT bool ExeCurveDomain( int nId, double* pdStart, double* pdEnd) ; EXE_EXPORT bool ExeCurveLength( int nId, double* pdLen) ; EXE_EXPORT bool ExeCurveLengthAtPoint( int nId, const Point3d& ptOn, double dExtend, double* pdLen) ; EXE_EXPORT bool ExeCurveIsClosed( int nId) ; -EXE_EXPORT bool ExeCurveIsFlat( int nId, Plane3d& Plane, double dToler = EPS_SMALL) ; +EXE_EXPORT bool ExeCurveIsFlat( int nId, Plane3d& Plane, bool bUseExtrusion = true, double dToler = EPS_SMALL) ; EXE_EXPORT bool ExeCurveAreaXY( int nId, double& dArea) ; EXE_EXPORT bool ExeCurveArea( int nId, Plane3d& Plane, double& dArea) ; EXE_EXPORT bool ExeCurveNearestExtremityToPoint( int nId, const Point3d& ptP, bool& bStart) ;