2cbdfc1db9
- cambiato Load, con uso di NgeReader.
107 lines
4.9 KiB
C++
107 lines
4.9 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2013
|
|
//----------------------------------------------------------------------------
|
|
// File : CurveLine.h Data : 16.04.13 Versione : 1.1d1
|
|
// Contenuto : Dichiarazione della classe Segmento di Linea.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 16.04.13 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "ObjGraphicsMgr.h"
|
|
#include "CurveAux.h"
|
|
#include "DllMain.h"
|
|
#include "GeoObjRW.h"
|
|
#include "/EgtDev/Include/EGkCurveLine.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
class CurveLine : public ICurveLine, public IGeoObjRW
|
|
{
|
|
public : // IGeoObj
|
|
virtual ~CurveLine( void) ;
|
|
virtual CurveLine* Clone( void) const ;
|
|
virtual GeoObjType GetType( void) const ;
|
|
virtual bool IsValid( void) const
|
|
{ return ( m_nStatus == OK) ; }
|
|
virtual const std::string& GetTitle( void) const ;
|
|
virtual bool Dump( std::string& sOut, const char* szNewLine = "\n") const ;
|
|
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) ;
|
|
virtual void SetObjGraphics( IObjGraphics* pOGr)
|
|
{ m_OGrMgr.SetObjGraphics( pOGr) ; }
|
|
virtual IObjGraphics* GetObjGraphics( void)
|
|
{ return m_OGrMgr.GetObjGraphics() ; }
|
|
virtual const IObjGraphics* GetObjGraphics( void) const
|
|
{ return m_OGrMgr.GetObjGraphics() ; }
|
|
|
|
public : // ICurve
|
|
virtual bool IsSimple( void) const
|
|
{ return true ; }
|
|
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
|
|
{ dStart = 0 ; dEnd = 1 ; return ( m_nStatus == OK) ; }
|
|
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 = 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 : // ICurveLine
|
|
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
|
virtual bool Set( const Point3d& ptStart, const Point3d& ptEnd) ;
|
|
virtual const Point3d& GetStart( void) const
|
|
{ return m_PtStart ; }
|
|
virtual const Point3d& GetEnd( void) const
|
|
{ return m_PtEnd ; }
|
|
|
|
public : // IGeoObjRW
|
|
virtual int GetNgeId( void) const ;
|
|
virtual bool Save( NgeWriter& ngeOut) const ;
|
|
virtual bool Load( NgeReader& ngeIn) ;
|
|
|
|
public :
|
|
CurveLine( void) ;
|
|
const CurveLine& operator =( const CurveLine& clSrc)
|
|
{ if ( ! Copy( clSrc))
|
|
LOG_ERROR( GetEGkLogger(), "CurveLine : copy error")
|
|
return *this ; }
|
|
|
|
private :
|
|
bool Copy( const CurveLine& clSrc) ;
|
|
bool Validate( void) ;
|
|
|
|
private :
|
|
enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ;
|
|
|
|
private :
|
|
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
|
Status m_nStatus ; // stato
|
|
Point3d m_PtStart ; // punto iniziale
|
|
Point3d m_PtEnd ; // punto finale
|
|
} ;
|