Cortex
10.0.0-a4
|
#include <PrimitiveVariable.h>
Public Types | |
enum | Interpolation { Invalid, Constant, Uniform, Vertex, Varying, FaceVarying } |
Public Member Functions | |
PrimitiveVariable () | |
PrimitiveVariable (Interpolation i, DataPtr d) | |
Constructor - Data is not copied but referenced directly. | |
PrimitiveVariable (Interpolation i, DataPtr d, IntVectorDataPtr indices) | |
Constructor - Data is not copied but referenced directly. | |
PrimitiveVariable (const PrimitiveVariable &other) | |
Shallow copy constructor - data is not copied just rereferenced. | |
PrimitiveVariable (const PrimitiveVariable &other, bool deepCopy) | |
bool | operator== (const PrimitiveVariable &other) const |
bool | operator!= (const PrimitiveVariable &other) const |
DataPtr | expandedData () const |
Public Attributes | |
Interpolation | interpolation |
The interpolation type for this PrimitiveVariable. | |
DataPtr | data |
IntVectorDataPtr | indices |
The PrimitiveVariable defines a simple structure to store primitive variables to be used by the Renderer and Primitive classes.
The Interpolation enum is used to describe how the values of a Variable are to be interpolated across the surface of a Primitive. The types are essentially those defined in the RenderMan standard.
IECore::PrimitiveVariable::PrimitiveVariable | ( | ) |
Constructs a PrimitiveVariable with Interpolation type Invalid and a null data pointer. This allows the [] operator to work in the PrimitiveVariableMap, but you must be careful to use it only for assignment or reading of entries you /know/ exist, otherwise you're inadvertently populating the map with invalid PrimitiveVariables. This is a problem with the map [] operator generally but it's worth noting as it's likely to appear here.
IECore::PrimitiveVariable::PrimitiveVariable | ( | const PrimitiveVariable & | other, |
bool | deepCopy | ||
) |
Copy constructor which optionally allows a deep copy of data to be taken.
DataPtr IECore::PrimitiveVariable::expandedData | ( | ) | const |
Use expandedData() to expand indices if they exist. If the variable is not indexed, a direct copy will be returned.
DataPtr IECore::PrimitiveVariable::data |
The Data for this PrimitiveVariable. Unless Interpolation is Constant, Variable data is expected to be one of the types defined in VectorTypedData.h. Constant interpolated data can be represented by any type of Data.
IntVectorDataPtr IECore::PrimitiveVariable::indices |
Optional indices array into the primary Data. This can be used to store a more compact representation of the data, for example a constant list of strings which are mapped to Vertex, Uniform, or FaceVarying via the indices. Similarly, UV sets can store an array of unique UVs in data and map them to FaceVarying using the indices.