This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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...

#include <repr.h>

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.
 
void AddDrawItem (std::unique_ptr< HdDrawItem > &&item)
 Transfers ownership of a draw item to this repr.
 
HdDrawItemGetDrawItem (size_t index) const
 Returns the draw item at the requested index.
 
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.
 
HdDrawItemGetDrawItemForGeomSubset (size_t reprDescIndex, size_t numGeomSubsets, size_t geomSubsetIndex) const
 Utility similar to GetDrawItem for getting geom subset draw items.
 
void ClearGeomSubsetDrawItems ()
 Removes all of the geom subset draw items from the repr.
 

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 139 of file repr.h.

Member Typedef Documentation

◆ DrawItemUniquePtr

using DrawItemUniquePtr = std::unique_ptr<HdDrawItem>

Definition at line 142 of file repr.h.

◆ DrawItemUniquePtrVector

using DrawItemUniquePtrVector = std::vector<DrawItemUniquePtr>

Definition at line 143 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 157 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 191 of file repr.h.

◆ ClearGeomSubsetDrawItems()

void ClearGeomSubsetDrawItems ( )
inline

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

Definition at line 203 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 167 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 196 of file repr.h.

◆ GetDrawItems()

const DrawItemUniquePtrVector & GetDrawItems ( ) const
inline

Returns the draw items for this representation.

Definition at line 151 of file repr.h.


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