d446b03086
- possibilità di salvare solo un gruppo o una entità del progetto.
157 lines
6.2 KiB
C++
157 lines
6.2 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : GdbObj.h Data : 05.03.14 Versione : 1.5c1
|
|
// Contenuto : Dichiarazione della classe GdbObj.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 28.11.13 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkGdbConst.h"
|
|
#include "/EgtDev/Include/EGkColor.h"
|
|
#include "/EgtDev/Include/EGkBBox3d.h"
|
|
#include "/EgtDev/Include/EgtNumCollection.h"
|
|
#include <string>
|
|
|
|
class GeomDB ;
|
|
class GdbGroup ;
|
|
class IdManager ;
|
|
class Attribs ;
|
|
class NgeWriter ;
|
|
class NgeReader ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class GdbObj
|
|
{
|
|
friend class SelManager ;
|
|
|
|
public :
|
|
virtual ~GdbObj( void) ;
|
|
virtual GdbObj* Clone( int nId) const = 0 ;
|
|
virtual GdbType GetGdbType( void) const = 0 ;
|
|
virtual bool Save( NgeWriter& ngeOut) const = 0 ;
|
|
virtual bool Load( int nNgeId, NgeReader& ngeIn, int& nParentId) = 0 ;
|
|
virtual bool GetLocalBBox( BBox3d& b3Loc, int nFlag, int nLev = 0) const = 0 ;
|
|
virtual bool GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag, int nLev = 0) const = 0 ;
|
|
virtual bool Translate( const Vector3d& vtMove) = 0 ;
|
|
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) = 0 ;
|
|
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) = 0 ;
|
|
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ;
|
|
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) = 0 ;
|
|
virtual bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ;
|
|
virtual bool ToGlob( const Frame3d& frRef) = 0 ;
|
|
virtual bool ToLoc( const Frame3d& frRef) = 0 ;
|
|
virtual bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) = 0 ;
|
|
virtual bool OnSetMaterial( void) = 0 ;
|
|
|
|
public :
|
|
GdbObj( void) ;
|
|
bool CopyFrom( const GdbObj* pSou) ;
|
|
bool CopyAttribsFrom( const GdbObj* pSou) ;
|
|
|
|
public :
|
|
bool SaveAttribs( NgeWriter& ngeOut) const ;
|
|
bool LoadAttribs( NgeReader& ngeIn) ;
|
|
Attribs* GetAttribs( void)
|
|
{ return m_pAttribs ; }
|
|
Attribs* GetSafeAttribs( void) ;
|
|
bool SetLevel( int nLevel) ;
|
|
bool RevertLevel( void) ;
|
|
bool GetLevel( int& nLevel) const ;
|
|
bool GetCalcLevel( int& nLevel) const ;
|
|
bool SetMode( int nMode) ;
|
|
bool RevertMode( void) ;
|
|
bool GetMode( int& nMode) const ;
|
|
bool GetCalcMode( int& nMode) const ;
|
|
bool SetStatus( int nStat) ;
|
|
bool RevertStatus( void) ;
|
|
bool IsOff( void) const ;
|
|
bool IsOn( void) const ;
|
|
bool IsSelected( void) const ;
|
|
bool GetStatus( int& nStat) const ;
|
|
bool GetCalcStatus( int& nStat, int nLev = 0) const ;
|
|
bool SetMark( void) ;
|
|
bool ResetMark( void) ;
|
|
bool GetMark( int& nMark) const ;
|
|
bool GetCalcMark( int& nMark) const ;
|
|
bool SetMaterial( int nMat) ;
|
|
bool SetMaterial( Color cCol) ;
|
|
bool GetMaterial( int& nMat) const ;
|
|
bool GetMaterial( Color& cCol) const ;
|
|
bool GetCalcMaterial( int& nMat) const ;
|
|
bool GetCalcMaterial( Color& cCol) const ;
|
|
bool SetName( const std::string& sName) ;
|
|
bool GetName( std::string& sName) const ;
|
|
bool ExistsName( void) const ;
|
|
bool RemoveName( void) ;
|
|
bool SetInfo( const std::string& sKey, const std::string& sInfo) ;
|
|
bool SetInfo( const std::string& sKey, bool bInfo) ;
|
|
bool SetInfo( const std::string& sKey, int nInfo) ;
|
|
bool SetInfo( const std::string& sKey, double dInfo) ;
|
|
bool SetInfo( const std::string& sKey, const Vector3d& vtInfo) ;
|
|
bool SetInfo( const std::string& sKey, const Point3d& ptInfo) ;
|
|
bool SetInfo( const std::string& sKey, const BBox3d& b3Info) ;
|
|
bool SetInfo( const std::string& sKey, const Frame3d& frInfo) ;
|
|
bool SetInfo( const std::string& sKey, const INTVECTOR& vnInfo) ;
|
|
bool SetInfo( const std::string& sKey, const DBLVECTOR& vdInfo) ;
|
|
bool GetInfo( const std::string& sKey, std::string& sInfo) const ;
|
|
bool GetInfo( const std::string& sKey, bool& bInfo) const ;
|
|
bool GetInfo( const std::string& sKey, int& nInfo) const ;
|
|
bool GetInfo( const std::string& sKey, double& dInfo) const ;
|
|
bool GetInfo( const std::string& sKey, Vector3d& vtInfo) const ;
|
|
bool GetInfo( const std::string& sKey, Point3d& ptInfo) const ;
|
|
bool GetInfo( const std::string& sKey, BBox3d& b3Info) const ;
|
|
bool GetInfo( const std::string& sKey, Frame3d& frInfo) const ;
|
|
bool GetInfo( const std::string& sKey, INTVECTOR& vnInfo) const ;
|
|
bool GetInfo( const std::string& sKey, DBLVECTOR& vdInfo) const ;
|
|
bool ExistsInfo( const std::string& sKey) const ;
|
|
bool RemoveInfo( const std::string& sKey) ;
|
|
|
|
public :
|
|
void SetGeomDB( GeomDB* pGDB)
|
|
{ m_pGDB = pGDB ; }
|
|
GeomDB* GetGeomDB( void) const
|
|
{ return m_pGDB ; }
|
|
GdbObj* GetNext( void)
|
|
{ return m_pNext ; }
|
|
const GdbObj* GetNext( void) const
|
|
{ return m_pNext ; }
|
|
GdbObj* GetPrev( void)
|
|
{ return m_pPrev ; }
|
|
const GdbObj* GetPrev( void) const
|
|
{ return m_pPrev ; }
|
|
GdbGroup* GetParent( void)
|
|
{ return m_pParent ; }
|
|
const GdbGroup* GetParent( void) const
|
|
{ return m_pParent ; }
|
|
int GetParentId( void) const ;
|
|
bool AddTail( GdbGroup* pParent) ;
|
|
bool AddHead( GdbGroup* pParent) ;
|
|
bool InsertAfter( GdbObj* pRef) ;
|
|
bool InsertBefore( GdbObj* pRef) ;
|
|
bool Swap( GdbObj* pOther) ;
|
|
bool Remove( void) ;
|
|
|
|
public :
|
|
int m_nId ;
|
|
Attribs* m_pAttribs ;
|
|
|
|
protected :
|
|
GeomDB* m_pGDB ;
|
|
|
|
private :
|
|
GdbObj* m_pNext ;
|
|
GdbObj* m_pPrev ;
|
|
GdbGroup* m_pParent ;
|
|
|
|
private :
|
|
GdbObj* m_pSelNext ;
|
|
GdbObj* m_pSelPrev ;
|
|
} ;
|