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

RmColorVariable Class Reference

Color Variable Node. More...

#include <RmEffect.h>

Inheritance diagram for RmColorVariable:

RmVariable RmNode List of all members.

Public Member Functions

 RmColorVariable ()
 Default Constructor.

 RmColorVariable (float fRed, float fGreen, float fBlue, float fAlpha)
 Constructor.

 RmColorVariable (float fColor[4])
 Constructor.

 RmColorVariable (const RM_TCHAR *strName, float fRed, float fGreen, float fBlue, float fAlpha)
 Constructor.

 RmColorVariable (const RM_TCHAR *strName, float fColor[4])
 Constructor.

virtual ~RmColorVariable ()
 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 ()
float * GetValue ()
 Get value.

float GetChannel (int nIndex)
 Get channel.

float GetR ()
 Get red.

float GetG ()
 Get green.

float GetB ()
 Get blue.

float GetA ()
 Get blue.

void SetValue (int nIndex, float fValue)
 Set value.

void SetValues (float fValues[4])
 Set values.


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

float m_fColor [4]
 4 component color, each component can be in the range of [-1.0, 1.0]


Detailed Description

Color Variable Node.

RmColor is a node containing a COLOR variable


Constructor & Destructor Documentation

RmColorVariable::RmColorVariable  ) 
 

Default Constructor.

Default constructor: creates a new color node, set to white by default with 1.0 alpha value

RmColorVariable::RmColorVariable float  fRed,
float  fGreen,
float  fBlue,
float  fAlpha
 

Constructor.

Creates a new color variable with specified four channels. Note: the values for each channel must be in the range of 0.0 to 1.0

Parameters:
fRed Red component ( 0.0 to 1.0 )
fGreen Green component ( 0.0 to 1.0 )
fBlue Blue component ( 0.0 to 1.0 )
fAlpha Alpha component ( 0.0 to 1.0 )

RmColorVariable::RmColorVariable float  fColor[4]  ) 
 

Constructor.

Creates a new color variable with specified four channels. Note: the values for each channel must be in the range of 0.0 to 1.0

Parameters:
fColor Array of 4 floats ( 0.0 to 1.0 )

RmColorVariable::RmColorVariable const RM_TCHAR *  strName,
float  fRed,
float  fGreen,
float  fBlue,
float  fAlpha
 

Constructor.

Creates a new color variable with specified four channels and name. Note: the values for each channel must be in the range of 0.0 to 1.0

Parameters:
strName Name of Node
fRed Red component ( 0.0 to 1.0 )
fGreen Green component ( 0.0 to 1.0 )
fBlue Blue component ( 0.0 to 1.0 )
fAlpha Alpha component ( 0.0 to 1.0 )

RmColorVariable::RmColorVariable const RM_TCHAR *  strName,
float  fColor[4]
 

Constructor.

Creates a new color variable with specified four channels and name. Note: the values for each channel must be in the range of 0.0 to 1.0

Parameters:
strName Name of Node
fColor Array of 4 floats ( 0.0 to 1.0 )

virtual RmColorVariable::~RmColorVariable  )  [virtual]
 

Destructor.

Destructor


Member Function Documentation

virtual RmNode* RmColorVariable::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 RmColorVariable::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 RmVariable.

float RmColorVariable::GetA  )  [inline]
 

Get blue.

Retrieve alpha component of the color node

Returns:
Alpha value

float RmColorVariable::GetB  )  [inline]
 

Get blue.

Retrieve blue component of the color node

Returns:
Blue value

float RmColorVariable::GetChannel int  nIndex  ) 
 

Get channel.

Retrieve specific channel (0..3) from color

Parameters:
nIndex Index to color
Returns:
Color for given index

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

Returns description of the node: used for displaying a tooltip in the workspace tree view for the given node. Displays in the form of (R: x, G: x, B: x, A: x)

Returns:
Returns description string

Reimplemented from RmNode.

float RmColorVariable::GetG  )  [inline]
 

Get green.

Retrieve green component of the color node

Returns:
Green value

virtual RmNodeTypeChildRuleList* RmColorVariable::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 RmVariable.

float RmColorVariable::GetR  )  [inline]
 

Get red.

Retrieve red component of the color node

Returns:
Red value

float* RmColorVariable::GetValue  )  [inline]
 

Get value.

Retrieve the values of the color node - 4 floats

Returns:
Return array of floats as color

virtual bool RmColorVariable::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 RmVariable.

virtual bool RmColorVariable::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 RmVariable.

virtual void RmColorVariable::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 RmVariable.

void RmColorVariable::SetValue int  nIndex,
float  fValue
 

Set value.

Set value for specific channel in the color node. Note: the values for each channel must be in the range of 0.0 to 1.0

Parameters:
nIndex Index to color
fValue Valeu to set
Returns:
None

void RmColorVariable::SetValues float  fValues[4]  ) 
 

Set values.

Set all values for all four color channels at once. Note: the values for each channel must be in the range of 0.0 to 1.0

Parameters:
Array of 4 floats
Returns:
None

virtual void RmColorVariable::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:08:56 2005 for RenderMonkey SDK by doxygen 1.3.6