CVEX_Value Class Reference

A class representing a VEX value. More...

#include <CVEX_Value.h>

List of all members.

Public Member Functions

 CVEX_Value (const char *name, CVEX_Type type, bool varying)
 ~CVEX_Value ()
const char * getName () const
 Query name of VEX value.
CVEX_Type getType () const
 Query type of VEX value.
bool isExport () const
 Query whether the VEX value is an export (or read-only).
bool isVarying () const
 Query whether the VEX value is uniform or varying.
int getArraySize () const
void * getData ()
bool setData (void *data, int array_size)
bool setData (UT_StringArray &stringdata)

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 43 of file CVEX_Value.h.


Constructor & Destructor Documentation

CVEX_Value::CVEX_Value ( const char *  name,
CVEX_Type  type,
bool  varying 
)

CVEX_Value::~CVEX_Value (  ) 


Member Function Documentation

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 59 of file CVEX_Value.h.

void* CVEX_Value::getData (  )  [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_VECTOR3 UT_Vector3
  • CVEX_TYPE_VECTOR4 UT_Vector4
  • CVEX_TYPE_MATRIX3 UT_Matrix3
  • CVEX_TYPE_MATRIX4 UT_Matrix4 For CVEX_TYPE_STRING, the data will point to a UT_StringArray.
Examples:
CVEX/cvexsample.C.

Definition at line 71 of file CVEX_Value.h.

const char* CVEX_Value::getName ( void   )  const [inline]

Query name of VEX value.

Examples:
CVEX/cvexsample.C.

Definition at line 49 of file CVEX_Value.h.

CVEX_Type CVEX_Value::getType (  )  const [inline]

Query type of VEX value.

Examples:
CVEX/cvexsample.C.

Definition at line 51 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 53 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 55 of file CVEX_Value.h.

bool CVEX_Value::setData ( UT_StringArray stringdata  ) 

When setting values for string types, you need to pass in a UT_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 UT_StringArray, so the data must be persistent.

bool CVEX_Value::setData ( void *  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 UT_StringArray, so the data must be persistent.

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


Friends And Related Function Documentation

friend class CVEX_Context [friend]

Definition at line 107 of file CVEX_Value.h.


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

Generated on Mon Jan 28 00:48:10 2013 for HDK by  doxygen 1.5.9