2e4b67f9e9
- aggiunte GetNfeFontDir e GetDefaultFont - modifiche a Set di ExtText - migliorata gestione materiali - GeomDB::Load ora può funzionare aggiungendo a DB già carico per Insert.
62 lines
2.1 KiB
C++
62 lines
2.1 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : GdbMaterialMgr.h Data : 24.04.14 Versione : 1.5d7
|
|
// Contenuto : Dichiarazione della classe gestore materiali in GeomDB.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 24.04.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "Material.h"
|
|
#include "/EgtDev/Include/EGkGdbConst.h"
|
|
#include "/EgtDev/Include/EgtNumCollection.h"
|
|
|
|
class NgeWriter ;
|
|
class NgeReader ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class GdbMaterialMgr
|
|
{
|
|
public :
|
|
GdbMaterialMgr( void) ;
|
|
bool Clear( void) ;
|
|
bool Save( NgeWriter& ngeOut) const ;
|
|
bool Load( NgeReader& ngeIn, INTVECTOR& vBaseMatId) ;
|
|
int AddMaterial( const std::string& sName, const Material& matM, bool bLoad = false) ;
|
|
bool EraseMaterial( int nId) ;
|
|
int FindMaterial( const std::string& sName) const ;
|
|
int GetMaxStdMaterialId( void) const
|
|
{ return m_nStdNum ; }
|
|
int GetMaxMaterialId( void) const
|
|
{ return int( m_GdbMats.size()) ; }
|
|
bool ExistsMaterial( int nId) const
|
|
{ return ( nId > GDB_MT_NULL && nId <= int( m_GdbMats.size()) && ! m_GdbMats[nId-1].sName.empty()) ; }
|
|
bool GetMaterialData( int nId, Material& matM) const ;
|
|
bool GetMaterialName( int nId, std::string& sName) const ;
|
|
bool IsCustomMaterial( int nId, bool& bCustom) const ;
|
|
bool ModifyMaterialData( int nId, const Material& matM) ;
|
|
bool ModifyMaterialName( int nId, const std::string& sName) ;
|
|
|
|
private :
|
|
int FindFirstErased( void) const ;
|
|
|
|
private :
|
|
class GdbMaterial
|
|
{
|
|
public :
|
|
std::string sName ;
|
|
Material matM ;
|
|
} ;
|
|
typedef std::vector< GdbMaterial> GDBMAT_VECTOR ;
|
|
|
|
private :
|
|
int m_nStdNum ;
|
|
GDBMAT_VECTOR m_GdbMats ;
|
|
} ;
|