HdRepr Class Referencefinal

An HdRepr refers to a (single) topological representation of an rprim, and owns the draw item(s) that visually represent it. More...

Public Types

using DrawItemUniquePtr = std::unique_ptr< HdDrawItem >
 
using DrawItemUniquePtrVector = std::vector< DrawItemUniquePtr >
 

Public Member Functions

const DrawItemUniquePtrVector & GetDrawItems () const
 Returns the draw items for this representation. More...
 
void AddDrawItem (std::unique_ptr< HdDrawItem > &&item)
 Transfers ownership of a draw item to this repr. More...
 
HdDrawItemGetDrawItem (size_t index) const
 Returns the draw item at the requested index. More...
 
void AddGeomSubsetDrawItem (std::unique_ptr< HdDrawItem > &&item)
 HdRepr can hold geom subset draw items, which are unique in that they not created at the time the repr is created, but instead when populating the mesh topology of a mesh rprim. More...
 
HdDrawItemGetDrawItemForGeomSubset (size_t reprDescIndex, size_t numGeomSubsets, size_t geomSubsetIndex) const
 Utility similar to GetDrawItem for getting geom subset draw items. More...
 
void ClearGeomSubsetDrawItems ()
 Removes all of the geom subset draw items from the repr. More...
 

Detailed Description

An HdRepr refers to a (single) topological representation of an rprim, and owns the draw item(s) that visually represent it.

The draw items are populated by the rprim. The relevant compositional hierarchy is:

HdRprim | +–HdRepr(s) | +–HdDrawItem(s)

When multiple topological representations are required for an rprim, we use HdReprSelector to compose the individual representations.

Definition at line 156 of file repr.h.

Member Function Documentation

◆ AddDrawItem()

void AddDrawItem ( std::unique_ptr< HdDrawItem > &&  item)
inline

Transfers ownership of a draw item to this repr.

Do not use for adding geom subset draw items.

Definition at line 174 of file repr.h.

◆ AddGeomSubsetDrawItem()

void AddGeomSubsetDrawItem ( std::unique_ptr< HdDrawItem > &&  item)
inline

HdRepr can hold geom subset draw items, which are unique in that they not created at the time the repr is created, but instead when populating the mesh topology of a mesh rprim.

The number of geom subset draw items in a repr can change over time. We make some assumptions when using these geom subset related functions. We assume the geom subset draw items will only be added (or cleared) after all of the main draw items for a repr have been added. We also assume that the geom subset draw items for a repr desc are all added one after the other before moving onto the next repr desc. Thus the order of draw items in the _drawItems member might go something like (assuming two repr descs and three geom subsets in this example): [ main DI for desc 1, main DI for desc 2, GS1 DI for desc 1, GS2 DI for desc 1, GS3 DI for desc 1, GS1 DI for desc 2, GS2 DI for desc 2, GS3 DI for desc 2 ] It is also possible for there to exist a main draw item for a particular repr desc but no geom subsets for that repr desc, while having geom subsets exist for a different repr desc. Transfers ownership of a draw item to this repr. To be used only for geom subset draw items.

Definition at line 208 of file repr.h.

◆ ClearGeomSubsetDrawItems()

void ClearGeomSubsetDrawItems ( )
inline

Removes all of the geom subset draw items from the repr.

Definition at line 220 of file repr.h.

◆ GetDrawItem()

HdDrawItem* GetDrawItem ( size_t  index) const
inline

Returns the draw item at the requested index.

Note that the pointer returned is owned by this object and must not be deleted.

Definition at line 184 of file repr.h.

◆ GetDrawItemForGeomSubset()

HdDrawItem* GetDrawItemForGeomSubset ( size_t  reprDescIndex,
size_t  numGeomSubsets,
size_t  geomSubsetIndex 
) const
inline

Utility similar to GetDrawItem for getting geom subset draw items.

Definition at line 213 of file repr.h.

◆ GetDrawItems()

const DrawItemUniquePtrVector& GetDrawItems ( ) const
inline

Returns the draw items for this representation.

Definition at line 168 of file repr.h.


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