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>;
174 _drawItems.push_back(std::move(item));
182 return _drawItems[index].get();
187 HdRepr(
const HdRepr&) =
delete;
188 HdRepr& operator=(
const HdRepr&) =
delete;
191 DrawItemUniquePtrVector _drawItems;
195 PXR_NAMESPACE_CLOSE_SCOPE
197 #endif //PXR_IMAGING_HD_REPR_H
void AddDrawItem(std::unique_ptr< HdDrawItem > &&item)
Transfers ownership of a draw item to this repr.
const DrawItemUniquePtrVector & GetDrawItems() const
Returns the draw items for this representation.
Token for efficient comparison, assignment, and hashing of known strings.
HD_API bool AnyActiveRepr() const
Returns true if any of the topology tokens is valid, i.e., neither empty nor disabled.
A draw item is a light-weight representation of an HdRprim's resources and material to be used for re...
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...
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 Contains(const TfToken &reprToken) const
Returns true if the passed in reprToken is in the set of tokens for any topology index.
HD_API HdReprSelector CompositeOver(const HdReprSelector &under) const
Returns a selector that is the composite of this selector 'over' the passed in selector.
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...