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

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 VertexStoragecoarseVertex () const
 
const VertexStoragecoarseFaceVarying () const
 
const UT_Array< Vertex > & vertexArray () const
 
const UT_Array< Vertex > & facevaryingArray () const
 
const VertexStoragecoarseStorage () const
 
const VertexStoragefineStorage () const
 
const VertexStoragecoarseFVStorage () const
 
const VertexStoragefineFVStorage () const
 
template<typename T >
const TgetData (int attrib, int index, int seg) const
 
template<typename T >
const TgetDataFV (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
 

Detailed Description

Storage arrays for vertex data for opensubdiv classes.

Definition at line 336 of file GT_OSD3.h.

Member Typedef Documentation

using GT_OSDAttributes::AttribId = std::pair<int, bool>

Identifier for an attribute. The first item is the index in the attribute list, the second is whether it's a vertex or a point attribute.

Definition at line 342 of file GT_OSD3.h.

Constructor & Destructor Documentation

GT_OSDAttributes::GT_OSDAttributes ( )
GT_OSDAttributes::~GT_OSDAttributes ( )

Member Function Documentation

const VertexStorage& GT_OSDAttributes::coarseFaceVarying ( ) const
inline

Definition at line 552 of file GT_OSD3.h.

const VertexStorage& GT_OSDAttributes::coarseFVStorage ( ) const
inline

Definition at line 582 of file GT_OSD3.h.

const VertexStorage& GT_OSDAttributes::coarseStorage ( ) const
inline

Definition at line 580 of file GT_OSD3.h.

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.

const VertexStorage& GT_OSDAttributes::coarseVertex ( ) const
inline

Definition at line 550 of file GT_OSD3.h.

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

const UT_Array<Vertex>& GT_OSDAttributes::facevaryingArray ( ) const
inline

Definition at line 558 of file GT_OSD3.h.

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

int GT_OSDAttributes::fineFVOffset ( ) const
inline

Definition at line 621 of file GT_OSD3.h.

const VertexStorage& GT_OSDAttributes::fineFVStorage ( ) const
inline

Definition at line 583 of file GT_OSD3.h.

int GT_OSDAttributes::fineOffset ( ) const
inline

Definition at line 620 of file GT_OSD3.h.

const VertexStorage& GT_OSDAttributes::fineStorage ( ) const
inline

Definition at line 581 of file GT_OSD3.h.

template<typename T >
const T* GT_OSDAttributes::getData ( int  attrib,
int  index,
int  seg 
) const
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.

Definition at line 592 of file GT_OSD3.h.

template<typename T >
const T* GT_OSDAttributes::getDataFV ( int  attrib,
int  index,
int  seg 
) const
inline

Same idea as with getData, but with face varying data.

Definition at line 607 of file GT_OSD3.h.

exint GT_OSDAttributes::getMemoryUsage ( ) const
int GT_OSDAttributes::tupleSize ( const AttribId attrib) 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 
)
const UT_Array<Vertex>& GT_OSDAttributes::vertexArray ( ) const
inline

Definition at line 555 of file GT_OSD3.h.


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