4ebb43bf1e
aggiunto comando COUNTER in tsc.
102 lines
4.8 KiB
C++
102 lines
4.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2013
|
|
//----------------------------------------------------------------------------
|
|
// File : CurveComposite.h Data : 23.11.13 Versione : 1.3a1
|
|
// Contenuto : Dichiarazione della classe Curva composita.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 16.04.13 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include <list>
|
|
#include "/EgtDev/Include/EGkCurveComposite.h"
|
|
#include "CurveAux.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
typedef std::list< ICurve*> PCRVSMPL_LIST ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class CurveComposite : public ICurveComposite
|
|
{
|
|
public : // IGeoObj
|
|
virtual ~CurveComposite( void) ;
|
|
virtual CurveComposite* Clone( void) const ;
|
|
virtual GeoObjType GetType( void) const { return CRV_COMPO ; }
|
|
virtual const std::string& GetKey( void) const ;
|
|
virtual bool IsValid( void) const { return ( m_nStatus == OK) ; }
|
|
virtual bool Save( std::ostream& osOut) const ;
|
|
virtual bool Load( Scanner& TheScanner) ;
|
|
virtual bool GetLocalBBox( BBox3d& b3Loc) const ;
|
|
virtual bool GetBBox( const Frame3d& frRef, BBox3d& b3Ref) const ;
|
|
virtual bool Translate( const Vector3d& vtMove) ;
|
|
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
|
|
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
|
|
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
|
|
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
|
|
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
|
|
virtual bool ToGlob( const Frame3d& frRef) ;
|
|
virtual bool ToLoc( const Frame3d& frRef) ;
|
|
|
|
public : // ICurve
|
|
virtual bool IsSimple( void) const { return false ; }
|
|
virtual bool IsClosed( void) const
|
|
{ return ::IsClosed( *this) ; }
|
|
virtual bool GetStartPoint( Point3d& ptStart) const ;
|
|
virtual bool GetEndPoint( Point3d& ptEnd) const ;
|
|
virtual bool GetDomain( double& dStart, double& dEnd) const ;
|
|
virtual bool GetLength( double& dLen) const ;
|
|
virtual bool GetPointD1D2( double dU, Side nS, Point3d& ptPos,
|
|
Vector3d* pvtDer1 = nullptr, Vector3d* pvtDer2 = nullptr) const ;
|
|
virtual bool GetPointTang( double dU, Side nS, Point3d& ptPos, Vector3d& vtTang) const
|
|
{ return ::GetPointTang( *this, dU, nS, ptPos, vtTang) ; }
|
|
virtual bool GetPointDiffGeom( double dU, Side nS, CrvPointDiffGeom& oDiffG) const
|
|
{ oDiffG.nFlag = ( IsParamAtJoint( dU) ? CrvPointDiffGeom::TO_VERIFY : CrvPointDiffGeom::STD) ;
|
|
return ::GetPointDiffGeom( *this, dU, nS, oDiffG) ; }
|
|
virtual bool Invert( void) ;
|
|
virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, PolyLine& PL) const ;
|
|
virtual bool TrimStartAtParam( double dUTrim) ;
|
|
virtual bool TrimEndAtParam( double dUTrim) ;
|
|
virtual bool TrimStartAtLen( double dLenTrim) ;
|
|
virtual bool TrimEndAtLen( double dLenTrim) ;
|
|
|
|
public : // ICurveComposite
|
|
virtual bool Clear( void) ;
|
|
virtual bool AddCurve( const ICurve& cCrv) ;
|
|
virtual int GetCurveNumber( void) const { return m_nCounter ; }
|
|
virtual const ICurve* GetFirstCurve( void) const ;
|
|
virtual const ICurve* GetNextCurve( void) const ;
|
|
virtual bool IsParamAtJoint( double dU) const ;
|
|
|
|
public :
|
|
CurveComposite( void) ;
|
|
const CurveComposite& operator =( const CurveComposite& ccSrc)
|
|
{ if ( &ccSrc != this) {
|
|
Clear() ;
|
|
PCRVSMPL_LIST::const_iterator Iter ;
|
|
for ( Iter = ccSrc.m_CrvSmplS.begin() ; Iter != ccSrc.m_CrvSmplS.end() ; ++Iter)
|
|
AddCurve( **Iter) ;
|
|
}
|
|
return *this ; }
|
|
|
|
private :
|
|
bool Validate( void) ;
|
|
bool AddSimpleCurve( ICurve* pSmplCrv) ;
|
|
|
|
private :
|
|
enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ;
|
|
|
|
private :
|
|
Status m_nStatus ; // stato
|
|
int m_nCounter ; // contatore del numero di curve
|
|
PCRVSMPL_LIST m_CrvSmplS ; // lista di curve semplici
|
|
Point3d m_PtStart ; // punto iniziale
|
|
Point3d m_PtEnd ; // punto finale
|
|
bool m_bClosed ; // flag per indicare che la curva è chiusa
|
|
PCRVSMPL_LIST::const_iterator m_Iter ; // iteratore
|
|
} ;
|