HDK
|
Storage arrays for vertex data for opensubdiv classes. More...
#include <GT_OSD3.h>
Classes | |
class | Vertex |
class | VertexStorage |
Public Types | |
using | AttribId = std::pair< int, bool > |
Public Member Functions | |
GT_OSDAttributes () | |
~GT_OSDAttributes () | |
void | dump () const |
void | dump (UT_JSONWriter &w) const |
exint | getMemoryUsage () const |
bool | create (const GT_OSDTopology &topology, const GT_PrimPolygonMesh &mesh, const GT_OSDPatchTable *table=nullptr) |
bool | update (const GT_OSDTopology &topology, const GT_PrimPolygonMesh &mesh, bool skip_equality_check=false) |
GT_PrimitiveHandle | extractMesh (const GT_OSDTopology &topology, bool harden, int level=-1) |
Extract a subdivided mesh for the given topology level. More... | |
GT_AttributeListHandle | extractShared (const GT_OSDTopology &top, int level_index, bool harden) const |
GT_AttributeListHandle | extractVertex (const GT_OSDTopology &top, int level_index, bool harden) const |
GT_AttributeListHandle | extractUniform (const GT_OSDTopology &top, int level_index, bool harden) const |
GT_FaceSetMapPtr | extractFaceSets (const GT_OSDTopology &top, int level_index) const |
Extract a face map set for a mesh at the given refinement level. More... | |
GT_DataArrayHandle | extractFaceMap (const GT_OSDTopology &top, int level_index) const |
int | tupleSize (const AttribId &attrib) const |
Return the size of a given attribute. More... | |
bool | coarseValues (const AttribId &attrib, const GT_Size *vertices, GT_Size nvtx, UT_Vector2 *values, int seg) const |
Extract attributes on the coarse mesh. More... | |
const VertexStorage & | coarseVertex () const |
const VertexStorage & | coarseFaceVarying () const |
const UT_Array< Vertex > & | vertexArray () const |
const UT_Array< Vertex > & | facevaryingArray () const |
const VertexStorage & | coarseStorage () const |
const VertexStorage & | fineStorage () const |
const VertexStorage & | coarseFVStorage () const |
const VertexStorage & | fineFVStorage () const |
template<typename T > | |
const T * | getData (int attrib, int index, int seg) const |
template<typename T > | |
const T * | getDataFV (int attrib, int index, int seg) const |
Same idea as with getData, but with face varying data. More... | |
int | fineOffset () const |
int | fineFVOffset () const |
AttribId | findAttribute (const char *name) const |
AttribId | findAttribute (const char *name, bool vertex_attrib) const |
using GT_OSDAttributes::AttribId = std::pair<int, bool> |
GT_OSDAttributes::GT_OSDAttributes | ( | ) |
GT_OSDAttributes::~GT_OSDAttributes | ( | ) |
|
inline |
|
inline |
|
inline |
bool GT_OSDAttributes::coarseValues | ( | const AttribId & | attrib, |
const GT_Size * | vertices, | ||
GT_Size | nvtx, | ||
UT_Vector2 * | values, | ||
int | seg | ||
) | const |
Extract attributes on the coarse mesh.
|
inline |
bool GT_OSDAttributes::create | ( | const GT_OSDTopology & | topology, |
const GT_PrimPolygonMesh & | mesh, | ||
const GT_OSDPatchTable * | table = nullptr |
||
) |
void GT_OSDAttributes::dump | ( | ) | const |
void GT_OSDAttributes::dump | ( | UT_JSONWriter & | w | ) | const |
GT_DataArrayHandle GT_OSDAttributes::extractFaceMap | ( | const GT_OSDTopology & | top, |
int | level_index | ||
) | const |
Extract a mapping from fine faces at a given refinement level to its corresponding coarse face
GT_FaceSetMapPtr GT_OSDAttributes::extractFaceSets | ( | const GT_OSDTopology & | top, |
int | level_index | ||
) | const |
Extract a face map set for a mesh at the given refinement level.
GT_PrimitiveHandle GT_OSDAttributes::extractMesh | ( | const GT_OSDTopology & | topology, |
bool | harden, | ||
int | level = -1 |
||
) |
Extract a subdivided mesh for the given topology level.
GT_AttributeListHandle GT_OSDAttributes::extractShared | ( | const GT_OSDTopology & | top, |
int | level_index, | ||
bool | harden | ||
) | const |
Extract the shared/point attributes for a mesh at the given refinement level. If harden
is false
, the attributes lists will point to the temporary buffers (which are over-sized). Passing true
to harden
will copy out the temporary data into compact arrays.
GT_AttributeListHandle GT_OSDAttributes::extractUniform | ( | const GT_OSDTopology & | top, |
int | level_index, | ||
bool | harden | ||
) | const |
Extract the primitive/face attributes for a mesh at the given refinement level.
GT_AttributeListHandle GT_OSDAttributes::extractVertex | ( | const GT_OSDTopology & | top, |
int | level_index, | ||
bool | harden | ||
) | const |
Extract the vertex/face-varying attributes for a mesh at the given refinement level. See extractShared
for help on harden
AttribId GT_OSDAttributes::findAttribute | ( | const char * | name | ) | const |
Find an attribute
AttribId GT_OSDAttributes::findAttribute | ( | const char * | name, |
bool | vertex_attrib | ||
) | const |
Find an attribute
|
inline |
|
inline |
|
inline |
Return a pointer to the index-th entry in the given attribute array. If the index exceeds or equals the number of coarse vertices (myFineOffset), then the data is located in the fine attribute array. The first element of the fine attribute array has index equal to myFineOffset, so we do pointer arithmetic to shift the array by myFineOffset entries.
exint GT_OSDAttributes::getMemoryUsage | ( | ) | const |
Return the size of a given attribute.
bool GT_OSDAttributes::update | ( | const GT_OSDTopology & | topology, |
const GT_PrimPolygonMesh & | mesh, | ||
bool | skip_equality_check = false |
||
) |