24#ifndef PXR_IMAGING_HD_REPR_H
25#define PXR_IMAGING_HD_REPR_H
28#include "pxr/imaging/hd/api.h"
29#include "pxr/imaging/hd/drawItem.h"
30#include "pxr/imaging/hd/tokens.h"
33PXR_NAMESPACE_OPEN_SCOPE
64 : refinedToken(refined)
65 , unrefinedToken(unrefined)
72 : refinedToken(refined)
73 , unrefinedToken(unrefined)
74 , pointsToken(points) { }
116 char const* GetText()
const;
119 friend std::ostream &operator <<(std::ostream &stream,
124 TfToken const &operator[](
size_t topologyIndex)
const;
128 template <
class HashState>
131 h.Append(rs.refinedToken, rs.unrefinedToken, rs.pointsToken);
159 using DrawItemUniquePtr = std::unique_ptr<HdDrawItem>;
160 using DrawItemUniquePtrVector = std::vector<DrawItemUniquePtr>;
175 _drawItems.insert(_drawItems.begin() + _geomSubsetsStart,
185 return _drawItems[index].get();
209 _drawItems.push_back(std::move(item));
214 size_t numGeomSubsets,
size_t geomSubsetIndex)
const {
215 return _drawItems[_geomSubsetsStart + reprDescIndex * numGeomSubsets +
216 geomSubsetIndex].get();
222 _drawItems.begin() + _geomSubsetsStart, _drawItems.end());
233 DrawItemUniquePtrVector _drawItems;
236 size_t _geomSubsetsStart;
240PXR_NAMESPACE_CLOSE_SCOPE
A draw item is a light-weight representation of an HdRprim's resources and material to be used for re...
An HdRepr refers to a (single) topological representation of an rprim, and owns the draw item(s) that...
void ClearGeomSubsetDrawItems()
Removes all of the geom subset draw items from the repr.
void AddDrawItem(std::unique_ptr< HdDrawItem > &&item)
Transfers ownership of a draw item to this repr.
HdDrawItem * GetDrawItem(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 rep...
const DrawItemUniquePtrVector & GetDrawItems() const
Returns the draw items for this representation.
HdDrawItem * GetDrawItemForGeomSubset(size_t reprDescIndex, size_t numGeomSubsets, size_t geomSubsetIndex) const
Utility similar to GetDrawItem for getting geom subset draw items.
Describes one or more authored display representations for an rprim.
static const size_t MAX_TOPOLOGY_REPRS
Currenly support upto 3 topology tokens.
HD_API bool AnyActiveRepr() const
Returns true if any of the topology tokens is valid, i.e., neither empty nor disabled.
HD_API bool IsActiveRepr(size_t topologyIndex) const
Returns true if the topology token at an index is active, i.e., neither empty nor disabled.
HD_API HdReprSelector CompositeOver(const HdReprSelector &under) const
Returns a selector that is the composite of this selector 'over' the passed in selector.
HD_API bool Contains(const TfToken &reprToken) const
Returns true if the passed in reprToken is in the set of tokens for any topology index.
Token for efficient comparison, assignment, and hashing of known strings.