1b767fe58e
- in TriMesh migliorato lo smooth delle normali - in TriMesh aggiunta generazione per rivoluzione - migliorati gestione e aggiornamento materiali.
60 lines
1.9 KiB
C++
60 lines
1.9 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 <vector>
|
|
|
|
class NgeWriter ;
|
|
class NgeReader ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class GdbMaterialMgr
|
|
{
|
|
public :
|
|
GdbMaterialMgr( void) ;
|
|
bool Clear( void) ;
|
|
bool Save( NgeWriter& ngeOut) const ;
|
|
bool Load( NgeReader& ngeIn) ;
|
|
int AddMaterial( const std::string& sName, const Material& matM) ;
|
|
bool EraseMaterial( int nId) ;
|
|
int FindMaterial( const std::string& sName) const ;
|
|
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 ;
|
|
} ;
|