HDK
|
A class representing a VEX value. More...
#include <CVEX_Value.h>
Public Member Functions | |
CVEX_ValueT (const UT_StringHolder &name, CVEX_Type type, bool varying) | |
~CVEX_ValueT () | |
const UT_StringHolder & | getName () const |
Query name of VEX value. More... | |
CVEX_Type | getType () const |
Query type of VEX value. More... | |
void | setType (CVEX_Type type) |
bool | isExport () const |
Query whether the VEX value is an export (or read-only) More... | |
bool | isVarying () const |
Query whether the VEX value is uniform or varying. More... | |
int | getArraySize () const |
void * | getRawData () |
bool | isPackedArray () const |
bool | setTypedData (VEXint< PREC > *data, int array_size) |
bool | setTypedData (VEXfloat< PREC > *data, int array_size) |
bool | setTypedData (VEXvec2< PREC > *data, int array_size) |
bool | setTypedData (VEXvec3< PREC > *data, int array_size) |
bool | setTypedData (VEXvec4< PREC > *data, int array_size) |
bool | setTypedData (VEXmat2< PREC > *data, int array_size) |
bool | setTypedData (VEXmat3< PREC > *data, int array_size) |
bool | setTypedData (VEXmat4< PREC > *data, int array_size) |
bool | setTypedData (CVEX_StringArray &stringdata) |
bool | setTypedData (CVEX_DictArray &dictdata) |
bool | setTypedData (UT_Array< UT_Array< VEXint< PREC >> > &intdata) |
bool | setTypedData (UT_PackedArrayOfArrays< VEXint< PREC >> &intdata, int arraysize=0) |
bool | setTypedData (UT_Array< UT_Array< VEXfloat< PREC >> > &fltdata) |
This is stored as xyzxyzxyz for vector data. More... | |
bool | setTypedData (UT_PackedArrayOfArrays< VEXfloat< PREC >> &fltdata, int arraysize=0) |
bool | setTypedData (UT_Array< CVEX_StringArray > &stringdata) |
bool | setTypedData (UT_Array< CVEX_DictArray > &dictdata) |
bool | setRawData (CVEX_Type type, void *data, int array_size) |
Type unsafe way of setting VEX data. Avoid using if possible. More... | |
void * | getData () |
bool | setData (void *data, int array_size) |
bool | setData (CVEX_StringArray &stringdata) |
void | setIsConstant (bool isconstant) |
bool | isConstant () const |
void | dump () const |
For debugging. More... | |
void | dump (UT_JSONWriter &w) const |
Static Public Member Functions | |
static int | getTupleSize (CVEX_Type t) |
static CVEX_Type | getArrayBaseType (CVEX_Type t) |
static VEX_Type | cvexToVexType (CVEX_Type type, bool &isarray) |
static CVEX_Type | vexToCVexType (VEX_Type vextype, bool isarray) |
Friends | |
template<VEX_Precision ALLPREC> | |
class | CVEX_ContextT |
template<VEX_Precision ALLPREC> | |
class | CVEX_ValueListT |
Additional Inherited Members | |
Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable | |
UT_NonCopyable ()=default | |
~UT_NonCopyable ()=default | |
UT_NonCopyable (const UT_NonCopyable &)=delete | |
UT_NonCopyable & | operator= (const UT_NonCopyable &)=delete |
A class representing a VEX value.
The CVEX_Value objects are created internally in the CVEX library. They provide a mapping from the CVEX library to the underlying VEX representation of objects.
Definition at line 60 of file CVEX_Value.h.
CVEX_ValueT< PREC >::CVEX_ValueT | ( | const UT_StringHolder & | name, |
CVEX_Type | type, | ||
bool | varying | ||
) |
CVEX_ValueT< PREC >::~CVEX_ValueT | ( | ) |
|
static |
Given the list of vex parameters, returns the list of cvex parmeters that have valid cvex types.
void CVEX_ValueT< PREC >::dump | ( | ) | const |
For debugging.
void CVEX_ValueT< PREC >::dump | ( | UT_JSONWriter & | w | ) | const |
|
static |
|
inline |
Query the array size of the VEX value.
Definition at line 80 of file CVEX_Value.h.
|
inline |
Definition at line 145 of file CVEX_Value.h.
|
inline |
|
inline |
Get the raw data pointer. For numeric types, the data refers to a raw array of data (depending on the getType() of the value.
int
fpreal32
UT_Vector2F
UT_Vector3F
UT_Vector4F
UT_Matrix2F
UT_Matrix3F
UT_Matrix4F
For CVEX_TYPE_STRING, the data will point to a UT_StringArray. Definition at line 94 of file CVEX_Value.h.
|
static |
|
inline |
|
inline |
Definition at line 166 of file CVEX_Value.h.
|
inline |
Query whether the VEX value is an export (or read-only)
Definition at line 74 of file CVEX_Value.h.
|
inline |
Definition at line 96 of file CVEX_Value.h.
|
inline |
Query whether the VEX value is uniform or varying.
Definition at line 76 of file CVEX_Value.h.
|
inline |
Definition at line 149 of file CVEX_Value.h.
|
inline |
Definition at line 153 of file CVEX_Value.h.
|
inline |
The IsConstant determines eligibility for constant folding. It likely implies Uniform. But it is quite reasonable to have a Uniform parameter that isn't constant, it is then a demand that the VEX Assemble does not fold the input regardless of the initial value during load()
Definition at line 164 of file CVEX_Value.h.
bool CVEX_ValueT< PREC >::setRawData | ( | CVEX_Type | type, |
void * | data, | ||
int | array_size | ||
) |
Type unsafe way of setting VEX data. Avoid using if possible.
void CVEX_ValueT< PREC >::setType | ( | CVEX_Type | type | ) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXint< PREC > * | data, |
int | array_size | ||
) |
The array size is NOT the size in bytes, but rather the array size of the input data. It should either be 1 or N, where N is the number of values being computed by VEX.
When passing data for output variables, please check to see whether the output variable is uniform or varying. Varying values need to have a full array of data (including string arrays).
The CVEX_Value object will hold a pointer to the CVEX_StringArray, so the data must be persistent.
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXfloat< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXvec2< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXvec3< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXvec4< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXmat2< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXmat3< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | VEXmat4< PREC > * | data, |
int | array_size | ||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | CVEX_StringArray & | stringdata | ) |
When setting values for string types, you need to pass in a CVEX_StringArray instead of a void *. For input variables, the length of the array will determine whether the parameter is varying or uniform.
The CVEX_Value object will hold a pointer to the CVEX_StringArray, so the data must be persistent.
When setting data for outputs, the packed arrays should be empty and the array size specified.
bool CVEX_ValueT< PREC >::setTypedData | ( | CVEX_DictArray & | dictdata | ) |
bool CVEX_ValueT< PREC >::setTypedData | ( | UT_Array< UT_Array< VEXint< PREC >> > & | intdata | ) |
bool CVEX_ValueT< PREC >::setTypedData | ( | UT_PackedArrayOfArrays< VEXint< PREC >> & | intdata, |
int | arraysize = 0 |
||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | UT_Array< UT_Array< VEXfloat< PREC >> > & | fltdata | ) |
This is stored as xyzxyzxyz for vector data.
bool CVEX_ValueT< PREC >::setTypedData | ( | UT_PackedArrayOfArrays< VEXfloat< PREC >> & | fltdata, |
int | arraysize = 0 |
||
) |
bool CVEX_ValueT< PREC >::setTypedData | ( | UT_Array< CVEX_StringArray > & | stringdata | ) |
bool CVEX_ValueT< PREC >::setTypedData | ( | UT_Array< CVEX_DictArray > & | dictdata | ) |
|
static |
Definition at line 199 of file CVEX_Value.h.
Definition at line 201 of file CVEX_Value.h.