HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdRepr Class Referencefinal

#include <repr.h>

Public Types

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

Public Member Functions

HD_API HdRepr ()
 
HD_API ~HdRepr ()
 
const DrawItemUniquePtrVectorGetDrawItems () const
 Returns the draw items for this representation. More...
 
void AddDrawItem (std::unique_ptr< HdDrawItem > &&item)
 
HdDrawItemGetDrawItem (size_t index) const
 
void AddGeomSubsetDrawItem (std::unique_ptr< HdDrawItem > &&item)
 
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 Typedef Documentation

using HdRepr::DrawItemUniquePtr = std::unique_ptr<HdDrawItem>

Definition at line 159 of file repr.h.

Definition at line 160 of file repr.h.

Constructor & Destructor Documentation

HD_API HdRepr::HdRepr ( )
HD_API HdRepr::~HdRepr ( )

Member Function Documentation

void HdRepr::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.

void HdRepr::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.

void HdRepr::ClearGeomSubsetDrawItems ( )
inline

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

Definition at line 220 of file repr.h.

HdDrawItem* HdRepr::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.

HdDrawItem* HdRepr::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.

const DrawItemUniquePtrVector& HdRepr::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: