Om
1.0.0
A universal framework for multimedia simulation
|
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... | |
AttributeValue & | operator= (const AttributeValue &other) |
Assign the value and type of another shader attribute to this attribute. More... | |
const AttributeType & | getType () 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... | |
UByte * | getPointer () |
Return a raw pointer to the underlying data storage for this attribute value. More... | |
const UByte * | getPointer () 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... | |
A class that is used to store the value of a shader attribute of scalar, vector, or matrix types.
|
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.
|
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.
|
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.
|
inline |
Destroy a AttributeValue object and its associated value.
AttributeValue& om::graphics::base::AttributeValue::operator= | ( | const AttributeValue & | other | ) |
Assign the value and type of another shader attribute to this attribute.
|
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.
|
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.
|
inline |
Return the number of components that are in this attribute value.
|
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.
|
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.
|
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.
|
inline |
Return a raw pointer to the underlying data storage for this attribute value.
|
inline |
Return a raw pointer to the underlying data storage for this attribute value.
|
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.
|
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.
|
inline |
Return whether or not the AttributeValue is not set.
|
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.
|
inline |
Convert this attribute value into a string representation.