Files
EgtGeomKernel/GdbGroup.h
T
Dario Sassi cc86dbd73d EgtGeomKernel 1.5d3 :
- aggiunte Move, Rot, Mirror e Scale di gruppo espresse nel suo proprio rif.
2014-04-10 07:02:37 +00:00

89 lines
3.5 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, IdManager& IdMgr) const ;
virtual bool Save( std::ostream& osOut) const ;
virtual bool Load( const std::string& sType, Scanner& TheScanner, 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) ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
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 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)
{ Frame3d frF = m_gfrFrame.GetFrame() ;
return ( frF.ToGlob( frRef) && m_gfrFrame.Set( frF)) ; }
virtual bool ToLoc( const Frame3d& frRef)
{ Frame3d frF = m_gfrFrame.GetFrame() ;
return ( frF.ToLoc( frRef) && m_gfrFrame.Set( frF)) ; }
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 :
static const std::string& GetKey( void)
{ static std::string s_sKey = "A_GRP" ; return s_sKey ; }
public :
const Frame3d& GetFrame( void) const
{ return m_gfrFrame.GetFrame() ; }
bool GetGlobFrame( Frame3d& frGlob) const ;
public :
GeoFrame3d m_gfrFrame ;
private :
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) ; }