HDK
|
#include <CVEX_Data.h>
Public Member Functions | |
CVEX_DataBinder (CVEX_Data &data, exint buffer_size) | |
virtual | ~CVEX_DataBinder () |
exint | getBufferSize () const |
Return the size of the data buffers. More... | |
bool | setAndBindData (CVEX_ValueT< PREC > &value) |
bool | bindData (CVEX_ValueT< PREC > &value) |
bool | isVarying (const UT_StringRef &name) const |
Protected Member Functions | |
virtual bool | setData (UT_Array< Int > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Float > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< String > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Dict > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Vec2 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Vec3 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Vec4 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Mat2 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Mat3 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_Array< Mat4 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Int > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Float > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< String > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Dict > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Vec2 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Vec3 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Vec4 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Mat2 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Mat3 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
virtual bool | setData (UT_PackedArrayOfArrays< Mat4 > &data, exint data_size, const UT_StringRef &data_name) |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals. More... | |
A helper class for binding data buffers to CVEX values. It abstracts the buffer management by allowing to override a virtual method for the particular data type.
For example:
For example, binding an output buffer:
Definition at line 263 of file CVEX_Data.h.
CVEX_DataBinder< PREC >::CVEX_DataBinder | ( | CVEX_Data & | data, |
exint | buffer_size | ||
) |
Creates a binder object for binding data buffers to CVEX values. The is the data holder that stores the data buffers. The buffer_size
specifies the size of buffers this class will create, and should be equal to the value passed into CVEX_Context::run().
|
virtual |
bool CVEX_DataBinder< PREC >::bindData | ( | CVEX_ValueT< PREC > & | value | ) |
Creates a new data buffer, initializes it to zero (without calling the virtuals), then binds it to the given CVEX value.
|
inline |
Return the size of the data buffers.
Definition at line 276 of file CVEX_Data.h.
|
inline |
After binding data, this query will return true if the value is varying (and the associated buffer size is large as specified in the constructor parameter) or uniform (and size is 1).
Definition at line 290 of file CVEX_Data.h.
bool CVEX_DataBinder< PREC >::setAndBindData | ( | CVEX_ValueT< PREC > & | value | ) |
Creates a new data buffer, calls the virtuals to fill it with data, then binds it to the given CVEX value.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.
|
protectedvirtual |
Precision-dependent data types (Int, Float, Vec2, ...) used in virtuals.
Virtuals intended to be overriden by the subclass. Their purpose is to get the values from some custom data source and set the value of the parameter. The data
is the data buffer over which the CVEX program will run. The data_size
is the number of elements to set. It will be equal to getBufferSize() for varying data, and 1 for uniform. UT_Array is pre-sized to this size, however UT_PackedArrayOfArray() can't be pre-sized; so this many elements must be appended. The data_name
is the name of the data buffer.