//---------------------------------------------------------------------------- // 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 //---------------------------------------------------------------------------- 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) 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 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) { return m_gfrFrame.m_frF.ToGlob( frRef) ; } virtual bool ToLoc( const Frame3d& frRef) { return m_gfrFrame.m_frF.ToLoc( frRef) ; } 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 : 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(pGObj) ; } inline GdbGroup* GetGdbGroup( GdbObj* pGObj) { return dynamic_cast(pGObj) ; }