My Project
Public Types | Public Member Functions | Public Attributes | List of all members
ParaEngine::CParameterBlock Class Reference

a list of CParameter{name, value} pairs of anything. More...

#include <ParameterBlock.h>

Public Types

typedef map< string, CParameter >::iterator ParamIterator
 

Public Member Functions

ParamIterator BeginIter ()
 
ParamIterator EndIter ()
 
bool IsEmpty ()
 
template<class t >
void SetParameter (const string &sName, const t &value)
 if there is already a parameter with the same name, it will be overridden. More...
 
bool AddParameter (const CParameter &p)
 add a new parameter to block. More...
 
CParameterGetParameter (const string &sName)
 get parameter by its name, NULL will be returned if parameter is not found. More...
 
void SetParamByStringValue (const char *sParamName, const char *sValue_)
 
void Clear ()
 
bool ApplyToEffect (CEffectFile *pEffectFile)
 apply to effect file. More...
 

Public Attributes

map< string, CParameterm_params
 

Detailed Description

a list of CParameter{name, value} pairs of anything.

usually used for DirectX effect parameter block. value can be integer, float, vector3, vector4, matrix, TextureEntity, etc. Current the effect parameters can be set via ParaParamBlock interface from the scripting interface. we offer three levels of effect parameters: per effect file, per asset file, per mesh object. Effect parameters are also applied in that order. e.g. per effect file affects all object rendering with the effect file; per asset file affects all objects that use the mesh asset file; per mesh object affects only the mesh object.

Member Function Documentation

§ AddParameter()

bool CParameterBlock::AddParameter ( const CParameter p)

add a new parameter to block.

if there is already a parameter with the same name, it will be overridden.

§ ApplyToEffect()

bool CParameterBlock::ApplyToEffect ( CEffectFile pEffectFile)

apply to effect file.

§ GetParameter()

CParameter* ParaEngine::CParameterBlock::GetParameter ( const string &  sName)
inline

get parameter by its name, NULL will be returned if parameter is not found.

§ SetParamByStringValue()

void CParameterBlock::SetParamByStringValue ( const char *  sParamName,
const char *  sValue_ 
)
Parameters
sParamNamethe name of the object to set
sValue_internal name or value string

§ SetParameter()

template<class t >
void ParaEngine::CParameterBlock::SetParameter ( const string &  sName,
const t &  value 
)
inline

if there is already a parameter with the same name, it will be overridden.


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