Castor3D  ..
Public Member Functions | List of all members
Castor3D::MaterialManager Class Reference

Material collection, with additional functions. More...

+ Inheritance diagram for Castor3D::MaterialManager:
+ Collaboration diagram for Castor3D::MaterialManager:

Public Member Functions

C3D_API MaterialManager (Engine &p_engine)
 Constructor. More...
 
C3D_API ~MaterialManager ()
 Destructor. More...
 
C3D_API void Initialise ()
 Materials initialisation function. More...
 
C3D_API void Clear ()
 Deletes the default material, flush the collection. More...
 
C3D_API void GetNames (Castor::StringArray &p_names)
 Puts all the materials names in the given array. More...
 
C3D_API bool Write (Castor::TextFile &p_file) const
 Writes materials in a text file. More...
 
C3D_API bool Read (Castor::TextFile &p_file)
 Reads materials from a text file. More...
 
C3D_API bool Save (Castor::BinaryFile &p_file) const
 Writes materials in a binary file. More...
 
C3D_API bool Load (Castor::BinaryFile &p_file)
 Reads materials from a binary file. More...
 
MaterialSPtr GetDefaultMaterial () const
 Retrieves the default material. More...
 
- Public Member Functions inherited from Castor3D::Manager< Castor::String, Material, Engine, ResourceManagerEngineGetter >
void Cleanup ()
 Sets all the elements to be cleaned up. More...
 
void Clear ()
 Flushes the collection. More...
 
bool IsEmpty ()
 
void Insert (Castor::String const &p_name, std::shared_ptr< Material > p_element)
 Removes an object, given a name. More...
 
void Remove (Castor::String const &p_name)
 Removes an object, given a name. More...
 
void SetRenderSystem (RenderSystem *p_renderSystem)
 
RenderSystemSetRenderSystem () const
 
EngineGetEngine () const
 
Castor::String const & GetObjectTypeName () const
 
bool Has (Castor::String const &p_name) const
 
std::shared_ptr< MaterialFind (Castor::String const &p_name) const
 Looks for an element with given name. More...
 
void lock () const
 Locks the collection mutex. More...
 
void unlock () const
 Unlocks the collection mutex. More...
 
Collection::TObjPtrMapIt begin ()
 Returns an iterator to the first element of the collection. More...
 
Collection::TObjPtrMapConstIt begin () const
 Returns an constant iterator to the first element of the collection. More...
 
Collection::TObjPtrMapIt end ()
 Returns an iterator to the after last element of the collection. More...
 
Collection::TObjPtrMapConstIt end () const
 Returns an constant iterator to the after last element of the collection. More...
 
std::shared_ptr< MaterialCreate (Castor::String const &p_name, Parameters &&... p_params)
 Creates an object. More...
 

Additional Inherited Members

- Public Types inherited from Castor3D::Manager< Castor::String, Material, Engine, ResourceManagerEngineGetter >
typedef Castor::Collection< Material, Castor::String > Collection
 
- Protected Member Functions inherited from Castor3D::ResourceManager< Castor::String, Material >
 ResourceManager (Engine &p_owner)
 Constructor. More...
 
 ~ResourceManager ()
 Destructor. More...
 
- Protected Member Functions inherited from Castor3D::Manager< Castor::String, Material, Engine, ResourceManagerEngineGetter >
 Manager (Engine &p_owner)
 Constructor. More...
 
 ~Manager ()
 Destructor. More...
 
- Protected Attributes inherited from Castor3D::Manager< Castor::String, Material, Engine, ResourceManagerEngineGetter >
RenderSystemm_renderSystem
 The RenderSystem. More...
 
Collection m_elements
 The elements collection. More...
 

Detailed Description

Material collection, with additional functions.

Author
Sylvain DOREMUS
Date
09/02/2010
Version
0.1

Constructor & Destructor Documentation

◆ MaterialManager()

C3D_API Castor3D::MaterialManager::MaterialManager ( Engine p_engine)

Constructor.

Parameters
[in]p_engineThe engine.

◆ ~MaterialManager()

C3D_API Castor3D::MaterialManager::~MaterialManager ( )

Destructor.

Member Function Documentation

◆ Clear()

C3D_API void Castor3D::MaterialManager::Clear ( )

Deletes the default material, flush the collection.

◆ GetDefaultMaterial()

MaterialSPtr Castor3D::MaterialManager::GetDefaultMaterial ( ) const
inline

Retrieves the default material.

◆ GetNames()

C3D_API void Castor3D::MaterialManager::GetNames ( Castor::StringArray &  p_names)

Puts all the materials names in the given array.

Parameters
[out]p_namesThe array of names to be filled

◆ Initialise()

C3D_API void Castor3D::MaterialManager::Initialise ( )

Materials initialisation function.

Remarks
Intialises the default material, a renderer must have been loaded.

◆ Load()

C3D_API bool Castor3D::MaterialManager::Load ( Castor::BinaryFile &  p_file)

Reads materials from a binary file.

Parameters
[in]p_fileThe file
Returns
true if ok

◆ Read()

C3D_API bool Castor3D::MaterialManager::Read ( Castor::TextFile &  p_file)

Reads materials from a text file.

Parameters
[in]p_fileThe file
Returns
true if ok

◆ Save()

C3D_API bool Castor3D::MaterialManager::Save ( Castor::BinaryFile &  p_file) const

Writes materials in a binary file.

Parameters
[out]p_fileThe file
Returns
true if ok

◆ Write()

C3D_API bool Castor3D::MaterialManager::Write ( Castor::TextFile &  p_file) const

Writes materials in a text file.

Parameters
[out]p_fileThe file
Returns
true if ok

The documentation for this class was generated from the following file: