7#ifndef PXR_IMAGING_HD_REPR_H
8#define PXR_IMAGING_HD_REPR_H
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/drawItem.h"
13#include "pxr/imaging/hd/tokens.h"
16PXR_NAMESPACE_OPEN_SCOPE
47 : refinedToken(refined)
48 , unrefinedToken(unrefined)
55 : refinedToken(refined)
56 , unrefinedToken(unrefined)
57 , pointsToken(points) { }
99 char const* GetText()
const;
102 friend std::ostream &operator <<(std::ostream &stream,
107 TfToken const &operator[](
size_t topologyIndex)
const;
111 template <
class HashState>
114 h.Append(rs.refinedToken, rs.unrefinedToken, rs.pointsToken);
142 using DrawItemUniquePtr = std::unique_ptr<HdDrawItem>;
143 using DrawItemUniquePtrVector = std::vector<DrawItemUniquePtr>;
158 _drawItems.insert(_drawItems.begin() + _geomSubsetsStart,
168 return _drawItems[index].get();
192 _drawItems.push_back(std::move(item));
197 size_t numGeomSubsets,
size_t geomSubsetIndex)
const {
198 return _drawItems[_geomSubsetsStart + reprDescIndex * numGeomSubsets +
199 geomSubsetIndex].get();
205 _drawItems.begin() + _geomSubsetsStart, _drawItems.end());
216 DrawItemUniquePtrVector _drawItems;
219 size_t _geomSubsetsStart;
223PXR_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.