Files
Dario Sassi 3908e11d18 EgtGeomKernel 2.6h2 :
- modifiche per permettere Mark di tipo 2.
2024-08-22 09:10:04 +02:00

171 lines
9.5 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2023
//----------------------------------------------------------------------------
// File : GdbIterator.h Data : 09.07.23 Versione : 2.5g1
// Contenuto : Dichiarazione della classe GdbIterator.
//
//
//
// Modifiche : 04.12.13 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkGdbIterator.h"
#include "GeomDB.h"
//-----------------------------------------------------------------------------
class GdbIterator : public IGdbIterator
{
public :
~GdbIterator( void) override ;
bool SetGDB( IGeomDB* pGDB) override ;
GeomDB* GetGDB( void) const override
{ return m_pGDB ; }
bool GoTo( int nId) override ;
bool GoToFirstInGroup( int nIdGroup) override ;
bool GoToFirstInGroup( const IGdbIterator& iIter) override ;
bool GoToNext( void) override ;
bool GoToLastInGroup( int nIdGroup) override ;
bool GoToLastInGroup( const IGdbIterator& iIter) override ;
bool GoToPrev( void) override ;
bool EraseAndGoToNext( void) override ;
bool EraseAndGoToPrev( void) override ;
bool GoToFirstNameInGroup( int nIdGroup, const std::string& sName) override ;
bool GoToFirstNameInGroup( const IGdbIterator& iIter, const std::string& sName) override ;
bool GoToNextName( const std::string& sName) override ;
bool GoToLastNameInGroup( int nIdGroup, const std::string& sName) override ;
bool GoToLastNameInGroup( const IGdbIterator& iIter, const std::string& sName) override ;
bool GoToPrevName( const std::string& sName) override ;
bool EraseAndGoToNextName( const std::string& sName) override ;
bool EraseAndGoToPrevName( const std::string& sName) override ;
bool GoToFirstGroupInGroup( int nIdGroup) override ;
bool GoToFirstGroupInGroup( const IGdbIterator& iIter) override ;
bool GoToNextGroup( void) override ;
bool GoToLastGroupInGroup( int nIdGroup) override ;
bool GoToLastGroupInGroup( const IGdbIterator& iIter) override ;
bool GoToPrevGroup( void) override ;
bool EraseAndGoToNextGroup( void) override ;
bool EraseAndGoToPrevGroup( void) override ;
// Gets
int GetGdbType( void) const override ;
int GetGeoType( void) const override ;
IGeoObj* GetGeoObj( void) override ;
const IGeoObj* GetGeoObj( void) const override ;
Frame3d* GetGroupFrame( void) override ;
const Frame3d* GetGroupFrame( void) const override ;
bool GetGroupFrame( Frame3d& frGlob) const override ;
bool GetGroupGlobFrame( Frame3d& frGlob) const override ;
int GetGroupObjs( void) const override ;
int GetId( void) const override ;
int GetParentId( void) const override ;
bool GetGlobFrame( Frame3d& frGlob) const override ;
bool GetLocalBBox( BBox3d& b3Loc, int nFlag = BBF_STANDARD) const override ;
bool GetGlobalBBox( BBox3d& b3Glob, int nFlag = BBF_STANDARD) const override ;
bool GetRefBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag = BBF_STANDARD) const override ;
// Transformations
bool Translate( const Vector3d& vtMove) override ;
bool TranslateGlob( const Vector3d& vtMove) override ;
bool TranslateGroup( const Vector3d& vtMove) override ;
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) override
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) override ;
bool RotateGlob( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) override
{ double dAngRad = dAngDeg * DEGTORAD ;
return RotateGlob( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
bool RotateGlob( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) override ;
bool RotateGroup( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) override
{ double dAngRad = dAngDeg * DEGTORAD ;
return RotateGroup( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
bool RotateGroup( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) override ;
bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) override ;
bool ScaleGlob( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) override ;
bool ScaleGroup( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) override ;
bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) override ;
bool MirrorGlob( const Point3d& ptOn, const Vector3d& vtNorm) override ;
bool MirrorGroup( const Point3d& ptOn, const Vector3d& vtNorm) override ;
bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) override ;
bool ShearGlob( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) override ;
bool ShearGroup( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) override ;
// Attributes
bool SetLevel( int nLevel) override ;
bool RevertLevel( void) override ;
bool GetLevel( int& nLevel) const override ;
bool GetCalcLevel( int& nLevel) const override ;
bool SetMode( int nMode) override ;
bool RevertMode( void) override ;
bool GetMode( int& nMode) const override ;
bool GetCalcMode( int& nMode) const override ;
bool SetStatus( int nStat) override ;
bool RevertStatus( void) override ;
bool GetStatus( int& nStat) const override ;
bool GetCalcStatus( int& nStat) const override ;
bool SetMark( int nMark = GDB_MK_ON) override ;
bool ResetMark( void) override ;
bool GetMark( int& nMark) const override ;
bool GetCalcMark( int& nMark) const override ;
bool SetMaterial( int nMat) override ;
bool SetMaterial( int nMat, const std::string& sMatName) override ;
bool SetMaterial( Color cCol) override ;
bool GetMaterial( int& nMat) const override ;
bool GetMaterial( Material& mMat) const override ;
bool GetMaterial( Color& cCol) const override ;
bool GetCalcMaterial( int& nMat) const override ;
bool GetCalcMaterial( Material& mMat) const override ;
bool GetCalcMaterial( Color& cCol) const override ;
bool SetName( const std::string& sName) override ;
bool GetName( std::string& sName) const override ;
bool ExistsName( void) const override ;
bool RemoveName( void) override ;
bool SetInfo( const std::string& sKey, const std::string& sInfo) override ;
bool SetInfo( const std::string& sKey, bool bInfo) override ;
bool SetInfo( const std::string& sKey, int nInfo) override ;
bool SetInfo( const std::string& sKey, double dInfo) override ;
bool SetInfo( const std::string& sKey, const Point3d& ptInfo) override ;
bool SetInfo( const std::string& sKey, const Vector3d& vtInfo) override ;
bool SetInfo( const std::string& sKey, const Frame3d& frInfo) override ;
bool SetInfo( const std::string& sKey, const INTVECTOR& vnInfo) override ;
bool SetInfo( const std::string& sKey, const DBLVECTOR& vdInfo) override ;
bool SetInfo( const std::string& sKey, const STRVECTOR& vsInfo) override ;
bool GetInfo( const std::string& sKey, std::string& sInfo) const override ;
bool GetInfo( const std::string& sKey, bool& bInfo) const override ;
bool GetInfo( const std::string& sKey, int& nInfo) const override ;
bool GetInfo( const std::string& sKey, double& dInfo) const override ;
bool GetInfo( const std::string& sKey, Point3d& ptInfo) const override ;
bool GetInfo( const std::string& sKey, Vector3d& vtInfo) const override ;
bool GetInfo( const std::string& sKey, Frame3d& frInfo) const override ;
bool GetInfo( const std::string& sKey, INTVECTOR& vnInfo) const override ;
bool GetInfo( const std::string& sKey, DBLVECTOR& vdInfo) const override ;
bool GetInfo( const std::string& sKey, STRVECTOR& vsInfo) const override ;
bool ExistsInfo( const std::string& sKey) const override ;
bool RemoveInfo( const std::string& sKey) override ;
bool GetAllInfo( STRVECTOR& vsInfo) const override ;
bool CopyAllInfoFrom( const IGdbIterator& iIter) override ;
// Stipple
bool SetStipple( int nFactor, int nPattern) override ;
bool GetStipple( int& nFactor, int& nPattern) const override ;
// TextureData
bool SetTextureName( const std::string& sTxrName) override ;
bool SetTextureFrame( const Frame3d& frTxrRef) override ;
bool RemoveTextureData( void) override ;
bool GetTextureName( std::string& sTxrName) const override ;
bool GetTextureFrame( Frame3d& frTxrRef) const override ;
// UserObj
bool SetUserObj( IUserObj* pUserObj) override ;
IUserObj* GetUserObj( void) override ;
const IUserObj* GetUserObj( void) const override ;
bool RemoveUserObj( void) override ;
public :
GdbIterator( IGeomDB* pGDB = nullptr) ;
void ResetCurrObjIfSame( GdbObj* pObj)
{ if ( m_pCurrObj == pObj)
m_pCurrObj = nullptr ; }
private :
GeomDB* m_pGDB ;
GdbObj* m_pCurrObj ;
} ;