00f5e38f61
- aggiornamento prototipi e costanti (per Mark).
218 lines
14 KiB
C++
218 lines
14 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2023
|
|
//----------------------------------------------------------------------------
|
|
// File : EGkGeomDB.h Data : 09.07.23 Versione : 2.5g1
|
|
// Contenuto : Dichiarazione della interfaccia IGeomDB.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 24.11.13 DS Creazione modulo.
|
|
// 26.04.14 DS Agg. gestione libreria materiali.
|
|
// 21.05.14 DS Agg. GotoFirst/Next/Last/Prev.
|
|
// 30.05.14 DS Agg. metodi di Shear.
|
|
// 03.12.14 DS Aggiunta gestione riferimento di griglia.
|
|
// 29.01.23 DS Aggiunta GetAllInfo.
|
|
// 09.07.23 DS Aggiunte DumpStipple, SetStipple e GetStipple.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkGdbConst.h"
|
|
#include "/EgtDev/Include/EGkGeoFrame3d.h"
|
|
#include "/EgtDev/Include/EGkGeoObj.h"
|
|
#include "/EgtDev/Include/EGkMaterial.h"
|
|
#include "/EgtDev/Include/EGkUserObj.h"
|
|
#include "/EgtDev/Include/EgtNumCollection.h"
|
|
#include "/EgtDev/Include/EgtStringBase.h"
|
|
#include "/EgtDev/Include/EgtILogger.h"
|
|
#include <string>
|
|
|
|
//----------------------- Macro per import/export ----------------------------
|
|
#undef EGK_EXPORT
|
|
#if defined( I_AM_EGK) // da definirsi solo nella DLL
|
|
#define EGK_EXPORT __declspec( dllexport)
|
|
#else
|
|
#define EGK_EXPORT __declspec( dllimport)
|
|
#endif
|
|
|
|
//-----------------------------------------------------------------------------
|
|
class __declspec( novtable) IGeomDB
|
|
{
|
|
public :
|
|
virtual ~IGeomDB( void) {}
|
|
virtual bool Init( void) = 0 ;
|
|
virtual bool Clear( void) = 0 ;
|
|
virtual bool Load( const std::string& sFileIn, int nGroupId = GDB_ID_ROOT) = 0 ;
|
|
virtual bool Save( int nId, const std::string& sFileOut, int nFlag = GDB_SV_BIN) const = 0 ;
|
|
virtual bool Save( const INTVECTOR& vId, const std::string& sFileOut, int nFlag = GDB_SV_BIN) const = 0 ;
|
|
virtual bool ExistsObj( int nId) const = 0 ;
|
|
virtual int AddGroup( int nId, int nParentId, const Frame3d& frFrame) = 0 ;
|
|
virtual int InsertGroup( int nId, int nRefId, int nSonBeforeAfter, const Frame3d& frFrame) = 0 ;
|
|
virtual int AddGeoObj( int nId, int nParentId, IGeoObj* pGeoObj) = 0 ;
|
|
virtual int InsertGeoObj( int nId, int nRefId, int nSonBeforeAfter, IGeoObj* pGeoObj) = 0 ;
|
|
virtual bool ReplaceGeoObj( int nId, IGeoObj* pGeoObj) = 0 ;
|
|
virtual int GetFirstInGroup( int nIdGroup) const = 0 ;
|
|
virtual int GetNext( int nId) const = 0 ;
|
|
virtual int GetLastInGroup( int nIdGroup) const = 0 ;
|
|
virtual int GetPrev( int nId) const = 0 ;
|
|
virtual int GetFirstNameInGroup( int nGroupId, const std::string& sName) const = 0 ;
|
|
virtual int GetNextName( int nId, const std::string& sName) const = 0 ;
|
|
virtual int GetLastNameInGroup( int nGroupId, const std::string& sName) const = 0 ;
|
|
virtual int GetPrevName( int nId, const std::string& sName) const = 0 ;
|
|
virtual int GetFirstGroupInGroup( int nIdGroup) const = 0 ;
|
|
virtual int GetNextGroup( int nId) const = 0 ;
|
|
virtual int GetLastGroupInGroup( int nIdGroup) const = 0 ;
|
|
virtual int GetPrevGroup( int nId) const = 0 ;
|
|
virtual int GetGdbType( int nId) const = 0 ;
|
|
virtual int GetGeoType( int nId) const = 0 ;
|
|
virtual IGeoObj* GetGeoObj( int nId) = 0 ;
|
|
virtual const IGeoObj* GetGeoObj( int nId) const = 0 ;
|
|
virtual Frame3d* GetGroupFrame( int nId) = 0 ;
|
|
virtual const Frame3d* GetGroupFrame( int nId) const = 0 ;
|
|
virtual bool GetGroupFrame( int nId, Frame3d& frGrp) const = 0 ;
|
|
virtual bool GetGroupGlobFrame( int nId, Frame3d& frGlob) const = 0 ;
|
|
virtual int GetGroupObjs( int nId) const = 0 ;
|
|
virtual int GetParentId( int nId) const = 0 ;
|
|
virtual bool GetGlobFrame( int nId, Frame3d& frGlob) const = 0 ;
|
|
virtual bool GetLocalBBox( int nId, BBox3d& b3Loc, int nFlag = BBF_STANDARD) const = 0 ;
|
|
virtual bool GetGlobalBBox( int nId, BBox3d& b3Glob, int nFlag = BBF_STANDARD) const = 0 ;
|
|
virtual bool GetRefBBox( int nId, const Frame3d& frRef, BBox3d& b3Ref, int nFlag = BBF_STANDARD) const = 0 ;
|
|
virtual int Copy( int nIdSou, int nIdDest, int nRefId, int nSonBeforeAfter = GDB_LAST_SON) = 0 ;
|
|
virtual int CopyGlob( int nIdSou, int nIdDest, int nRefId, int nSonBeforeAfter = GDB_LAST_SON) = 0 ;
|
|
virtual bool Relocate( int nId, int nRefId, int nSonBeforeAfter = GDB_LAST_SON) = 0 ;
|
|
virtual bool RelocateGlob( int nId, int nRefId, int nSonBeforeAfter = GDB_LAST_SON) = 0 ;
|
|
virtual bool GroupSwap( int nId1, int nId2, bool bSwapRef, bool bMark = false) = 0 ;
|
|
virtual int GetNewId( void) const = 0 ;
|
|
virtual bool ChangeId( int nId, int nNewId) = 0 ;
|
|
virtual bool Erase( int nId) = 0 ;
|
|
virtual IGeoObj* RemoveGeoObjAndErase( int nId) = 0 ;
|
|
virtual bool EmptyGroup( int nId) = 0 ;
|
|
// Transformations
|
|
virtual bool Translate( int nId, const Vector3d& vtMove) = 0 ;
|
|
virtual bool TranslateGlob( int nId, const Vector3d& vtMove) = 0 ;
|
|
virtual bool TranslateGroup( int nId, const Vector3d& vtMove) = 0 ;
|
|
virtual bool Rotate( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) = 0 ;
|
|
virtual bool RotateGlob( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) = 0 ;
|
|
virtual bool RotateGroup( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) = 0 ;
|
|
virtual bool Rotate( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) = 0 ;
|
|
virtual bool RotateGlob( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) = 0 ;
|
|
virtual bool RotateGroup( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) = 0 ;
|
|
virtual bool Scale( int nId, const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ;
|
|
virtual bool ScaleGlob( int nId, const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ;
|
|
virtual bool ScaleGroup( int nId, const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ;
|
|
virtual bool Mirror( int nId, const Point3d& ptOn, const Vector3d& vtNorm) = 0 ;
|
|
virtual bool MirrorGlob( int nId, const Point3d& ptOn, const Vector3d& vtNorm) = 0 ;
|
|
virtual bool MirrorGroup( int nId, const Point3d& ptOn, const Vector3d& vtNorm) = 0 ;
|
|
virtual bool Shear( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ;
|
|
virtual bool ShearGlob( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ;
|
|
virtual bool ShearGroup( int nId, const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) = 0 ;
|
|
// Selection
|
|
virtual bool SelectObj( int nId, bool bOnlyIfVisible = false) = 0 ;
|
|
virtual bool DeselectObj( int nId) = 0 ;
|
|
virtual bool SelectGroupObjs( int nId, int nFilter = 0, bool bOnlyIfVisible = false) = 0 ;
|
|
virtual bool DeselectGroupObjs( int nId) = 0 ;
|
|
virtual bool IsSelectedObj( int nId) const = 0 ;
|
|
virtual int GetSelectedObjNbr( void) const = 0 ;
|
|
virtual int GetFirstSelectedObj( void) const = 0 ;
|
|
virtual int GetNextSelectedObj( void) const = 0 ;
|
|
virtual int GetLastSelectedObj( void) const = 0 ;
|
|
virtual int GetPrevSelectedObj( void) const = 0 ;
|
|
virtual bool ClearSelection( void) = 0 ;
|
|
// Attributes
|
|
virtual bool DumpAttributes( int nId, std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const = 0 ;
|
|
virtual bool CopyAttributes( int nIdSou, int nIdDest) = 0 ;
|
|
virtual bool SetLevel( int nId, int nLevel) = 0 ;
|
|
virtual bool RevertLevel( int nId) = 0 ;
|
|
virtual bool GetLevel( int nId, int& nLevel) const = 0 ;
|
|
virtual bool GetCalcLevel( int nId, int& nLevel) const = 0 ;
|
|
virtual bool SetMode( int nId, int nMode) = 0 ;
|
|
virtual bool RevertMode( int nId) = 0 ;
|
|
virtual bool GetMode( int nId, int& nMode) const = 0 ;
|
|
virtual bool GetCalcMode( int nId, int& nMode) const = 0 ;
|
|
virtual bool SetStatus( int nId, int nStat) = 0 ;
|
|
virtual bool RevertStatus( int nId) = 0 ;
|
|
virtual bool GetStatus( int nId, int& nStat) const = 0 ;
|
|
virtual bool GetCalcStatus( int nId, int& nStat) const = 0 ;
|
|
virtual bool SetMark( int nId, int nMark = GDB_MK_ON) = 0 ;
|
|
virtual bool ResetMark( int nId) = 0 ;
|
|
virtual bool GetMark( int nId, int& nMark) const = 0 ;
|
|
virtual bool GetCalcMark( int nId, int& nMark) const = 0 ;
|
|
virtual bool CopyMaterial( int nIdSou, int nIdDest) = 0 ;
|
|
virtual bool SetDefaultMaterial( Color cCol) = 0 ;
|
|
virtual bool GetDefaultMaterial( Color& cCol) const = 0 ;
|
|
virtual bool SetMaterial( int nId, int nMat) = 0 ;
|
|
virtual bool SetMaterial( int nId, const std::string& sMatName) = 0 ;
|
|
virtual bool SetMaterial( int nId, Color cCol) = 0 ;
|
|
virtual bool GetMaterial( int nId, int& nMat) const = 0 ;
|
|
virtual bool GetMaterial( int nId, Material& mMat) const = 0 ;
|
|
virtual bool GetMaterial( int nId, Color& cCol) const = 0 ;
|
|
virtual bool GetCalcMaterial( int nId, int& nMat) const = 0 ;
|
|
virtual bool GetCalcMaterial( int nId, Material& mMat) const = 0 ;
|
|
virtual bool GetCalcMaterial( int nId, Color& cCol) const = 0 ;
|
|
virtual bool SetName( int nId, const std::string& sName) = 0 ;
|
|
virtual bool GetName( int nId, std::string& sName) const = 0 ;
|
|
virtual bool ExistsName( int nId) const = 0 ;
|
|
virtual bool RemoveName( int nId) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const std::string& sInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, bool bInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, int nInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, double dInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const Point3d& ptInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const Vector3d& vtInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const BBox3d& b3Info) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const Frame3d& frInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const INTVECTOR& vnInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const DBLVECTOR& vdInfo) = 0 ;
|
|
virtual bool SetInfo( int nId, const std::string& sKey, const STRVECTOR& vsInfo) = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, std::string& sInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, bool& bInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, int& nInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, double& dInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, Point3d& ptInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, Vector3d& vtInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, BBox3d& b3Info) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, Frame3d& frInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, INTVECTOR& vnInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, DBLVECTOR& vdInfo) const = 0 ;
|
|
virtual bool GetInfo( int nId, const std::string& sKey, STRVECTOR& vsInfo) const = 0 ;
|
|
virtual bool ExistsInfo( int nId, const std::string& sKey) const = 0 ;
|
|
virtual bool RemoveInfo( int nId, const std::string& sKey) = 0 ;
|
|
virtual bool GetAllInfo( int nId, STRVECTOR& vsInfo) const = 0 ;
|
|
virtual bool CopyAllInfoFrom( int nId, int nSouId) = 0 ;
|
|
// Stipple (significativo solo per curve)
|
|
virtual bool DumpStipple( int nId, std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const = 0 ;
|
|
virtual bool SetStipple( int nId, int nFactor, int nPattern) = 0 ;
|
|
virtual bool GetStipple( int nId, int& nFactor, int& nPattern) const = 0 ;
|
|
// TextureData
|
|
virtual bool DumpTextureData( int nId, std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const = 0 ;
|
|
virtual bool SetTextureName( int nId, const std::string& sTxrName) = 0 ;
|
|
virtual bool SetTextureFrame( int nId, const Frame3d& frTxrRef) = 0 ;
|
|
virtual bool RemoveTextureData( int nId) = 0 ;
|
|
virtual bool GetTextureName( int nId, std::string& sTxrName) const = 0 ;
|
|
virtual bool GetTextureFrame( int nId, Frame3d& frTxrRef) const = 0 ;
|
|
// UserObj
|
|
virtual bool SetUserObj( int nId, IUserObj* pUserObj) = 0 ;
|
|
virtual IUserObj* GetUserObj( int nId) = 0 ;
|
|
virtual const IUserObj* GetUserObj( int nId) const = 0 ;
|
|
virtual bool DumpUserObj( int nId, std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const = 0 ;
|
|
virtual bool CopyUserObj( int nIdSou, int nIdDest) = 0 ;
|
|
virtual bool RemoveUserObj( int nId) = 0 ;
|
|
// Material library
|
|
virtual int AddMaterial( const std::string& sName, const Material& matM) = 0 ;
|
|
virtual int FindMaterial( const std::string& sName) const = 0 ;
|
|
virtual bool EraseMaterial( int nMat, bool& bInUse) = 0 ;
|
|
virtual bool GetMaterialData( int nMat, Material& matM) const = 0 ;
|
|
virtual bool GetMaterialName( int nMat, std::string& sName) const = 0 ;
|
|
virtual int GetMaxMaterialId( void) const = 0 ;
|
|
virtual bool ExistsMaterial( int nMat) const = 0 ;
|
|
virtual bool IsCustomMaterial( int nMat, bool& bCustom) const = 0 ;
|
|
virtual bool ModifyMaterialData( int nMat, const Material& matM) = 0 ;
|
|
virtual bool ModifyMaterialName( int nMat, const std::string& sName) = 0 ;
|
|
// Grid
|
|
virtual bool SetGridFrame( const Frame3d& frFrame) = 0 ;
|
|
virtual const Frame3d& GetGridFrame( void) = 0 ;
|
|
} ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
EGK_EXPORT IGeomDB* CreateGeomDB( void) ; |