HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CVEX_Value Class Reference

A class representing a VEX value. More...

#include <CVEX_Value.h>

Public Member Functions

 CVEX_Value (const UT_StringHolder &name, CVEX_Type type, VEX_Precision prec, bool varying)
 
 ~CVEX_Value ()
 
const UT_StringHoldergetName () const
 Query name of VEX value. More...
 
CVEX_Type getType () const
 Query type of VEX value. More...
 
void setType (CVEX_Type type)
 
void setPrecision (VEX_Precision p)
 
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
 
voidgetRawData ()
 
bool isPackedArray () const
 
bool setTypedData (int32 *data, int array_size)
 
bool setTypedData (fpreal32 *data, int array_size)
 
bool setTypedData (UT_Vector2F *data, int array_size)
 
bool setTypedData (UT_Vector3F *data, int array_size)
 
bool setTypedData (UT_Vector4F *data, int array_size)
 
bool setTypedData (UT_Matrix2F *data, int array_size)
 
bool setTypedData (UT_Matrix3F *data, int array_size)
 
bool setTypedData (UT_Matrix4F *data, int array_size)
 
bool setTypedData (int64 *data, int array_size)
 
bool setTypedData (fpreal64 *data, int array_size)
 
bool setTypedData (UT_Vector2D *data, int array_size)
 
bool setTypedData (UT_Vector3D *data, int array_size)
 
bool setTypedData (UT_Vector4D *data, int array_size)
 
bool setTypedData (UT_Matrix2D *data, int array_size)
 
bool setTypedData (UT_Matrix3D *data, int array_size)
 
bool setTypedData (UT_Matrix4D *data, int array_size)
 
bool setTypedData (CVEX_StringArray &stringdata)
 
bool setTypedData (UT_Array< UT_Array< int32 > > &intdata)
 
bool setTypedData (UT_PackedArrayOfArrays< int32 > &intdata, int arraysize=0)
 
bool setTypedData (UT_Array< UT_Array< fpreal32 > > &fltdata)
 This is stored as xyzxyzxyz for vector data. More...
 
bool setTypedData (UT_PackedArrayOfArrays< fpreal32 > &fltdata, int arraysize=0)
 
bool setTypedData (UT_Array< UT_Array< int64 > > &intdata)
 
bool setTypedData (UT_PackedArrayOfArrays< int64 > &intdata, int arraysize=0)
 
bool setTypedData (UT_Array< UT_Array< fpreal64 > > &fltdata)
 This is stored as xyzxyzxyz for vector data. More...
 
bool setTypedData (UT_PackedArrayOfArrays< fpreal64 > &fltdata, int arraysize=0)
 
bool setTypedData (UT_Array< CVEX_StringArray > &stringdata)
 
bool setRawData (CVEX_Type type, VEX_Precision, void *data, int array_size)
 Type unsafe way of setting VEX data. Avoid using if possible. More...
 
voidgetData ()
 
bool setData (void *data, int array_size)
 
bool setData (CVEX_StringArray &stringdata)
 
void setIsConstant (bool isconstant)
 
bool isConstant () 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

class CVEX_Context
 

Detailed Description

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.

Examples:
CVEX/cvexsample.C, CVEX/simple.C, and SOP/SOP_PrimVOP.C.

Definition at line 52 of file CVEX_Value.h.

Constructor & Destructor Documentation

CVEX_Value::CVEX_Value ( const UT_StringHolder name,
CVEX_Type  type,
VEX_Precision  prec,
bool  varying 
)
CVEX_Value::~CVEX_Value ( )

Member Function Documentation

static VEX_Type CVEX_Value::cvexToVexType ( CVEX_Type  type,
bool &  isarray 
)
static

Given the list of vex parameters, returns the list of cvex parmeters that have valid cvex types.

static CVEX_Type CVEX_Value::getArrayBaseType ( CVEX_Type  t)
static
int CVEX_Value::getArraySize ( ) const
inline

Query the array size of the VEX value.

Note
This is not the used for VEX arrays, but rather represents the number of entries in the varying array.
Examples:
CVEX/cvexsample.C.

Definition at line 72 of file CVEX_Value.h.

void* CVEX_Value::getData ( )
inline

Definition at line 151 of file CVEX_Value.h.

const UT_StringHolder& CVEX_Value::getName ( void  ) const
inline

Query name of VEX value.

Examples:
CVEX/cvexsample.C.

Definition at line 60 of file CVEX_Value.h.

