PixelLightAPI  .
Public Member Functions | Public Attributes
PLRenderer::ParameterManager Class Reference

Parameter manager. More...

#include <ParameterManager.h>

Inheritance diagram for PLRenderer::ParameterManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

RendererContextGetRendererContext () const
 Returns the owner renderer context.
PLCore::uint32 GetNumOfParameters () const
 Gets the number of parameters.
PLRENDERER_API ParameterCreateParameter (EDataType nType, const PLCore::String &sName)
 Creates a new parameter.
ParameterGetParameter (PLCore::uint32 nIndex) const
 Gets a parameter by index.
ParameterGetParameter (const PLCore::String &sName) const
 Gets a parameter by name.
PLRENDERER_API bool AddParametersToXMLElement (PLCore::XmlElement &cElement) const
 Add all parameters to a given XML element.
PLRENDERER_API bool AddParameterFromXMLElement (const PLCore::XmlElement &cElement)
 Adds a parameter from a given XML element.
PLRENDERER_API bool RemoveParameter (PLCore::uint32 nIndex)
 Removes a parameter by index.
PLRENDERER_API bool RemoveParameter (const PLCore::String &sName)
 Removes a parameter by name.
PLRENDERER_API void RemoveAllParameters ()
 Removes all parameters.
virtual PLRENDERER_API bool ReloadTextures () const
 Reloads all textures.
virtual PLRENDERER_API void OnParameterChange (Parameter &cParameter) const
 Called when a parameter has been changed (created, destroyed, value changed)
virtual PLRENDERER_API bool IsParameter (const PLCore::String &sName) const override
 Returns whether there's a valid parameter with the given name or not.
virtual PLRENDERER_API
PLCore::String 
GetParameterString (const PLCore::String &sName) const override
 Returns a parameter value as string (e.g. "1.0 5.4 0.21")
virtual PLRENDERER_API bool SetParameterString (const PLCore::String &sName, const PLCore::String &sValue) override
 Sets a parameter value from a string (e.g. "1.0 5.4 0.21")
