//---------------------------------------------------------------------------- // EgalTech 2014-2014 //---------------------------------------------------------------------------- // File : EGkPolyArc.h Data : 14.08.14 Versione : 1.5h3 // Contenuto : Dichiarazione della classe PolyArc. // // // // Modifiche : 14.08.14 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "/EgtDev/Include/EGkPoint3d.h" #include "/EgtDev/Include/EGkGeoCollection.h" class Plane3d ; //----------------------- 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 PolyArc { public : EGK_EXPORT PolyArc( void) ; EGK_EXPORT ~PolyArc( void) ; EGK_EXPORT bool Clear( void) ; EGK_EXPORT bool SetExtrusion( const Vector3d& vtExtr) ; EGK_EXPORT bool AddUPoint( double dPar, const Point3d& ptP, double dBulge) ; EGK_EXPORT bool ModifyLastParam( double dPar) ; EGK_EXPORT bool ModifyLastBulge( double dBulge) ; EGK_EXPORT bool Close( void) ; EGK_EXPORT bool EraseFirstUPoint( void) ; EGK_EXPORT bool EraseLastUPoint( void) ; EGK_EXPORT bool AddOffsetToU( double dOffset) ; EGK_EXPORT bool ParamLinearTransform( double dStartU, double dEndU) ; EGK_EXPORT bool SetElevation( double dZ) ; EGK_EXPORT bool AddElevation( double dZ) ; EGK_EXPORT bool Translate( const Vector3d& vtMove) ; EGK_EXPORT bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) { double dAngRad = dAngDeg * DEGTORAD ; return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; } EGK_EXPORT bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ; EGK_EXPORT bool Scale( const Frame3d& frRef, double dCoeff) ; // deve essere uniforme EGK_EXPORT bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ; // Shear non applicabile EGK_EXPORT bool ToGlob( const Frame3d& frRef) ; EGK_EXPORT bool ToLoc( const Frame3d& frRef) ; EGK_EXPORT bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ; EGK_EXPORT bool Join( PolyArc& PA, double dOffsetPar = 0) ; EGK_EXPORT bool Split( double dU, PolyArc& PA) ; EGK_EXPORT bool IsClosed( void) const ; EGK_EXPORT bool IsRectangleXY( BBox3d& b3Rect) const ; EGK_EXPORT bool IsCircle( double dLinTol, Point3d& ptCen, Vector3d& vtN, double& dRad, bool& bCCW) const ; EGK_EXPORT const Vector3d& GetExtrusion(void) const { return m_vtExtr ; } EGK_EXPORT int GetRejectedNbr( void) const { return m_nRejected ; } EGK_EXPORT int GetPointNbr( void) const { 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 { return GetFirstUPoint( &dPar, nullptr, nullptr, bNotLast) ; } EGK_EXPORT bool GetNextU( double& dPar, bool bNotLast = false) const { return GetNextUPoint( &dPar, nullptr, nullptr, bNotLast) ; } EGK_EXPORT bool GetFirstPoint( Point3d& ptP, double& dBulge, bool bNotLast = false) const { return GetFirstUPoint( nullptr, &ptP, &dBulge, bNotLast) ; } 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 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 { return GetFirstUArc( nullptr, &ptIni, nullptr, &ptFin, &dBulge) ; } EGK_EXPORT bool GetNextArc( Point3d& ptIni, Point3d& ptFin, double& dBulge) const { return GetNextUArc( nullptr, &ptIni, nullptr, &ptFin, &dBulge) ; } EGK_EXPORT bool IsFlat( int& nRank, Point3d& ptCen, Vector3d& vtDir, double dToler = EPS_SMALL) const ; EGK_EXPORT bool Invert( bool bInvertU = true) ; EGK_EXPORT bool RemoveAlignedPoints( double dToler = EPS_SMALL) ; private : struct UPointB { double dU ; Point3d ptP ; double dB ; UPointB( double dU_, const Point3d& ptP_, double dB_) : dU( dU_), ptP( ptP_), dB( dB_) {} } ; typedef std::list UPNTBLIST ; // lista di UPointB private : Vector3d m_vtExtr ; int m_nRejected ; UPNTBLIST m_lUPointBs ; mutable UPNTBLIST::const_iterator m_iter ; } ; //---------------------------------------------------------------------------- // Raccolte di PolyArc typedef std::vector POLYARCVECTOR ; // vettore di PolyArc typedef std::list POLYARCLIST ; // lista di PolyArc