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

RmVectorVariable Class Reference

Vector Variable Node. More...

#include <RmEffect.h>

Inheritance diagram for RmVectorVariable:

RmVariable RmNode List of all members.

Public Member Functions

 RmVectorVariable ()
 Default constructor.

 RmVectorVariable (float fX, float fY, float fZ, float fW, bool bClamp, bool bNormalize, float fMin=-10.0f, float fMax=10.0f)
 Default constructor.

 RmVectorVariable (float fX, float fY, float fZ, float fW)
 Default constructor.

 RmVectorVariable (float fVector[4])
 Default constructor.

virtual ~RmVectorVariable ()
 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 void SetName (const RM_TCHAR *strNewName)
 Set Name.

float * GetData ()
float GetValue (int nIndex)
void SetValue (int nIndex, float fValue)
 Set Value.

void SetValues (float fX, float fY, float fZ, float fW)
 Set Values.

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

bool IsClamped ()
 Clamping flag.

void SetIsClamped (bool bClamp)
 Set clamping flag.

float GetMin ()
 Get min.

float GetMax ()
 Get max.

void SetMin (float fMin)
 Set min value.

void SetMax (float fMax)
 Set max value.

void SetMinMax (float fMin, float fMax)
 Set min & max.

bool IsNormalized ()
 Normalized flag.

void SetIsNormalized (bool bValue)
 Set normalizing flag.

void Normalize ()
 Normalize.


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_fValues [4]
 The actual values stored in this vector.

float m_fMin
 The min clamping a variable.

float m_fMax
 The max clamping a variable.

bool m_bClamp
 A flag denoting whether this variable is clamped to the bounds or not.

bool m_bNormalize

Detailed Description

Vector Variable Node.

RmVector is class for a VECTOR of 4 float values


Constructor & Destructor Documentation

RmVectorVariable::RmVectorVariable  ) 
 

Default constructor.

Default constructor - creates a vector with first 3 components being 0, and last one equaling 1.0. By default clamping and normalizing is off

RmVectorVariable::RmVectorVariable float  fX,
float  fY,
float  fZ,
float  fW,
bool  bClamp,
bool  bNormalize,
float  fMin = -10.0f,
float  fMax = 10.0f
 

Default constructor.

Default constructor: Creates a new vector with 4 initialized components, and specifies whether the vector should be clamped to specified bounds, and whether first three components should be kept normalized (bNormalize = true) or not.

RmVectorVariable::RmVectorVariable float  fX,
float  fY,
float  fZ,
float  fW
 

Default constructor.

Default constructor - Creates a new vector with 4 initialized components, unclamped and unnormalized by default.

RmVectorVariable::RmVectorVariable float  fVector[4]  ) 
 

Default constructor.

Default constructor - Creates a new vector with 4 initialized components, unclamped and unnormalized by default.

virtual RmVectorVariable::~RmVectorVariable  )  [inline, virtual]
 

Destructor.

Destructor


Member Function Documentation

virtual RmNode* RmVectorVariable::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 RmVectorVariable::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* RmVectorVariable::GetData  )  [inline]
 

Retrieve a pointer to the data values of this vector

Returns:
Pointer to float data

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

Returns description of the node: used for displaying a tooltip in the workspace tree view for the given node. Create tooltip for the vector variable in the form: ( X, Y, Z, W )

Returns:
Returns description string

Reimplemented from RmNode.

float RmVectorVariable::GetMax  )  [inline]
 

Get max.

Retrieve maximum clamping bound value for the vector

Returns:
Max value

float RmVectorVariable::GetMin  )  [inline]
 

Get min.

Retrieve minimum clamping bound value for the vector

Returns:
Min value

virtual RmNodeTypeChildRuleList* RmVectorVariable::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 RmVectorVariable::GetValue int  nIndex  )  [inline]
 

Retrieve vector component given its nIndex

Returns:
Float value

bool RmVectorVariable::IsClamped  )  [inline]
 

Clamping flag.

Retrieve whether this vector's components are being clamped

Returns:
Clamping flag

bool RmVectorVariable::IsNormalized  )  [inline]
 

Normalized flag.

Retrieve whether the first three components of this vector node are kept normalized ///

Returns:
True if normalize flag is set

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

void RmVectorVariable::Normalize  ) 
 

Normalize.

Normalize the first three components of the vector

Returns:
None

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

void RmVectorVariable::SetIsClamped bool  bClamp  ) 
 

Set clamping flag.

Set whether vector components should be clamped

Parameters:
bClamp Clamp flag
Returns:
None

void RmVectorVariable::SetIsNormalized bool  bValue  ) 
 

Set normalizing flag.

Set whether the first three components of the vector should be kept normalized ///

Parameters:
bValue Normalizing flag
Returns:
None

void RmVectorVariable::SetMax float  fMax  ) 
 

Set max value.

Parameters:
fMax Max value
Returns:
None

void RmVectorVariable::SetMin float  fMin  ) 
 

Set min value.

Set minimum clamping bound value for the vector

Parameters:
fMin Min value
Returns:
None

void RmVectorVariable::SetMinMax float  fMin,
float  fMax
 

Set min & max.

Set clamping bounds for the vector

Parameters:
fMin Min value
fMax Max value
Returns:
None

virtual void RmVectorVariable::SetName const RM_TCHAR *  strNewName  )  [virtual]
 

Set Name.

Set the name of the node to the specified value

Parameters:
strNewName New name

Reimplemented from RmNode.

virtual void RmVectorVariable::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 RmVectorVariable::SetValue int  nIndex,
float  fValue
 

Set Value.

Set vector component to the new value given component's nIndex

Parameters:
nIndex Index to vector
fValue Value to set to
Returns:
None

void RmVectorVariable::SetValues float  fValues[4]  ) 
 

Set values.

Set new values for all vector components

Parameters:
fValues Array of valuesd to set
Returns:
None

void RmVectorVariable::SetValues float  fX,
float  fY,
float  fZ,
float  fW
 

Set Values.

Set new values for all vector components

Parameters:
fX 1st value
fY 2nd value
fZ 3rd value
fW 4th value
Returns:
None

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


Member Data Documentation

bool RmVectorVariable::m_bNormalize [protected]
 

A flag denoting whether this variable should be normalized or not
NOTE about vector normalization: RenderMonkey only normalizes
the first THREE components of a vector, not including W.


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