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" 33 PXR_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;
240 PXR_NAMESPACE_CLOSE_SCOPE
242 #endif //PXR_IMAGING_HD_REPR_H 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 bool Contains(const TfToken &reprToken) const
Returns true if the passed in reprToken is in the set of tokens for any topology index.
void AddDrawItem(std::unique_ptr< HdDrawItem > &&item)
Transfers ownership of a draw item to this repr.
Token for efficient comparison, assignment, and hashing of known strings.
void ClearGeomSubsetDrawItems()
Removes all of the geom subset draw items from the repr.
const DrawItemUniquePtrVector & GetDrawItems() const
Returns the draw items for this representation.
A draw item is a light-weight representation of an HdRprim's resources and material to be used for re...
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...
Describes one or more authored display representations for an rprim.
HD_API bool AnyActiveRepr() const
Returns true if any of the topology tokens is valid, i.e., neither empty nor disabled.
HdDrawItem * GetDrawItemForGeomSubset(size_t reprDescIndex, size_t numGeomSubsets, size_t geomSubsetIndex) const
Utility similar to GetDrawItem for getting geom subset draw items.
HD_API HdReprSelector CompositeOver(const HdReprSelector &under) const
Returns a selector that is the composite of this selector 'over' the passed in selector.
static const size_t MAX_TOPOLOGY_REPRS
Currenly support upto 3 topology tokens.
HdDrawItem * GetDrawItem(size_t index) const
Returns the draw item at the requested index.
An HdRepr refers to a (single) topological representation of an rprim, and owns the draw item(s) that...