Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::graphics::base::AttributeValue Class Reference

A class that is used to store the value of a shader attribute of scalar, vector, or matrix types. More...

#include <omGraphicsAttributeValue.h>

Public Member Functions

 AttributeValue ()
 Create a AttributeValue with undefined type and no value set. More...
 
 AttributeValue (const AttributeType &newType, Size newArraySize=Size(1))
 Create a AttributeValue with the specified type and an undefined value. More...
 
template<typename PrimType >
 AttributeValue (const PrimType *newAttribute, const AttributeType &newType, Size newArraySize=Size(1))
 Create a AttributeValue with the specified value and type from a packed array. More...
 
template<typename T >
 AttributeValue (const T &newAttribute, Size newArraySize=Size(1))
 Create a AttributeValue with the type and value of the specified parameter and given array size. More...
 
 AttributeValue (const AttributeValue &other)
 Create a copy of the specified shader attribute. More...
 
 ~AttributeValue ()
 Destroy a AttributeValue object and its associated value. More...
 
AttributeValueoperator= (const AttributeValue &other)
 Assign the value and type of another shader attribute to this attribute. More...
 
const AttributeTypegetType () const
 Return the type of value that this AttributeValue represents. More...
 
void setType (const AttributeType &newType, Size newArraySize=Size(1))
 Set the type of value that this AttributeValue represents. More...
 
template<typename T >
Bool getValue (T &output, Index arrayIndex=0) const
 Store the value of the AttributeValue in the specified reference. More...
 
Size getComponentCount () const
 Return the number of components that are in this attribute value. More...
 
template<typename T >
Bool getComponents (T *output) const
 Get the components of the AttributeValue in the output pointer. More...
 
template<typename T >
T * getComponents ()
 Return a pointer to the components of this Shader attribute, stored in column-major order. More...
 
template<typename T >
const T * getComponents () const
 Return a pointer to the components of this Shader attribute, stored in column-major order. More...
 
UBytegetPointer ()
 Return a raw pointer to the underlying data storage for this attribute value. More...
 
const UBytegetPointer () const
 Return a raw pointer to the underlying data storage for this attribute value. More...
 
template<typename T >
Bool setValue (const T &newAttribute, Index arrayIndex=0)
 Set the value stored in this AttributeValue object. More...
 
Size getArraySize () const
 Return the size of the stored attribute array. More...
 
void setArraySize (Size newArraySize)
 Set the size of the stored attribute array. More...
 
Bool isNull () const
 Return whether or not the AttributeValue is not set. More...
 
Bool isSet () const
 Return whether or not the AttributeValue has a value set. More...
 
String toString () const
 Return a string representation of the attribute value. More...
 
 operator String () const
 Convert this attribute value into a string representation. More...
 

Detailed Description

A class that is used to store the value of a shader attribute of scalar, vector, or matrix types.

Constructor & Destructor Documentation

om::graphics::base::AttributeValue::AttributeValue ( )
inline

Create a AttributeValue with undefined type and no value set.

om::graphics::base::AttributeValue::AttributeValue ( const AttributeType newType,
Size  newArraySize = Size(1) 
)

Create a AttributeValue with the specified type and an undefined value.

If the new attribute value's type is undefined, the shader attribute is constructed with no value stored.

template<typename PrimType >
om::graphics::base::AttributeValue::AttributeValue ( const PrimType *  newAttribute,
const AttributeType newType,
Size  newArraySize = Size(1) 
)
inline

Create a AttributeValue with the specified value and type from a packed array.

If the new attribute value's type is undefined, the shader attribute is constructed with no value stored.

template<typename T >
om::graphics::base::AttributeValue::AttributeValue ( const T &  newAttribute,
Size  newArraySize = Size(1) 
)
inline

Create a AttributeValue with the type and value of the specified parameter and given array size.

If the new attribute value's type is undefined, the shader attribute is constructed with no value stored. The specified attribute value is copied for each element in the attribute array size.

om::graphics::base::AttributeValue::AttributeValue ( const AttributeValue other)

Create a copy of the specified shader attribute.

om::graphics::base::AttributeValue::~AttributeValue ( )
inline

Destroy a AttributeValue object and its associated value.

Member Function Documentation

AttributeValue& om::graphics::base::AttributeValue::operator= ( const AttributeValue other)

Assign the value and type of another shader attribute to this attribute.

const AttributeType& om::graphics::base::AttributeValue::getType ( ) const
inline

Return the type of value that this AttributeValue represents.

void om::graphics::base::AttributeValue::setType ( const AttributeType newType,
Size  newArraySize = Size(1) 
)

Set the type of value that this AttributeValue represents.

The internal memory for this value is enlarged if necessary to contain the specified type and array size. The contents of the value are undefined after this method is called.

template<typename T >
Bool om::graphics::base::AttributeValue::getValue ( T &  output,
Index  arrayIndex = 0 
) const
inline

Store the value of the AttributeValue in the specified reference.

If the templated type of the output object matches the type of the shader attribute, TRUE is returned and the value is placed in the location specified by the output reference. Otherwise FALSE is returned and no value is retrieved.

Size om::graphics::base::AttributeValue::getComponentCount ( ) const
inline

Return the number of components that are in this attribute value.

template<typename T >
Bool om::graphics::base::AttributeValue::getComponents ( T *  output) const
inline

Get the components of the AttributeValue in the output pointer.

If the templated type of the output pointer matches the type of the shader attribute's component type, TRUE is returned and the attribute is placed in the location specified by the output pointer. Otherwise FALSE is returned and no value is retrieved.

template<typename T >
T* om::graphics::base::AttributeValue::getComponents ( )
inline

Return a pointer to the components of this Shader attribute, stored in column-major order.

If the templated type of the function matches the type of the shader attribute's component type, the function is successful and the component pointer is returned. Otherwise, NULL is returned indicating failure.

template<typename T >
const T* om::graphics::base::AttributeValue::getComponents ( ) const
inline

Return a pointer to the components of this Shader attribute, stored in column-major order.

If the templated type of the function matches the type of the shader attribute's component type, the function is successful and the component pointer is returned. Otherwise, NULL is returned indicating failure.

UByte* om::graphics::base::AttributeValue::getPointer ( )
inline

Return a raw pointer to the underlying data storage for this attribute value.

const UByte* om::graphics::base::AttributeValue::getPointer ( ) const
inline

Return a raw pointer to the underlying data storage for this attribute value.

template<typename T >
Bool om::graphics::base::AttributeValue::setValue ( const T &  newAttribute,
Index  arrayIndex = 0 
)
inline

Set the value stored in this AttributeValue object.

If the type of the new attribute value is undefined, the AttributeValue is unmodified and FALSE is returned. Otherwise, the value and type of the AttributeValue object are replaced by the new attribute value and type.

Size om::graphics::base::AttributeValue::getArraySize ( ) const
inline

Return the size of the stored attribute array.

void om::graphics::base::AttributeValue::setArraySize ( Size  newArraySize)

Set the size of the stored attribute array.

New attributes are filled in with the previous last value in the array.

Bool om::graphics::base::AttributeValue::isNull ( ) const
inline

Return whether or not the AttributeValue is not set.

Bool om::graphics::base::AttributeValue::isSet ( ) const
inline

Return whether or not the AttributeValue has a value set.

String om::graphics::base::AttributeValue::toString ( ) const

Return a string representation of the attribute value.

om::graphics::base::AttributeValue::operator String ( ) const
inline

Convert this attribute value into a string representation.


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