61 lines
2.4 KiB
C++
61 lines
2.4 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2013
|
|
//----------------------------------------------------------------------------
|
|
// File : EGkPolyLine.cpp 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 PolyLine
|
|
{
|
|
public :
|
|
PolyLine( void) ;
|
|
~PolyLine( void) ;
|
|
bool AddUPoint( double dPar, const Point3d& ptP) ;
|
|
bool EraseFirstUPoint( void) ;
|
|
bool AddOffsetToU( double dOffset) ;
|
|
bool Splice( PolyLine& PL) ;
|
|
int GetPointNbr( void) const
|
|
{ return m_nCount ; }
|
|
bool GetFirstUPoint( double* pdPar, Point3d* pptP) const ;
|
|
bool GetNextUPoint( double* pdPar, Point3d* pptP) const ;
|
|
bool GetFirstU( double& dPar) const
|
|
{ return GetFirstUPoint( &dPar, nullptr) ; }
|
|
bool GetNextU( double& dPar) const
|
|
{ return GetNextUPoint( &dPar, nullptr) ; }
|
|
bool GetFirstPoint( Point3d& ptP) const
|
|
{ return GetFirstUPoint( nullptr, &ptP) ; }
|
|
bool GetNextPoint( Point3d& ptP) const
|
|
{ return GetNextUPoint( nullptr, &ptP) ; }
|
|
bool GetLastUPoint( double* pdPar, Point3d* pptP) const ;
|
|
bool GetLastU( double& dPar)
|
|
{ return GetLastUPoint( &dPar, nullptr) ; }
|
|
bool GetLastPoint( Point3d& ptP)
|
|
{ return GetLastUPoint( nullptr, &ptP) ; }
|
|
int GetLineNbr( void) const
|
|
{ return ( m_nCount > 1 ? ( m_nCount - 1) : 0) ; }
|
|
bool GetFirstULine( double* pdIni, Point3d* pptIni, double* pdFin, Point3d* pptFin) const ;
|
|
bool GetNextULine( double* pdIni, Point3d* pptIni, double* pdFin, Point3d* pptFin) const ;
|
|
bool GetFirstLine( Point3d& ptIni, Point3d& ptFin) const
|
|
{ return GetFirstULine( nullptr, &ptIni, nullptr, &ptFin) ; }
|
|
bool GetNextLine( Point3d& ptIni, Point3d& ptFin) const
|
|
{ return GetNextULine( nullptr, &ptIni, nullptr, &ptFin) ; }
|
|
|
|
private :
|
|
int m_nCount ;
|
|
UPNTLIST m_lUPoints ;
|
|
mutable UPNTLIST::const_iterator m_iter ;
|
|
} ;
|