![]() |
|
A named, semantic collection of objects. More...
Public Member Functions | |
HD_API | HdRprimCollection (TfToken const &name, HdReprSelector const &reprSelector, bool forcedRepr=false, TfToken const &materialTag=TfToken()) |
Constructs an rprim collection with reprSelector . More... | |
HD_API | 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 . More... | |
HD_API | HdRprimCollection (HdRprimCollection const &col) |
Copy constructor. More... | |
HD_API HdRprimCollection | CreateInverseCollection () const |
Constructs and returns a collection with the root and exclude paths swapped. More... | |
TfToken const & | GetName () const |
Returns the semantic name of this collection. More... | |
void | SetName (TfToken const &name) |
Sets the semantic name of this collection. More... | |
HdReprSelector const & | GetReprSelector () const |
Returns the representation name. More... | |
void | SetReprSelector (HdReprSelector const &reprSelector) |
bool | IsForcedRepr () const |
void | SetForcedRepr (bool flag) |
HD_API SdfPathVector const & | GetRootPaths () const |
Returns the paths at which all Rprims must be rooted to be included in this collection. More... | |
HD_API void | SetRootPaths (SdfPathVector const &rootPaths) |
Sets all root paths for this collection, replacing any existing paths that were present previously. More... | |
HD_API void | 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. More... | |
HD_API void | SetExcludePaths (SdfPathVector const &excludePaths) |
Sets all exclude paths for this collection. More... | |
HD_API SdfPathVector const & | GetExcludePaths () const |
Returns the excluded paths. More... | |
HD_API void | 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. More... | |
HD_API TfToken const & | GetMaterialTag () const |
HD_API size_t | ComputeHash () const |
HD_API bool | operator== (HdRprimCollection const &lhs) const |
HD_API bool | operator!= (HdRprimCollection const &lhs) const |
Friends | |
template<class HashState > | |
void | TfHashAppend (HashState &h, HdRprimCollection const &rc) |
HD_API friend std::ostream & | operator<< (std::ostream &out, HdRprimCollection const &v) |
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.
Definition at line 54 of file rprimCollection.h.
HD_API 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 | ( | 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 const & | col | ) |
Copy constructor.
HD_API HdRprimCollection CreateInverseCollection | ( | ) | const |
Constructs and returns a collection with the root and exclude paths swapped.
HD_API SdfPathVector const& GetExcludePaths | ( | ) | const |
Returns the excluded paths.
Note that this vector is always sorted.
|
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.
|
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& 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.
HD_API void 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.
HD_API void 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 Storm 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.
|
inline |
Sets the semantic name of this collection.
Definition at line 109 of file rprimCollection.h.
HD_API void 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 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.