Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SH::ShVariableNode Class Reference

A generic n-tuple variable. More...

#include <ShVariableNode.hpp>

Inheritance diagram for SH::ShVariableNode:

Inheritance graph
[legend]
Collaboration diagram for SH::ShVariableNode:

Collaboration graph
[legend]
List of all members.

Public Types

typedef float ValueType
 This is not necessarily correct. Oh well.


Public Member Functions

 ShVariableNode (ShBindingType kind, int size, ShSemanticType type=SH_ATTRIB)
bool uniform () const
 Is this a uniform (non-shader specific) variable?

bool hasValues () const
 Does this variable have values in the host, e.g.

int size () const
 Get the number of elements in this variable.

void size (int size)
void lock ()
 Do not update bound shaders in subsequent setValue calls.

void unlock ()
 Update bound shader values, and turn off locking.

std::string name () const
 Get this variable's name.

void name (const std::string &n)
 Set this variable's name.

void range (ShVariableNode::ValueType low, ShVariableNode::ValueType high)
 Set a range of possible values for this variable's elements.

ShVariableNode::ValueType lowBound () const
ShVariableNode::ValueType highBound () const
ShBindingType kind () const
ShSemanticType specialType () const
void specialType (ShSemanticType)
std::string nameOfType () const
 Get a string of this var's specialType, kind, & size.

void setValue (int i, ValueType value)
 For variables with values only.

ValueType getValue (int i) const
 Retrieve a particular value.

void addValues ()
 Ensure this node has space to store host-side values.

void attach (const ShPointer< ShProgramNode > &evaluator)
 Attaching a null program causes this uniform to no longer become dependent.

void update ()
 Reevaluate a dependent uniform.

const ShPointer< ShProgramNode > & evaluator () const
 Obtain the program defining this uniform, if any.


Protected Member Functions

void add_dependent (ShVariableNode *dep)
void remove_dependent (ShVariableNode *dep)
void update_dependents ()
void detach_dependencies ()

Protected Attributes

bool m_uniform
ShBindingType m_kind
ShSemanticType m_specialType
int m_size
int m_id
int m_locked
ValueTypem_values
ValueType m_lowBound
ValueType m_highBound
ShVariableNodeEval * m_eval
std::list< ShVariableNode * > m_dependents

Static Protected Attributes

int m_maxID

Detailed Description

A generic n-tuple variable.

Definition at line 74 of file ShVariableNode.hpp.


Member Function Documentation

void SH::ShVariableNode::addValues  ) 
 

Ensure this node has space to store host-side values.

Normally this is not necessary, but when uniforms are given dependent programs and evaluated all the temporaries will need to store values during an evaluation.

Definition at line 296 of file ShVariableNode.cpp.

References ValueType.

bool SH::ShVariableNode::hasValues  )  const
 

Does this variable have values in the host, e.g.

for constants and uniforms.

Definition at line 142 of file ShVariableNode.cpp.

void SH::ShVariableNode::setValue int  i,
ValueType  value
 

For variables with values only.

Sets the value of the i'th entry. If i is outside [0, size - 1] this is a no-op.

See also:
hasValues()

Definition at line 273 of file ShVariableNode.cpp.

References SH::shBeginBound(), and SH::shEndBound().


The documentation for this class was generated from the following files:
Generated on Mon Oct 18 14:17:59 2004 for Sh by doxygen 1.3.7