cc2db726db
aggiunto map da sKey a nType.
94 lines
4.3 KiB
C++
94 lines
4.3 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 :
|
|
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( CScan& TheScanner) ;
|
|
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 Point3d& ptCen, 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 :
|
|
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, Point3d& ptPos, Vector3d& vtDer1, Vector3d& vtDer2) const ;
|
|
virtual bool GetPoint( double dU, Point3d& ptPos) const
|
|
{ return ::GetPoint( *this, dU, ptPos) ; }
|
|
virtual bool GetPointTang( double dU, Point3d& ptPos, Vector3d& vtTang) const
|
|
{ return ::GetPointTang( *this, dU, ptPos, vtTang) ; }
|
|
virtual bool GetPointTangNormCurv( double dU, Point3d& ptPos, Vector3d& vtT, Vector3d& vtN, double& dCurv) const
|
|
{ return ::GetPointTangNormCurv( *this, dU, ptPos, vtT, vtN, dCurv) ; }
|
|
virtual bool Reverse( void) ;
|
|
|
|
public :
|
|
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 ;
|
|
|
|
public :
|
|
CurveComposite( void) ;
|
|
inline 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
|
|
} ;
|