a902b4ceb7
- aggiornamento e aggiunta prototipi.
167 lines
10 KiB
C++
167 lines
10 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : EGkGeomDB.h Data : 30.05.14 Versione : 1.5e10
|
|
// 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.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#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/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) = 0 ;
|
|
virtual bool Save( 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 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 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 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_SON) = 0 ;
|
|
virtual int CopyGlob( int nIdSou, int nIdDest, int nRefId, int nSonBeforeAfter = GDB_SON) = 0 ;
|
|
virtual bool Relocate( int nId, int nRefId, int nSonBeforeAfter = GDB_SON) = 0 ;
|
|
virtual bool RelocateGlob( int nId, int nRefId, int nSonBeforeAfter = GDB_SON) = 0 ;
|
|
virtual bool Erase( int nId) = 0 ;
|
|
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, const char* szNewLine) 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) = 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 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 Frame3d& frInfo) = 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, Frame3d& frInfo) const = 0 ;
|
|
virtual bool ExistsInfo( int nId, const std::string& sKey) const = 0 ;
|
|
virtual bool RemoveInfo( int nId, const std::string& sKey) = 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 ;
|
|
} ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
EGK_EXPORT IGeomDB* CreateGeomDB( void) ; |