virtual PLRENDERER_API bool GetParameter1i (const PLCore::String &sName, int &nX) const override
virtual PLRENDERER_API bool SetParameter1i (const PLCore::String &sName, int nX) override
virtual PLRENDERER_API bool GetParameter2i (const PLCore::String &sName, int &nX, int &nY) const override
virtual PLRENDERER_API bool GetParameter2iv (const PLCore::String &sName, int nValue[]) const override
virtual PLRENDERER_API bool SetParameter2i (const PLCore::String &sName, int nX, int nY) override
virtual PLRENDERER_API bool SetParameter2iv (const PLCore::String &sName, const int nValue[]) override
virtual PLRENDERER_API bool GetParameter3i (const PLCore::String &sName, int &nX, int &nY, int &nZ) const override
virtual PLRENDERER_API bool GetParameter3iv (const PLCore::String &sName, int nValue[]) const override
virtual PLRENDERER_API bool SetParameter3i (const PLCore::String &sName, int nX, int nY, int nZ) override
virtual PLRENDERER_API bool SetParameter3iv (const PLCore::String &sName, const int nValue[]) override
virtual PLRENDERER_API bool GetParameter4i (const PLCore::String &sName, int &nX, int &nY, int &nZ, int &nW) const override
virtual PLRENDERER_API bool GetParameter4iv (const PLCore::String &sName, int nValue[]) const override
virtual PLRENDERER_API bool SetParameter4i (const PLCore::String &sName, int nX, int nY, int nZ, int nW) override
virtual PLRENDERER_API bool SetParameter4iv (const PLCore::String &sName, const int nValue[]) override
virtual PLRENDERER_API bool GetParameter1f (const PLCore::String &sName, float &fX) const override
virtual PLRENDERER_API bool SetParameter1f (const PLCore::String &sName, float fX) override
virtual PLRENDERER_API bool GetParameter2f (const PLCore::String &sName, float &fX, float &fY) const override
virtual PLRENDERER_API bool GetParameter2fv (const PLCore::String &sName, float fValue[]) const override
virtual PLRENDERER_API bool SetParameter2f (const PLCore::String &sName, float fX, float fY) override
virtual PLRENDERER_API bool SetParameter2fv (const PLCore::String &sName, const float fValue[]) override
virtual PLRENDERER_API bool GetParameter3f (const PLCore::String &sName, float &fX, float &fY, float &fZ) const override
virtual PLRENDERER_API bool GetParameter3fv (const PLCore::String &sName, float fValue[]) const override
virtual PLRENDERER_API bool SetParameter3f (const PLCore::String &sName, float fX, float fY, float fZ) override
virtual PLRENDERER_API bool SetParameter3fv (const PLCore::String &sName, const float fValue[]) override
virtual PLRENDERER_API bool GetParameter4f (const PLCore::String &sName, float &fX, float &fY, float &fZ, float &fW) const override
virtual PLRENDERER_API bool GetParameter4fv (const PLCore::String &sName, float fValue[]) const override
virtual PLRENDERER_API bool SetParameter4f (const PLCore::String &sName, float fX, float fY, float fZ, float fW) override
virtual PLRENDERER_API bool SetParameter4fv (const PLCore::String &sName, const float fValue[]) override
virtual PLRENDERER_API bool GetParameter1d (const PLCore::String &sName, double &fX) const override
virtual PLRENDERER_API bool SetParameter1d (const PLCore::String &sName, double fX) override
virtual PLRENDERER_API bool GetParameter2d (const PLCore::String &sName, double &fX, double &fY) const override
virtual PLRENDERER_API bool GetParameter2dv (const PLCore::String &sName, double fValue[]) const override
virtual PLRENDERER_API bool SetParameter2d (const PLCore::String &sName, double fX, double fY) override
virtual PLRENDERER_API bool SetParameter2dv (const PLCore::String &sName, const double fValue[]) override
virtual PLRENDERER_API bool GetParameter3d (const PLCore::String &sName, double &fX, double &fY, double &fZ) const override
virtual PLRENDERER_API bool GetParameter3dv (const PLCore::String &sName, double fValue[]) const override
virtual PLRENDERER_API bool SetParameter3d (const PLCore::String &sName, double fX, double fY, double fZ) override
virtual PLRENDERER_API bool SetParameter3dv (const PLCore::String &sName, const double fValue[]) override
virtual PLRENDERER_API bool GetParameter4d (const PLCore::String &sName, double &fX, double &fY, double &fZ, double &fW) const override
virtual PLRENDERER_API bool GetParameter4dv (const PLCore::String &sName, double fValue[]) const override
virtual PLRENDERER_API bool SetParameter4d (const PLCore::String &sName, double fX, double fY, double fZ, double fW) override
virtual PLRENDERER_API bool SetParameter4dv (const PLCore::String &sName, const double fValue[]) override
virtual PLRENDERER_API bool GetParameterFloat3x3 (const PLCore::String &sName, float fValue[]) const override
virtual PLRENDERER_API bool SetParameterFloat3x3 (const PLCore::String &sName, const float fValue[]) override
virtual PLRENDERER_API bool GetParameterFloat3x4 (const PLCore::String &sName, float fValue[]) const override
virtual PLRENDERER_API bool SetParameterFloat3x4 (const PLCore::String &sName, const float fValue[]) override
virtual PLRENDERER_API bool GetParameterMatrixfv (const PLCore::String &sName, float fValue[]) const override
virtual PLRENDERER_API bool SetParameterMatrixfv (const PLCore::String &sName, const float fValue[]) override
virtual PLRENDERER_API bool GetParameterMatrixdv (const PLCore::String &sName, double fValue[]) const override
virtual PLRENDERER_API bool SetParameterMatrixdv (const PLCore::String &sName, const double fValue[]) override
virtual PLRENDERER_API
PLRenderer::TextureBuffer
GetParameterTextureBuffer (const PLCore::String &sName) const override
 Returns the texture buffer of the parameter.
virtual PLRENDERER_API int SetParameterTextureBuffer (const PLCore::String &sName, PLRenderer::TextureBuffer *pTextureBuffer) override
 Sets the texture buffer of the parameter.
virtual PLRENDERER_API
PLRenderer::Texture
GetParameterTexture (const PLCore::String &sName) const override
 Returns the texture of the parameter.
virtual PLRENDERER_API int SetParameterTexture (const PLCore::String &sName, const PLCore::String &sFilename) override
 Sets the texture of the parameter.
virtual PLRENDERER_API int SetParameterTexture (const PLCore::String &sName, PLRenderer::Texture *pTexture) override
 Sets the texture of the parameter.

Public Attributes

PLCore::Event< Parameter & > EventParameterChanged

Detailed Description

Parameter manager.

Remarks:
The implementation of the 'SetParameter()' functions automatically create 'missing' parameters, if you don't want this, use for example 'IsParameter()' before calling 'SetParameter()'.

Member Function Documentation

Returns the owner renderer context.

Returns:
Reference to the owner renderer context
PLCore::uint32 PLRenderer::ParameterManager::GetNumOfParameters ( ) const [inline]

Gets the number of parameters.

Returns:
Number of parameters
PLRENDERER_API Parameter* PLRenderer::ParameterManager::CreateParameter ( EDataType  nType,
const PLCore::String sName 
)

