Files
Include/EGkPolyLine.h
T
Dario Sassi fcd7fab8a8 Include :
- modifiche a Vector3d e Point3d
- migliorie a FromString
- aggiunta struttura Plane3d
- migliorie varie.
2014-04-09 13:02:22 +00:00

82 lines
3.6 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EGkPolyLine.h Data : 22.12.13 Versione : 1.4l3
// Contenuto : Dichiarazione della classe PolyLine.
//
//
//
// Modifiche : 22.12.13 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 PolyLine
{
public :
EGK_EXPORT PolyLine( void) ;
EGK_EXPORT ~PolyLine( void) ;
EGK_EXPORT bool Clear( void) ;
EGK_EXPORT bool AddUPoint( double dPar, const Point3d& ptP) ;
EGK_EXPORT bool EraseFirstUPoint( void) ;
EGK_EXPORT bool EraseLastUPoint( void) ;
EGK_EXPORT bool AddOffsetToU( double dOffset) ;
EGK_EXPORT bool Splice( PolyLine& PL) ;
EGK_EXPORT bool IsClosed( void) const ;
EGK_EXPORT int GetPointNbr( void) const
{ return m_nCount ; }
EGK_EXPORT bool GetFirstUPoint( double* pdPar, Point3d* pptP) const ;
EGK_EXPORT bool GetNextUPoint( double* pdPar, Point3d* pptP) const ;
EGK_EXPORT bool GetFirstU( double& dPar) const
{ return GetFirstUPoint( &dPar, nullptr) ; }
EGK_EXPORT bool GetNextU( double& dPar) const
{ return GetNextUPoint( &dPar, nullptr) ; }
EGK_EXPORT bool GetFirstPoint( Point3d& ptP) const
{ return GetFirstUPoint( nullptr, &ptP) ; }
EGK_EXPORT bool GetNextPoint( Point3d& ptP) const
{ return GetNextUPoint( nullptr, &ptP) ; }
EGK_EXPORT bool GetLastUPoint( double* pdPar, Point3d* pptP) const ;
EGK_EXPORT bool GetPrevUPoint( double* pdPar, Point3d* pptP) const ;
EGK_EXPORT bool GetLastU( double& dPar) const
{ return GetLastUPoint( &dPar, nullptr) ; }
EGK_EXPORT bool GetPrevU( double& dPar) const
{ return GetPrevUPoint( &dPar, nullptr) ; }
EGK_EXPORT bool GetLastPoint( Point3d& ptP) const
{ return GetLastUPoint( nullptr, &ptP) ; }
EGK_EXPORT bool GetPrevPoint( Point3d& ptP) const
{ return GetPrevUPoint( nullptr, &ptP) ; }
EGK_EXPORT int GetLineNbr( void) const
{ return ( m_nCount > 1 ? ( m_nCount - 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
{ return GetFirstULine( nullptr, &ptIni, nullptr, &ptFin) ; }
EGK_EXPORT bool GetNextLine( Point3d& ptIni, Point3d& ptFin) const
{ return GetNextULine( nullptr, &ptIni, nullptr, &ptFin) ; }
EGK_EXPORT bool IsPlanar( Plane3d& plPlane, double dToler = EPS_SMALL) const ;
private :
bool NewellPlane( Plane3d& plPlane) const ;
private :
int m_nCount ;
UPNTLIST m_lUPoints ;
mutable UPNTLIST::const_iterator m_iter ;
} ;