HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdDrawItem Class Reference

#include <drawItem.h>

+ Inheritance diagram for HdDrawItem:

Public Member Functions

 HF_MALLOC_TAG_NEW ("new HdDrawItem")
 
HD_API HdDrawItem (HdRprimSharedData const *sharedData)
 
virtual HD_API ~HdDrawItem ()
 
HD_API SdfPath constGetRprimID () const
 
HD_API GfBBox3d constGetBounds () const
 
HD_API GfRange3d constGetExtent () const
 
HD_API GfMatrix4d constGetMatrix () const
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetConstantPrimvarRange () const
 Returns a BufferRange of constant-Primvar. More...
 
HD_API int GetInstancePrimvarNumLevels () const
 Returns the number of nested levels of instance primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetInstancePrimvarRange (int level) const
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetInstanceIndexRange () const
 Returns a BufferRange of instance-index indirection. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetElementPrimvarRange () const
 Returns a BufferRange of element-Primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetTopologyRange () const
 Returns a BufferArrayRange of topology. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetTopologyVisibilityRange () const
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetVertexPrimvarRange () const
 Returns a BufferArrayRange of vertex-primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetVaryingPrimvarRange () const
 Returns a BufferArrayRange of varying primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const
GetFaceVaryingPrimvarRange () const
 Returns a BufferArrayRange of face-varying primvars. More...
 
HD_API HdDrawingCoordGetDrawingCoord ()
 
HD_API bool GetVisible () const
 Returns the authored visibility, expressed by the delegate. More...
 
HD_API TfToken constGetMaterialTag () const
 
TopologyToPrimvarVector constGetFvarTopologyToPrimvarVector () const
 
HD_API bool HasInstancer () const
 Returns true if the drawItem has instancer. More...
 
HD_API size_t GetBufferArraysHash () const
 
HD_API size_t GetElementOffsetsHash () const
 
HD_API bool IntersectsViewVolume (GfMatrix4d const &viewProjMatrix) const
 

Protected Member Functions

HD_API HdRprimSharedData const_GetSharedData () const
 Returns the shared data. More...
 
virtual HD_API size_t _GetBufferArraysHash () const
 
virtual HD_API size_t _GetElementOffsetsHash () const
 

Friends

HD_API friend std::ostream & operator<< (std::ostream &out, const HdDrawItem &self)
 
template<class HashState >
void TfHashAppend (HashState &h, HdDrawItem const &di)
 

Detailed Description

A draw item is a light-weight representation of an HdRprim's resources and material to be used for rendering. The visual representation (HdRepr) of an HdRprim might require multiple draw items.

HdDrawItem(s) are created by the HdRprim (HdMesh, HdBasisCurve, ..) for each HdRepr. The relevant compositional hierarchy is:

HdRprim | +–HdRepr(s) | +–HdDrawItem(s)

HdDrawItem(s) are consumed by HdRenderPass for its HdRprimCollection via HdRenderIndex::GetDrawItems.

Note
Rendering backends may choose to specialize this class.

Definition at line 66 of file drawItem.h.

Constructor & Destructor Documentation

HD_API HdDrawItem::HdDrawItem ( HdRprimSharedData const sharedData)
virtual HD_API HdDrawItem::~HdDrawItem ( )
virtual

Member Function Documentation

virtual HD_API size_t HdDrawItem::_GetBufferArraysHash ( ) const
protectedvirtual

Allows derived classes to return a hash of the versions of buffers they manage. Called by GetBufferArraysHash.

Reimplemented in HdStDrawItem.

virtual HD_API size_t HdDrawItem::_GetElementOffsetsHash ( ) const
protectedvirtual

Allows derived classes to return a hash of the element offsets of the underlying BARs they manage. Called by GetBufferArraysHash.

Reimplemented in HdStDrawItem.

HD_API HdRprimSharedData const* HdDrawItem::_GetSharedData ( ) const
inlineprotected

Returns the shared data.

Definition at line 229 of file drawItem.h.

HD_API GfBBox3d const& HdDrawItem::GetBounds ( ) const
inline