Creates a new parameter.

Parameters:
[in]nTypeType of the new parameter, NEVER UnknownDataType!
[in]sNameName of the new parameter, if there's already a parameter with this name this parameter is returned instead creating a new one
Returns:
The created parameter, a null pointer on error (maybe unknown data type?)
Parameter * PLRenderer::ParameterManager::GetParameter ( PLCore::uint32  nIndex) const [inline]

Gets a parameter by index.

Parameters:
[in]nIndexParameter index
Returns:
The requested parameter, a null pointer on error

Gets a parameter by name.

Parameters:
[in]sNameParameter name
Returns:
The requested parameter, a null pointer on error

Add all parameters to a given XML element.

Parameters:
[out]cElementXML element were the parameters should be added
Returns:
'true' if all went fine, else 'false' (maybe invalid XML element)

Adds a parameter from a given XML element.

Parameters:
[in]cElementXML element were the parameter should be added from
Returns:
'true' if all went fine, else 'false' (maybe invalid XML element or it's no known parameter type or no parameter name given)
Note:
  • If there's already a parameter with this name, this parameter to add is ignored (returns false)
PLRENDERER_API bool PLRenderer::ParameterManager::RemoveParameter ( PLCore::uint32  nIndex)

Removes a parameter by index.

Parameters:
[in]nIndexIndex of the parameter name to remove
Returns:
'true' if all went fine and the parameter was removed, else 'false' (maybe unknown parameter?)
PLRENDERER_API bool PLRenderer::ParameterManager::RemoveParameter ( const PLCore::String sName)

Removes a parameter by name.

Parameters:
[in]sNameName of the parameter name to remove
Returns:
'true' if all went fine and the parameter was removed, else 'false' (maybe unknown parameter?)

Removes all parameters.

virtual PLRENDERER_API bool PLRenderer::ParameterManager::ReloadTextures ( ) const [virtual]

Reloads all textures.

Returns:
'true' if all went fine, else 'false'
virtual PLRENDERER_API void PLRenderer::ParameterManager::OnParameterChange ( Parameter cParameter) const [virtual]

Called when a parameter has been changed (created, destroyed, value changed)

Parameters:
[in]cParameterChanged parameter
Note:
  • The default implementation just emits the "EventParameterChanged"-event
virtual PLRENDERER_API bool PLRenderer::ParameterManager::IsParameter ( const PLCore::String sName) const [override, virtual]

Returns whether there's a valid parameter with the given name or not.

Parameters:
[in]sNameName of the parameter to check
Returns:
'true' if there's a valid parameter with the given name, else 'false'

Implements PLRenderer::Parameters.

virtual PLRENDERER_API PLCore::String PLRenderer::ParameterManager::GetParameterString ( const PLCore::String sName) const [override, virtual]

Returns a parameter value as string (e.g. "1.0 5.4 0.21")

param[in] sName Name of the parameter to return the value from

Returns:
The value of the parameter as string, empty string on error

Implements PLRenderer::Parameters.

virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameterString ( const PLCore::String sName,
const PLCore::String sValue 
) [override, virtual]

Sets a parameter value from a string (e.g. "1.0 5.4 0.21")

param[in] sName Name of the parameter to set param[in] sValue New parameter value

Returns:
'true' if all went fine, else 'false' (maybe unknown parameter)

Implements PLRenderer::Parameters.

virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter1i ( const PLCore::String sName,
int &  nX 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter1i ( const PLCore::String sName,
int  nX 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter2i ( const PLCore::String sName,
int &  nX,
int &  nY 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter2iv ( const PLCore::String sName,
int  nValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter2i ( const PLCore::String sName,
int  nX,
int  nY 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter2iv ( const PLCore::String sName,
const int  nValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter3i ( const PLCore::String sName,
int &  nX,
int &  nY,
int &  nZ 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter3iv ( const PLCore::String sName,
int  nValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter3i ( const PLCore::String sName,
int  nX,
int  nY,
int  nZ 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter3iv ( const PLCore::String sName,
const int  nValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter4i ( const PLCore::String sName,
int &  nX,
int &  nY,
int &  nZ,
int &  nW 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter4iv ( const PLCore::String sName,
int  nValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter4i ( const PLCore::String sName,
int  nX,
int  nY,
int  nZ,
int  nW 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter4iv ( const PLCore::String sName,
const int  nValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter1f ( const PLCore::String sName,
float &  fX 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter1f ( const PLCore::String sName,
float  fX 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter2f ( const PLCore::String sName,
float &  fX,
float &  fY 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter2fv ( const PLCore::String sName,
float  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter2f ( const PLCore::String sName,
float  fX,
float  fY 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter2fv ( const PLCore::String sName,
const float  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter3f ( const PLCore::String sName,
float &  fX,
float &  fY,
float &  fZ 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter3fv ( const PLCore::String sName,
float  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter3f ( const PLCore::String sName,
float  fX,
float  fY,
float  fZ 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter3fv ( const PLCore::String sName,
const float  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter4f ( const PLCore::String sName,
float &  fX,
float &  fY,
float &  fZ,
float &  fW 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter4fv ( const PLCore::String sName,
float  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter4f ( const PLCore::String sName,
float  fX,
float  fY,
float  fZ,
float  fW 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter4fv ( const PLCore::String sName,
const float  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter1d ( const PLCore::String sName,
double &  fX 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter1d ( const PLCore::String sName,
double  fX 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter2d ( const PLCore::String sName,
double &  fX,
double &  fY 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter2dv ( const PLCore::String sName,
double  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter2d ( const PLCore::String sName,
double  fX,
double  fY 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter2dv ( const PLCore::String sName,
const double  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter3d ( const PLCore::String sName,
double &  fX,
double &  fY,
double &  fZ 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter3dv ( const PLCore::String sName,
double  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter3d ( const PLCore::String sName,
double  fX,
double  fY,
double  fZ 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter3dv ( const PLCore::String sName,
const double  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter4d ( const PLCore::String sName,
double &  fX,
double &  fY,
double &  fZ,
double &  fW 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameter4dv ( const PLCore::String sName,
double  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter4d ( const PLCore::String sName,
double  fX,
double  fY,
double  fZ,
double  fW 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameter4dv ( const PLCore::String sName,
const double  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameterFloat3x3 ( const PLCore::String sName,
float  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameterFloat3x3 ( const PLCore::String sName,
const float  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameterFloat3x4 ( const PLCore::String sName,
float  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameterFloat3x4 ( const PLCore::String sName,
const float  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameterMatrixfv ( const PLCore::String sName,
float  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameterMatrixfv ( const PLCore::String sName,
const float  fValue[] 
) [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::GetParameterMatrixdv ( const PLCore::String sName,
double  fValue[] 
) const [override, virtual]
virtual PLRENDERER_API bool PLRenderer::ParameterManager::SetParameterMatrixdv ( const PLCore::String sName,
const double  fValue[] 
) [override, virtual]
virtual PLRENDERER_API PLRenderer::TextureBuffer* PLRenderer::ParameterManager::GetParameterTextureBuffer ( const PLCore::String sName) const [override, virtual]

Returns the texture buffer of the parameter.

Returns:
The texture buffer of the parameter, can be a null pointer

Implements PLRenderer::Parameters.

virtual PLRENDERER_API int PLRenderer::ParameterManager::SetParameterTextureBuffer ( const PLCore::String sName,
PLRenderer::TextureBuffer pTextureBuffer 
) [override, virtual]

Sets the texture buffer of the parameter.

Parameters:
[in]sNameName of the parameter where to set the texture buffer
[in]pTextureBufferTexture buffer to set, can be a null pointer
Returns:
Texture stage the texture buffer was set to, < 0 on error

Implements PLRenderer::Parameters.

virtual PLRENDERER_API PLRenderer::Texture* PLRenderer::ParameterManager::GetParameterTexture ( const PLCore::String sName) const [override, virtual]

Returns the texture of the parameter.

Returns:
The texture of the parameter, can be a null pointer

Implements PLRenderer::Parameters.

virtual PLRENDERER_API int PLRenderer::ParameterManager::SetParameterTexture ( const PLCore::String sName,
const PLCore::String sFilename 
) [override, virtual]

Sets the texture of the parameter.

Parameters:
[in]sNameName of the parameter where to set the texture
[in]sFilenameTexture filename
Returns:
Texture stage the texture was set to, < 0 on error

Implements PLRenderer::Parameters.

virtual PLRENDERER_API int PLRenderer::ParameterManager::SetParameterTexture ( const PLCore::String sName,
PLRenderer::Texture pTexture 
) [override, virtual]

Sets the texture of the parameter.

Parameters:
[in]sNameName of the parameter where to set the texture
[in]pTextureTexture to set, can be a null pointer
Returns:
Texture stage the texture was set to, < 0 on error

Implements PLRenderer::Parameters.


Member Data Documentation

Parameter changed (created, destroyed, value changed) event, changed parameter as parameter


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:38
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported