82 lines
3.4 KiB
C++
82 lines
3.4 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2013
|
|
//----------------------------------------------------------------------------
|
|
// File : GeomDB.h Data : 08.04.13 Versione : 1.1c1
|
|
// Contenuto : Dichiarazione della classe GeomDB.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 22.01.13 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include "/EgtDev/Include/EGkGeomDB.h"
|
|
#include "GdbObj.h"
|
|
#include "GdbGroup.h"
|
|
#include "IdManager.h"
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
class CScan ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class GeomDB : public IGeomDB
|
|
{
|
|
friend class GdbIterator ;
|
|
|
|
public :
|
|
virtual ~GeomDB( void) ;
|
|
virtual bool Init( ILogger* pLogger) ;
|
|
virtual bool ReInit( void) ;
|
|
virtual bool Clear( void) ;
|
|
virtual bool Load( const std::string& sFileIn) ;
|
|
virtual bool Save( const std::string& sFileOut) const ;
|
|
virtual bool ExistsNode( int nId) const ;
|
|
virtual int AddGroup( int nId, int nParentId, const Frame3d& frFrame) ;
|
|
virtual int AddGeoObj( int nId, int nParentId, IGeoObj* pGeoObj) ;
|
|
virtual GdbType GetGdbType( int nId) const ;
|
|
virtual IGeoObj* GetGeoObj( int nId) ;
|
|
virtual Frame3d* GetGroupFrame( int nId) ;
|
|
virtual bool GetGroupGlobFrame( int nId, Frame3d& frGlob) ;
|
|
virtual int GetParentId( int nId) ;
|
|
virtual int Copy( int nIdSou, int nIdDest, int nParentIdDest) ;
|
|
virtual bool Erase( int nId) ;
|
|
virtual bool Translate( int nId, const Vector3d& vtMove) ;
|
|
virtual bool Rotate( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
|
|
virtual bool Rotate( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
|
|
{ double dAngRad = dAngDeg * DEGTORAD ;
|
|
return Rotate( nId, ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
|
|
virtual bool Scale( int nId, const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
|
|
virtual bool Mirror( int nId, const Point3d& ptOn, const Vector3d& vtNorm) ;
|
|
|
|
public :
|
|
GeomDB( void) ;
|
|
|
|
private :
|
|
GdbNode* GetGdbNode( int nId) ;
|
|
GdbObj* GetGdbObj( int nId) { return dynamic_cast<GdbObj*>( GetGdbNode( nId)) ; }
|
|
GdbGroup* GetGdbGroup( int nId) { return dynamic_cast<GdbGroup*>( GetGdbNode( nId)) ; }
|
|
bool AddToGeomDB( GdbNode* pGNode, int nParentId) ;
|
|
bool LoadStart( Scanner& TheScanner) ;
|
|
bool LoadOneNode( Scanner& TheScanner, bool& bEnd) ;
|
|
|
|
private :
|
|
GdbGroup m_GrpRadix ; // gruppo radice di tutto il DB
|
|
IdManager m_IdManager ; // gestore del nuovo Id
|
|
ILogger* m_pLogger ;
|
|
} ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
inline const GdbObj* GetGdbObj( const GdbNode* pGNode)
|
|
{ return dynamic_cast<const GdbObj*>(pGNode) ; }
|
|
inline GdbObj* GetGdbObj( GdbNode* pGNode)
|
|
{ return dynamic_cast<GdbObj*>(pGNode) ; }
|
|
inline const GdbGroup* GetGdbGroup( const GdbNode* pGNode)
|
|
{ return dynamic_cast<const GdbGroup*>(pGNode) ; }
|
|
inline GdbGroup* GetGdbGroup( GdbNode* pGNode)
|
|
{ return dynamic_cast<GdbGroup*>(pGNode) ; }
|