Files
EgtGeomKernel/GdbGroup.h
T
Dario Sassi dd0496d5eb EgtGeomKernel 1.5j6 :
- corretta e migliorata gestione ID delle entità.
2014-10-30 08:48:08 +00:00

92 lines
3.8 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : GdbGroup.h Data : 28.11.13 Versione : 1.4a2
// Contenuto : Dichiarazione della classe GdbGroup.
//
//
//
// Modifiche : 28.11.13 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "GeoFrame3d.h"
#include "GdbObj.h"
#include "/EgtDev/Include/EGkGeoObj.h"
#include <string>
//----------------------------------------------------------------------------
class GdbGroup : public GdbObj
{
friend class GdbObj ;
public :
virtual ~GdbGroup( void) ;
virtual GdbGroup* Clone( int nId) const ;
virtual bool Save( NgeWriter& ngeOut) const ;
virtual bool Load( int nNgeId, NgeReader& ngeIn, int& nParentId) ;
virtual bool GetLocalBBox( BBox3d& b3Loc, int nFlag, int nLev = 0) const ;
virtual bool GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag, int nLev = 0) const ;
virtual bool Translate( const Vector3d& vtMove)
{ m_frF.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)
{ return m_frF.Rotate( ptAx, vtAx, dCosAng, dSinAng) ; }
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
virtual bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) ;
virtual bool ToGlob( const Frame3d& frRef)
{ return m_frF.ToGlob( frRef) ; }
virtual bool ToLoc( const Frame3d& frRef)
{ return m_frF.ToLoc( frRef) ; }
virtual bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
{ return m_frF.LocToLoc( frOri, frDest) ; }
virtual bool OnSetMaterial( void) ;
public :
GdbGroup( void) ;
bool Clear( void) ;
void ObjCountInc( void)
{ ++ m_nObjCount ; }
void ObjCountDec( void)
{ -- m_nObjCount ; }
int GetObjCount( void) const
{ return m_nObjCount ; }
GdbObj* GetFirstObj( void)
{ return m_pFirstObj ; }
const GdbObj* GetFirstObj( void) const
{ return m_pFirstObj ; }
GdbObj* GetLastObj( void)
{ return m_pLastObj ; }
const GdbObj* GetLastObj( void) const
{ return m_pLastObj ; }
public :
bool SetFrame( const Frame3d& frF)
{ if ( ! frF.IsValid())
return false ;
m_frF = frF ; return true ; }
Frame3d& GetFrame( void)
{ return m_frF ; }
const Frame3d& GetFrame( void) const
{ return m_frF ; }
bool GetGlobFrame( Frame3d& frGlob) const ;
private :
Frame3d m_frF ;
int m_nObjCount ;
GdbObj* m_pFirstObj ;
GdbObj* m_pLastObj ;
} ;
//----------------------------------------------------------------------------
inline const GdbGroup* GetGdbGroup( const GdbObj* pGObj)
{ return dynamic_cast<const GdbGroup*>(pGObj) ; }
inline GdbGroup* GetGdbGroup( GdbObj* pGObj)
{ return dynamic_cast<GdbGroup*>(pGObj) ; }