void* CVEX_Value::getRawData ( )
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.

  • CVEX_TYPE_INTEGER int
  • CVEX_TYPE_FLOAT fpreal32
  • CVEX_TYPE_VECTOR2 UT_Vector2F
  • CVEX_TYPE_VECTOR3 UT_Vector3F
  • CVEX_TYPE_VECTOR4 UT_Vector4F
  • CVEX_TYPE_MATRIX2 UT_Matrix2F
  • CVEX_TYPE_MATRIX3 UT_Matrix3F
  • CVEX_TYPE_MATRIX4 UT_Matrix4F For CVEX_TYPE_STRING, the data will point to a UT_StringArray.
Examples:
CVEX/cvexsample.C.

Definition at line 86 of file CVEX_Value.h.

static int CVEX_Value::getTupleSize ( CVEX_Type  t)
static
CVEX_Type CVEX_Value::getType ( ) const
inline

Query type of VEX value.

Examples:
CVEX/cvexsample.C.

Definition at line 62 of file CVEX_Value.h.

bool CVEX_Value::isConstant ( ) const
inline

Definition at line 172 of file CVEX_Value.h.

bool CVEX_Value::isExport ( ) const
inline

Query whether the VEX value is an export (or read-only)

Examples:
CVEX/cvexsample.C.

Definition at line 66 of file CVEX_Value.h.

bool CVEX_Value::isPackedArray ( ) const
inline

Definition at line 88 of file CVEX_Value.h.

bool CVEX_Value::isVarying ( ) const
inline

Query whether the VEX value is uniform or varying.

Examples:
SOP/SOP_PrimVOP.C.

Definition at line 68 of file CVEX_Value.h.

bool CVEX_Value::setData ( void data,
int  array_size 
)
inline

Definition at line 155 of file CVEX_Value.h.

bool CVEX_Value::setData ( CVEX_StringArray stringdata)
inline

Definition at line 159 of file CVEX_Value.h.

void CVEX_Value::setIsConstant ( bool  isconstant)
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 170 of file CVEX_Value.h.

void CVEX_Value::setPrecision ( VEX_Precision  p)
inline

Definition at line 64 of file CVEX_Value.h.

bool CVEX_Value::setRawData ( CVEX_Type  type,
VEX_Precision  ,
void data,
int  array_size 
)

Type unsafe way of setting VEX data. Avoid using if possible.

Examples:
SOP/SOP_PrimVOP.C.
void CVEX_Value::setType ( CVEX_Type  type)
bool CVEX_Value::setTypedData ( int32 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.

Examples:
CVEX/cvexsample.C, CVEX/simple.C, and SOP/SOP_PrimVOP.C.
bool CVEX_Value::setTypedData ( fpreal32 data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Vector2F data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Vector3F data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Vector4F data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Matrix2F data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Matrix3F data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Matrix4F data,
int  array_size 
)
bool CVEX_Value::setTypedData ( int64 data,
int  array_size 
)
bool CVEX_Value::setTypedData ( fpreal64 data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Vector2D data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Vector3D data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Vector4D data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Matrix2D data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Matrix3D data,
int  array_size 
)
bool CVEX_Value::setTypedData ( UT_Matrix4D data,
int  array_size 
)
bool CVEX_Value::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_Value::setTypedData ( UT_Array< UT_Array< int32 > > &  intdata)
bool CVEX_Value::setTypedData ( UT_PackedArrayOfArrays< int32 > &  intdata,
int  arraysize = 0 
)
bool CVEX_Value::setTypedData ( UT_Array< UT_Array< fpreal32 > > &  fltdata)

This is stored as xyzxyzxyz for vector data.

bool CVEX_Value::setTypedData ( UT_PackedArrayOfArrays< fpreal32 > &  fltdata,
int  arraysize = 0 
)
bool CVEX_Value::setTypedData ( UT_Array< UT_Array< int64 > > &  intdata)
bool CVEX_Value::setTypedData ( UT_PackedArrayOfArrays< int64 > &  intdata,
int  arraysize = 0 
)
bool CVEX_Value::setTypedData ( UT_Array< UT_Array< fpreal64 > > &  fltdata)

This is stored as xyzxyzxyz for vector data.

bool CVEX_Value::setTypedData ( UT_PackedArrayOfArrays< fpreal64 > &  fltdata,
int  arraysize = 0 
)
bool CVEX_Value::setTypedData ( UT_Array< CVEX_StringArray > &  stringdata)
static CVEX_Type CVEX_Value::vexToCVexType ( VEX_Type  vextype,
bool  isarray 
)
static

Friends And Related Function Documentation

friend class CVEX_Context
friend

Definition at line 198 of file CVEX_Value.h.


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