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

#include <rprimCollection.h>

Classes

struct  Hash
 

Public Member Functions

HD_API HdRprimCollection ()
 
HD_API HdRprimCollection (TfToken const &name, HdReprSelector const &reprSelector, bool forcedRepr=false, TfToken const &materialTag=TfToken())
 
HD_API HdRprimCollection (TfToken const &name, HdReprSelector const &reprSelector, SdfPath const &rootPath, bool forcedRepr=false, TfToken const &materialTag=TfToken())
 
HD_API HdRprimCollection (HdRprimCollection const &col)
 Copy constructor. More...
 
virtual HD_API ~HdRprimCollection ()
 
HD_API HdRprimCollection CreateInverseCollection () const
 
TfToken constGetName () const
 
void SetName (TfToken const &name)
 Sets the semantic name of this collection. More...
 
HdReprSelector constGetReprSelector () const
 
void SetReprSelector (HdReprSelector const &reprSelector)
 
bool IsForcedRepr () const
 
void SetForcedRepr (bool flag)
 
HD_API SdfPathVector constGetRootPaths () const
 
HD_API void SetRootPaths (SdfPathVector const &rootPaths)
 
HD_API void SetRootPath (SdfPath const &rootPath)
 
HD_API void SetExcludePaths (SdfPathVector const &excludePaths)
 
HD_API SdfPathVector constGetExcludePaths () const
 
HD_API void SetMaterialTag (TfToken const &tag)
 
HD_API TfToken constGetMaterialTag () const
 
HD_API size_t ComputeHash () const
 
HD_API bool operator== (HdRprimCollection const &lhs) const
 
HD_API bool operator!= (HdRprimCollection const &lhs) const
 

Friends

HD_API friend std::ostream & operator<< (std::ostream &out, HdRprimCollection const &v)
 

Detailed Description

A named, semantic collection of objects.

Note that the collection object itself doesn't hold HdRprim objects, rather it acts as an addressing mechanism to identify a specific group of HdRprim objects that can be requested from the HdRenderIndex.

HdDirtyList provides the above algorithmic functionality, while HdRenderPass uses HdRprimCollection to concisely represent the HdRprim's it operates on.

See Also
HdRenderPass HdDirtyList

Definition at line 54 of file rprimCollection.h.

Constructor & Destructor Documentation

HD_API HdRprimCollection::HdRprimCollection ( )
HD_API HdRprimCollection::HdRprimCollection ( TfToken const name,
HdReprSelector const reprSelector,
bool  forcedRepr = false,
TfToken const materialTag = TfToken() 
)

Constructs an rprim collection with reprSelector. if forcedRepr is set to true, prims authored repr will be ignored. If materialTag is provided, only prims who's material have a matching tag will end up in the collection. This can be used to make seperate collections for e.g. opaque vs translucent prims. An empty materialTag opts-out of using material tags entirely and will return all prims in the collection, regardless of their material tags.

HD_API HdRprimCollection::HdRprimCollection ( TfToken const name,
HdReprSelector const reprSelector,
SdfPath const rootPath,
bool  forcedRepr = false,
TfToken const materialTag = TfToken() 
)

Constructs an rprim collection, excluding all Rprims not prefixed by rootPath. if forcedRepr is set to true, prims authored repr will be ignored. If materialTag is provided, only prims who's material have a matching tag will end up in the collection. This can be used to make seperate collections for e.g. opaque vs translucent prims. An empty materialTag opts-out of using material tags entirely and will return all prims in the collection, regardless of their material tags.

HD_API HdRprimCollection::HdRprimCollection ( HdRprimCollection const col)

Copy constructor.

virtual HD_API HdRprimCollection::~HdRprimCollection ( )
virtual

Member Function Documentation

HD_API size_t HdRprimCollection::ComputeHash ( ) const
HD_API HdRprimCollection HdRprimCollection::CreateInverseCollection ( ) const

Constructs and returns a collection with the root and exclude paths swapped.

HD_API SdfPathVector const& HdRprimCollection::GetExcludePaths ( ) const

Returns the excluded paths

Note that this vector is always sorted.

HD_API TfToken const& HdRprimCollection::GetMaterialTag ( ) const
TfToken const& HdRprimCollection::GetName ( ) const
inline

Returns the semantic name of this collection.

The semantic name represents the entire collection of prims, for example "visible", "selected", etc.

Definition at line 104 of file rprimCollection.h.

HdReprSelector const& HdRprimCollection::GetReprSelector ( ) const
inline

Returns the representation name.

The repr selector corresponds to specific aspects of the requested set of Rprims, for example one can request "hullAndPoints" repr which would cause both the hull and points representations of all prims named by the collection to be included.

Definition at line 119 of file rprimCollection.h.

HD_API SdfPathVector const& HdRprimCollection::GetRootPaths ( ) const

Returns the paths at which all Rprims must be rooted to be included in this collection. Defaults to a vector containing only SdfPath::AbsoluteRootPath().

Note that this vector is always sorted.

bool HdRprimCollection::IsForcedRepr ( ) const
inline

Definition at line 127 of file rprimCollection.h.

HD_API bool HdRprimCollection::operator== ( HdRprimCollection const lhs) const
HD_API void HdRprimCollection::SetExcludePaths ( SdfPathVector const excludePaths)

Sets all exclude paths for this collection. All paths must be absolute. Duplicate paths are allowed, but may result in performance degradation.

void HdRprimCollection::SetForcedRepr ( bool  flag)
inline

Definition at line 131 of file rprimCollection.h.

HD_API void HdRprimCollection::SetMaterialTag ( TfToken const tag)

A MaterialTag can be used to ensure only prims whos material have a matching tag will end up in the collection. Different rendering backends can control what material properties are useful for splitting up collections. For example, when Stream finds the 'translucent' MaterialTag in a material it will transfer this tag onto the prim's DrawItem. This ensures that opaque and translucent prims end up in different collections so they can be rendered seperately. A path-tracer backend may find the translucent MaterialTag on a material and choose NOT to transfer the tag onto the DrawItem because the backend wants to render opaque and translucent prims in the same collection.

void HdRprimCollection::SetName ( TfToken const name)
inline

Sets the semantic name of this collection.

Definition at line 109 of file rprimCollection.h.

void HdRprimCollection::SetReprSelector ( HdReprSelector const reprSelector)
inline

Definition at line 123 of file rprimCollection.h.

HD_API void HdRprimCollection::SetRootPath ( SdfPath const rootPath)

Sets the path at which all Rprims must be rooted to be included in this collection, replacing any existing root paths that were previously specified.

HD_API void HdRprimCollection::SetRootPaths ( SdfPathVector const rootPaths)

Sets all root paths for this collection, replacing any existing paths that were present previously. All paths must be absolute. Duplicate paths are allowed, but may result in performance degradation.

Friends And Related Function Documentation

HD_API friend std::ostream& operator<< ( std::ostream &  out,
HdRprimCollection const v 
)
friend

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