24 #ifndef PXR_IMAGING_HD_DRAW_ITEM_H 25 #define PXR_IMAGING_HD_DRAW_ITEM_H 28 #include "pxr/imaging/hd/api.h" 29 #include "pxr/imaging/hd/version.h" 30 #include "pxr/imaging/hd/perfLog.h" 31 #include "pxr/imaging/hd/drawingCoord.h" 32 #include "pxr/imaging/hd/rprimSharedData.h" 34 #include "pxr/imaging/hf/perfLog.h" 43 PXR_NAMESPACE_OPEN_SCOPE
68 HF_MALLOC_TAG_NEW(
"new HdDrawItem");
71 HdDrawItem(HdRprimSharedData
const *sharedData);
76 SdfPath const &GetRprimID()
const {
return _sharedData->rprimID; }
79 GfBBox3d const & GetBounds()
const {
return _sharedData->bounds; }
83 return _sharedData->bounds.GetRange();
88 return _sharedData->bounds.GetMatrix();
94 return _sharedData->barContainer.Get(
95 _drawingCoord.GetConstantPrimvarIndex());
101 TF_VERIFY(_sharedData->instancerLevels != -1);
102 return _sharedData->instancerLevels;
118 return _sharedData->barContainer.Get(
119 _drawingCoord.GetInstancePrimvarIndex(level));
125 return _sharedData->barContainer.Get(
126 _drawingCoord.GetInstanceIndexIndex());
132 return _sharedData->barContainer.Get(
133 _drawingCoord.GetElementPrimvarIndex());
139 return _sharedData->barContainer.Get(
140 _drawingCoord.GetTopologyIndex());
144 HdBufferArrayRangeSharedPtr
const &GetTopologyVisibilityRange()
const {
145 return _sharedData->barContainer.Get(
146 _drawingCoord.GetTopologyVisibilityIndex());
152 return _sharedData->barContainer.Get(
153 _drawingCoord.GetVertexPrimvarIndex());
159 return _sharedData->barContainer.Get(
160 _drawingCoord.GetVaryingPrimvarIndex());
167 return _sharedData->barContainer.Get(
168 _drawingCoord.GetFaceVaryingPrimvarIndex());
173 return &_drawingCoord;
181 TfToken const& GetMaterialTag()
const {
186 void SetMaterialTag(
TfToken const &materialTag) {
187 _materialTag = materialTag;
190 TopologyToPrimvarVector
const &GetFvarTopologyToPrimvarVector()
const {
191 return _sharedData->fvarTopologyToPrimvarVector;
197 TF_VERIFY(_sharedData->instancerLevels != -1);
198 return (_sharedData->instancerLevels > 0);
224 friend std::ostream &operator <<(std::ostream &out,
229 template <
class HashState>
230 friend void TfHashAppend(HashState &h,
HdDrawItem const &di);
257 HdRprimSharedData
const *_sharedData;
267 PXR_NAMESPACE_CLOSE_SCOPE
269 #endif //PXR_IMAGING_HD_DRAW_ITEM_H HD_API bool GetVisible() const
Returns the authored visibility, expressed by the delegate.
HD_API HdBufferArrayRangeSharedPtr const & GetInstanceIndexRange() const
Returns a BufferRange of instance-index indirection.
HD_API HdBufferArrayRangeSharedPtr const & GetElementPrimvarRange() const
Returns a BufferRange of element-Primvars.
Basic type: 3-dimensional floating point range.
virtual HD_API size_t _GetElementOffsetsHash() const
Allows derived classes to return a hash of the element offsets of the underlying BARs they manage.
HD_API size_t GetElementOffsetsHash() const
Returns the hash of the element offsets of the underlying BARs.
HD_API int GetInstancePrimvarNumLevels() const
Returns the number of nested levels of instance primvars.
HD_API HdBufferArrayRangeSharedPtr const & GetTopologyRange() const
Returns a BufferArrayRange of topology.
HD_API HdRprimSharedData const * _GetSharedData() const
Returns the shared data.
HD_API size_t GetBufferArraysHash() const
Returns the hash of the versions of underlying buffers.
Token for efficient comparison, assignment, and hashing of known strings.
HD_API HdBufferArrayRangeSharedPtr const & GetConstantPrimvarRange() const
Returns a BufferRange of constant-Primvar.
Stores a 4x4 matrix of double elements.
#define TF_VERIFY(cond, format,...)
Checks a condition and reports an error if it evaluates false.
A tiny set of integers, which provides an indirection mapping from the conceptual space of an HdRprim...
A path value used to locate objects in layers or scenegraphs.
HD_API HdBufferArrayRangeSharedPtr const & GetVertexPrimvarRange() const
Returns a BufferArrayRange of vertex-primvars.
virtual HD_API size_t _GetBufferArraysHash() const
Allows derived classes to return a hash of the versions of buffers they manage.
A draw item is a light-weight representation of an HdRprim's resources and material to be used for re...
HD_API bool IntersectsViewVolume(GfMatrix4d const &viewProjMatrix) const
Tests the intersection with the view projection matrix.
HD_API HdBufferArrayRangeSharedPtr const & GetFaceVaryingPrimvarRange() const
Returns a BufferArrayRange of face-varying primvars.
HD_API HdBufferArrayRangeSharedPtr const & GetVaryingPrimvarRange() const
Returns a BufferArrayRange of varying primvars.
HD_API HdBufferArrayRangeSharedPtr const & GetInstancePrimvarRange(int level) const
Returns a BufferRange of instance-Primvars at level the level is assigned to nested instancers in a b...
Basic type: arbitrarily oriented 3D bounding box.
HD_API bool HasInstancer() const
Returns true if the drawItem has instancer.