Castor3D 0.16.0
Multiplatform 3D engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
castor3d::LightingModelFactory Class Reference

#include <LightingModelFactory.hpp>

Classes

struct  Entry
 

Public Types

using Obj = shader::LightingModel
 
using Key = castor::String
 
using Id = LightingModelID
 
using PtrType = shader::LightingModelUPtr
 
using Creator = shader::LightingModelCreator
 
using ObjPtr = PtrType
 
using ObjCont = castor::Vector< Entry >
 

Public Member Functions

C3D_API LightingModelID registerType (Key const &key, BackgroundModelID backgroundModelId, Creator create)
 Registers an object type.
 
C3D_API void unregisterType (Key const &key, BackgroundModelID backgroundModelId)
 Unregisters an object type.
 
C3D_API void unregisterType (LightingModelID lightingModelId, BackgroundModelID backgroundModelId)
 Unregisters an object type.
 
C3D_API Id getNameId (Key const &key) const
 
C3D_API Key getIdName (Id const &id) const
 
C3D_API castor::Vector< LightingModelIDgetLightingModelsID () const
 
C3D_API castor::Vector< LightingModelIDgetLightingModelsID (BackgroundModelID backgroundModelId) const
 
template<typename ... Parameters>
ObjPtr create (LightingModelID lightingModelId, BackgroundModelID backgroundModelId, Parameters &&... params) const
 Creates an object from an ID.
 

Static Public Member Functions

static C3D_API castor::String normaliseName (castor::String name)
 Replaces old names with registered ones.
 

Member Typedef Documentation

◆ Creator

◆ Id

◆ Key

◆ Obj

◆ ObjCont

◆ ObjPtr

◆ PtrType

using castor3d::LightingModelFactory::PtrType = shader::LightingModelUPtr

Member Function Documentation

◆ create()

template<typename ... Parameters>
ObjPtr castor3d::LightingModelFactory::create ( LightingModelID lightingModelId,
BackgroundModelID backgroundModelId,
Parameters &&... params ) const
inline

Creates an object from an ID.

Parameters
[in]lightingModelIdThe lighting model ID.
[in]backgroundModelIdThe background model ID.
[in]paramsThe creation parameters.
Returns
The created object.

References CU_Exception, and castor::ERROR_UNKNOWN_OBJECT.

◆ getIdName()

C3D_API Key castor3d::LightingModelFactory::getIdName ( Id const & id) const
Parameters
[in]idThe object type ID.
Returns
The object type.

◆ getLightingModelsID() [1/2]

C3D_API castor::Vector< LightingModelID > castor3d::LightingModelFactory::getLightingModelsID ( ) const
Returns
The unique lighting models IDs.

◆ getLightingModelsID() [2/2]

C3D_API castor::Vector< LightingModelID > castor3d::LightingModelFactory::getLightingModelsID ( BackgroundModelID backgroundModelId) const
Parameters
[in]backgroundModelIdThe background model ID.
Returns
The lighting models for given background model.

◆ getNameId()

C3D_API Id castor3d::LightingModelFactory::getNameId ( Key const & key) const
Parameters
[in]keyThe object type.
Returns
The object type ID.

◆ normaliseName()

static C3D_API castor::String castor3d::LightingModelFactory::normaliseName ( castor::String name)
static

Replaces old names with registered ones.

◆ registerType()

C3D_API LightingModelID castor3d::LightingModelFactory::registerType ( Key const & key,
BackgroundModelID backgroundModelId,
Creator create )

Registers an object type.

Parameters
[in]keyThe object type.
[in]backgroundModelIdThe background model ID.
[in]createThe object creation function.

◆ unregisterType() [1/2]

C3D_API void castor3d::LightingModelFactory::unregisterType ( Key const & key,
BackgroundModelID backgroundModelId )

Unregisters an object type.

Parameters
[in]keyThe object type.
[in]backgroundModelIdThe background model ID.

◆ unregisterType() [2/2]

C3D_API void castor3d::LightingModelFactory::unregisterType ( LightingModelID lightingModelId,
BackgroundModelID backgroundModelId )

Unregisters an object type.

Parameters
[in]lightingModelIdThe lighting model ID.
[in]backgroundModelIdThe background model ID.

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