Definition at line 79 of file drawItem.h.

HD_API size_t HdDrawItem::GetBufferArraysHash ( ) const

Returns the hash of the versions of underlying buffers. When the hash changes, it means the drawing coord might have been reassigned, so any drawing coord caching buffer (e.g. indirect dispatch buffer) has to be rebuilt at the moment. Note that this value is a hash, not sequential.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetConstantPrimvarRange ( ) const
inline

Returns a BufferRange of constant-Primvar.

Definition at line 93 of file drawItem.h.

HD_API HdDrawingCoord* HdDrawItem::GetDrawingCoord ( )
inline

Definition at line 172 of file drawItem.h.

HD_API size_t HdDrawItem::GetElementOffsetsHash ( ) const

Returns the hash of the element offsets of the underlying BARs. When the hash changes, it means that any drawing coord caching buffer (e.g. the indirect dispatch buffer) has to be rebuilt. Note that this value is a hash, not sequential.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetElementPrimvarRange ( ) const
inline

Returns a BufferRange of element-Primvars.

Definition at line 131 of file drawItem.h.

HD_API GfRange3d const& HdDrawItem::GetExtent ( ) const
inline

Definition at line 82 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetFaceVaryingPrimvarRange ( ) const
inline

Returns a BufferArrayRange of face-varying primvars.

Definition at line 166 of file drawItem.h.

TopologyToPrimvarVector const& HdDrawItem::GetFvarTopologyToPrimvarVector ( ) const
inline

Definition at line 185 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetInstanceIndexRange ( ) const
inline

Returns a BufferRange of instance-index indirection.

Definition at line 124 of file drawItem.h.

HD_API int HdDrawItem::GetInstancePrimvarNumLevels ( ) const
inline

Returns the number of nested levels of instance primvars.

Definition at line 100 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetInstancePrimvarRange ( int  level) const
inline

Returns a BufferRange of instance-Primvars at level the level is assigned to nested instancers in a bottom-up manner.

example: (numLevels = 2)

instancerA         (level = 1)
  |
  +-- instancerB   (level = 0)
        |
        +-- mesh_prototype

Definition at line 117 of file drawItem.h.

HD_API TfToken const& HdDrawItem::GetMaterialTag ( ) const
inline

Definition at line 181 of file drawItem.h.

HD_API GfMatrix4d const& HdDrawItem::GetMatrix ( ) const
inline

Definition at line 87 of file drawItem.h.

HD_API SdfPath const& HdDrawItem::GetRprimID ( ) const
inline

Definition at line 76 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetTopologyRange ( ) const
inline

Returns a BufferArrayRange of topology.

Definition at line 138 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetTopologyVisibilityRange ( ) const
inline

Definition at line 144 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetVaryingPrimvarRange ( ) const
inline

Returns a BufferArrayRange of varying primvars.

Definition at line 158 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& HdDrawItem::GetVertexPrimvarRange ( ) const
inline

Returns a BufferArrayRange of vertex-primvars.

Definition at line 151 of file drawItem.h.

HD_API bool HdDrawItem::GetVisible ( ) const
inline

Returns the authored visibility, expressed by the delegate.

Definition at line 178 of file drawItem.h.

HD_API bool HdDrawItem::HasInstancer ( ) const
inline

Returns true if the drawItem has instancer.

Definition at line 191 of file drawItem.h.

HdDrawItem::HF_MALLOC_TAG_NEW ( "new HdDrawItem )
HD_API bool HdDrawItem::IntersectsViewVolume ( GfMatrix4d const viewProjMatrix) const

Tests the intersection with the view projection matrix. Returns true if this drawItem is in the frustum.

XXX: Currently if this drawitem uses HW instancing, always returns true.

Friends And Related Function Documentation

HD_API friend std::ostream& operator<< ( std::ostream &  out,
const HdDrawItem self 
)
friend
template<class HashState >
void TfHashAppend ( HashState &  h,
HdDrawItem const di 
)
friend

The documentation for this class was generated from the following file: