Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

RmShaderConstant Class Reference

Shader Constant. More...

#include <RmEffect.h>

Inheritance diagram for RmShaderConstant:

RmNode List of all members.

Public Member Functions

 RmShaderConstant ()
 Default Constructor.

 RmShaderConstant (const RM_TCHAR *strConstantName, const RM_TCHAR *strConstantType, int nRegister)
 Constructor.

 RmShaderConstant (RmNode *pNode, int nRegister)
 Constructor.

virtual ~RmShaderConstant ()
 Destructor.

virtual void Update (RmNodeUpdateType nodeUpdateType, RmNode *pRmUpdateRootNode)
 Update.

virtual bool LoadXMLData (int hDoc, const RM_TCHAR *strXPath, const RM_TCHAR *strRmXMLVersion)
 Load node data from XML.

virtual bool SaveXMLData (int hDoc, const RM_TCHAR *strXPath)
 Save node data to XML.

virtual RmNodeClone (bool bIncludeLoadedData)
 Clone this node.

virtual const RM_TCHAR * GetDescription ()
virtual bool IsNodeValid ()
 Is valid.

int GetRegister ()
void SetRegister (int nIndex)
 Set register.

int GetElementCount ()
 Get element counts.

const RmStringT & GetDataType ()
 Get data type.

RmNodeGetParameterNode ()
 Get Parameter Node.

void LinkToParameterNode (RmNode *pNode)
 Link to Node.


Protected Member Functions

virtual void CopyNodeData (RmNode *pDestinationNode, bool bIncludeLoadedData)
 Copy node data.

virtual RmNodeTypeChildRuleListGetNodeTypeChildRuleList ()
 Parent / Child rule list function.

virtual void SetNodeTypeChildRuleList (RmNodeTypeChildRuleList *pRmNodeChildRuleList)
 Sets the node child rule list for the given node.


Protected Attributes

int m_nRegister
 Stores which register this constant is mapped to.

RmNodem_pNode
 The node that this constant is linking to.

RmStringT m_strConstantType
 Stores type identification for constant data (matrix, vector, etc).


Detailed Description

Shader Constant.

RmShaderConstant - an individual shader constant base class Contains a register nIndex into constant store, a pointer to the data to be placed into the register. The name field of base class RmNode contains the name of the constant. Each constant is a hidden node in RenderMonkey.


Constructor & Destructor Documentation

RmShaderConstant::RmShaderConstant  ) 
 

Default Constructor.

Default constructor

RmShaderConstant::RmShaderConstant const RM_TCHAR *  strConstantName,
const RM_TCHAR *  strConstantType,
int  nRegister
 

Constructor.

Create a new constant given a name of the constant, its data type and the register that the constant is mapped to. The name of the constant will match the node in the workspace that this constant will be linked to.

Parameters:
strConstantName Node's name
strConstantType String for constant type
nRegister Register index

RmShaderConstant::RmShaderConstant RmNode pNode,
int  nRegister
 

Constructor.

Create a new shader constant that will be linked to the specified node. Note that the node must be either a float, color, vector or a matrix variable only.

Parameters:
pNode Node to link to
See also:
RmNode Register Index

virtual RmShaderConstant::~RmShaderConstant  )  [virtual]
 

Destructor.

Destructor


Member Function Documentation

virtual RmNode* RmShaderConstant::Clone bool  bIncludeLoadedData  )  [virtual]
 

Clone this node.

Creates a clone of this node

Returns:
Cloned node. Returns NULL if cloning failed.

Reimplemented from RmNode.

virtual void RmShaderConstant::CopyNodeData RmNode pDestinationNode,
bool  bIncludeLoadedData
[protected, virtual]
 

Copy node data.

Copies this node's contents (not including children) into the destination node. See RmNode::CopyNodeData for details

Parameters:
pDestinationNode the destination node
Returns:
None

Reimplemented from RmNode.

const RmStringT& RmShaderConstant::GetDataType  )  [inline]
 

Get data type.

Retrieve constant data type

Returns:
Data type string

virtual const RM_TCHAR* RmShaderConstant::GetDescription  )  [virtual]
 

Returns description of the node: used for displaying a tooltip in the workspace tree view for the given node.

Returns:
Returns description string

Reimplemented from RmNode.

int RmShaderConstant::GetElementCount  ) 
 

Get element counts.

Retrieve number of elements that this constant holds. Note that that means that if the constant type = float, color or vector, the number of elements will be 1 (1 4D float), and for matrices it is 4 (4 4D floats)

Returns:
nNumber of elements

virtual RmNodeTypeChildRuleList* RmShaderConstant::GetNodeTypeChildRuleList  )  [inline, protected, virtual]
 

Parent / Child rule list function.

Retrieves the rule list for adding child nodes for a given node type

Returns:
Returns node type child list rules

Reimplemented from RmNode.

RmNode* RmShaderConstant::GetParameterNode  )  [inline]
 

Get Parameter Node.

Retrieve the node that this constant is connected to

Returns:
Node that thios constant is connected to
See also:
RmNode

int RmShaderConstant::GetRegister  )  [inline]
 

Returns the register nIndex

Returns:
Register index

virtual bool RmShaderConstant::IsNodeValid  )  [inline, virtual]
 

Is valid.

Node valid property

True if node is valid

Reimplemented from RmNode.

void RmShaderConstant::LinkToParameterNode RmNode pNode  ) 
 

Link to Node.

Link this constant to a different node. Updates constant type as well

Parameters:
pNode Node to connect to
Returns:
None

virtual bool RmShaderConstant::LoadXMLData int  hDoc,
const RM_TCHAR *  strXPath,
const RM_TCHAR *  strRmXMLVersion
[virtual]
 

Load node data from XML.

Loads versioned XML node data. Note that this method will only load the contents of each node, not the data for all of the children nodes. Each child will have its own XML loading function called by the API.

Parameters:
hDoc Handle to the XML document
strXPath Node path in XML
strRmXMLVersion XML version
Returns:
True if load succeeded. False otherwise.

Reimplemented from RmNode.

virtual bool RmShaderConstant::SaveXMLData int  hDoc,
const RM_TCHAR *  strXPath
[virtual]
 

Save node data to XML.

Saves node's contents to XML. Note that this method will only save the contents of each node, not the data for all of the children nodes. Each child will have its own XML saving function called by the API.

Parameters:
hDoc Handle to the XML document
strXPath Node path in XML
Returns:
True if save succeeded. False otherwise.

Reimplemented from RmNode.

virtual void RmShaderConstant::SetNodeTypeChildRuleList RmNodeTypeChildRuleList pRmNodeChildRuleList  )  [inline, protected, virtual]
 

Sets the node child rule list for the given node.

Sets the child addition rule list for the given node.

Parameters:
pRmNodeChildRuleList new node rules list
None 

Reimplemented from RmNode.

void RmShaderConstant::SetRegister int  nIndex  )  [inline]
 

Set register.

Set register nIndex

Parameters:
nIndex Register Index
Returns:
None

virtual void RmShaderConstant::Update RmNodeUpdateType  nodeUpdateType,
RmNode pRmUpdateRootNode
[virtual]
 

Update.

Updates the internal values of the node

Parameters:
nodeUpdateType Update type
See also:
RmNodeUpdateType
Parameters:
pRmUpdateRootNode Root node for update
Returns:
None

Reimplemented from RmNode.


The documentation for this class was generated from the following file:
Generated on Fri Feb 25 16:09:22 2005 for RenderMonkey SDK by doxygen 1.3.6