Files
EgtGeomKernel/GeoVector3d.h
T
Dario Sassi 3e8e7e2e2a EgtGeomKernel 1.5l1 :
- aggiornamento a VS2013
- migliorato SimpleOffset e implementato anche per CurveComposite
- il lato di offset ora viene dal segno dello spostamento ( + a destra, - a sinistra)
- il vettore estrusione ora è la normale al piano di offset (se non c'è uso Z+)
- aggiunto a tutte le entità geometriche membro m_nTempProp intero temporaneo
- migliorata DistPointCrvBezier e DistPointArc
- corretta IntersLineArc con linee che non giacciono nel piano XY
- corretta ModifyStart di CurveArc
- a PolyArc aggiunto metodo ParamLinearTransform
- aggiunta gestione riferimento di griglia (CPlane).
2014-12-17 15:03:29 +00:00

109 lines
5.4 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : GeoVector3d.h Data : 11.06.14 Versione : 1.5f4
// Contenuto : Dichiarazione della classe Vettore Geometrico 3d.
//
//
//
// Modifiche : 10.10.13 DS Creazione modulo.
// 11.06.14 DS Agg. punto Base.
//
//----------------------------------------------------------------------------
#pragma once
#include "ObjGraphicsMgr.h"
#include "DllMain.h"
#include "GeoObjRW.h"
#include "/EgtDev/Include/EGkGeoVector3d.h"
//----------------------------------------------------------------------------
class GeoVector3d : public IGeoVector3d, public IGeoObjRW
{
public : // IGeoObj
virtual ~GeoVector3d( void) ;
virtual GeoVector3d* Clone( void) const ;
virtual GeoObjType GetType( void) const ;
virtual bool IsValid( void) const
{ return true ; }
virtual const std::string& GetTitle( void) const ;
virtual bool Dump( std::string& sOut, const char* szNewLine = "\n") const ;
virtual bool GetLocalBBox( BBox3d& b3Loc, int nFlag = BBF_STANDARD) const ;
virtual bool GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag = BBF_STANDARD) const ;
virtual bool Translate( const Vector3d& vtMove)
{ m_OGrMgr.Reset() ; m_ptBase.Translate( vtMove) ; return true ; }
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
{ m_OGrMgr.Reset() ;
return ( m_vtV.Rotate( vtAx, dCosAng, dSinAng) &&
m_ptBase.Rotate( ptAx, vtAx, dCosAng, dSinAng)) ; }
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{ m_OGrMgr.Reset() ;
return ( m_vtV.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) &&
m_ptBase.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ)) ; }
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
{ m_OGrMgr.Reset() ;
return ( m_vtV.Mirror( vtNorm) && m_ptBase.Mirror( ptOn, vtNorm)) ; }
virtual bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff)
{ m_OGrMgr.Reset() ;
return ( m_vtV.Shear( vtNorm, vtDir, dCoeff) && m_ptBase.Shear( ptOn, vtNorm, vtDir, dCoeff)) ; }
virtual bool ToGlob( const Frame3d& frRef)
{ m_OGrMgr.Reset() ;
return ( m_vtV.ToGlob( frRef) && m_ptBase.ToGlob( frRef)) ; }
virtual bool ToLoc( const Frame3d& frRef)
{ m_OGrMgr.Reset() ;
return ( m_vtV.ToLoc( frRef) && m_ptBase.ToLoc( frRef)) ; }
virtual bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
{ m_OGrMgr.Reset() ;
return ( m_vtV.LocToLoc( frOri, frDest) && m_ptBase.LocToLoc( frOri, frDest)) ; }
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() ; }
virtual void SetTempProp( int nProp)
{ m_nTempProp = nProp ; }
virtual int GetTempProp( void)
{ return m_nTempProp ; }
public : // IGeoVector3d
virtual bool CopyFrom( const IGeoObj* pGObjSrc) ;
virtual bool Set( const Vector3d& vtV) ;
virtual bool Set( const Vector3d& vtV, const Point3d& ptBase) ;
virtual const Vector3d& GetVector( void) const
{ return m_vtV ; }
virtual const Point3d& GetBase( void) const
{ return m_ptBase ; }
virtual bool ChangeVector( const Vector3d& vtV) ;
virtual bool ChangeBase( const Point3d& ptBase) ;
virtual bool GetDrawWithArrowHead( double dFrazLenAH, double dMaxDimA, PolyLine& PL) const ;
public : // IGeoObjRW
virtual int GetNgeId( void) const ;
virtual bool Save( NgeWriter& ngeOut) const ;
virtual bool Load( NgeReader& ngeIn) ;
public :
GeoVector3d( void) ;
GeoVector3d( const GeoVector3d& gvSrc)
{ if ( ! CopyFrom( gvSrc))
LOG_ERROR( GetEGkLogger(), "GeoVector3d : copy constructor error") }
GeoVector3d& operator =( const GeoVector3d& gvSrc)
{ if ( ! CopyFrom( gvSrc))
LOG_ERROR( GetEGkLogger(), "GeoVector3d : copy error")
return *this ; }
private :
bool CopyFrom( const GeoVector3d& gvSrc) ;
private :
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
Vector3d m_vtV ; // oggetto
Point3d m_ptBase ; // punto base da cui tracciare il vettore
int m_nTempProp ; // proprietà temporanea
} ;