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

Represents a flattened view of a collection. For more information about collections, please see UsdCollectionAPI as a way to encode and retrieve a collection from scene description. A UsdCollectionMembershipQuery object can be used to answer queries about membership of paths in the collection efficiently. More...

#include <collectionMembershipQuery.h>

Classes

struct  Hash
 Hash functor. More...
 

Public Types

using PathExpansionRuleMap = std::unordered_map< SdfPath, TfToken, SdfPath::Hash >
 

Public Member Functions

 UsdCollectionMembershipQuery ()
 
 UsdCollectionMembershipQuery (const PathExpansionRuleMap &pathExpansionRuleMap)
 
 UsdCollectionMembershipQuery (PathExpansionRuleMap &&pathExpansionRuleMap)
 Constructor that takes a path expansion rule map as an rvalue reference. More...
 
USD_API bool IsPathIncluded (const SdfPath &path, TfToken *expansionRule=nullptr) const
 
USD_API bool IsPathIncluded (const SdfPath &path, const TfToken &parentExpansionRule, TfToken *expansionRule=nullptr) const
 
bool HasExcludes () const
 
bool operator== (UsdCollectionMembershipQuery const &rhs) const
 Equality operator. More...
 
bool operator!= (UsdCollectionMembershipQuery const &rhs) const
 Inequality operator. More...
 
size_t GetHash () const
 Hash function. More...
 
const PathExpansionRuleMapGetAsPathExpansionRuleMap () const
 

Detailed Description

Represents a flattened view of a collection. For more information about collections, please see UsdCollectionAPI as a way to encode and retrieve a collection from scene description. A UsdCollectionMembershipQuery object can be used to answer queries about membership of paths in the collection efficiently.

Definition at line 49 of file collectionMembershipQuery.h.

Member Typedef Documentation

Holds an unordered map describing membership of paths in this collection and the associated expansionRule for how the paths are to be expanded. Valid expansionRules are UsdTokens->explicitOnly, UsdTokens->expandPrims, and UsdTokens->expandPrimsAndProperties. For more information on the expansion rules, please see the expansionRule attribute on UsdCollectionAPI. If a collection includes another collection, the included collection's PathExpansionRuleMap is merged into this one. If a path is excluded, its expansion rule is set to UsdTokens->exclude.

Definition at line 62 of file collectionMembershipQuery.h.

Constructor & Destructor Documentation

UsdCollectionMembershipQuery::UsdCollectionMembershipQuery ( )
inline

Default Constructor, creates an empty UsdCollectionMembershipQuery object

Definition at line 66 of file collectionMembershipQuery.h.

UsdCollectionMembershipQuery::UsdCollectionMembershipQuery ( const PathExpansionRuleMap pathExpansionRuleMap)
explicit

Constructor that takes a path expansion rule map. The map is scanned for 'excludes' when the UsdCollectionMembershipQuery object is constructed.

UsdCollectionMembershipQuery::UsdCollectionMembershipQuery ( PathExpansionRuleMap &&  pathExpansionRuleMap)
explicit

Constructor that takes a path expansion rule map as an rvalue reference.

Member Function Documentation

const PathExpansionRuleMap& UsdCollectionMembershipQuery::GetAsPathExpansionRuleMap ( ) const
inline

Returns a raw map of the paths included or excluded in the collection along with the expansion rules for the included paths.

Definition at line 153 of file collectionMembershipQuery.h.

size_t UsdCollectionMembershipQuery::GetHash ( ) const
inline

Hash function.

Definition at line 146 of file collectionMembershipQuery.h.

bool UsdCollectionMembershipQuery::HasExcludes ( ) const
inline

Returns true if the collection excludes one or more paths below an included path.

Definition at line 124 of file collectionMembershipQuery.h.

USD_API bool UsdCollectionMembershipQuery::IsPathIncluded ( const SdfPath path,
TfToken expansionRule = nullptr 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns whether the given path is included in the collection from which this UsdCollectionMembershipQuery object was computed. This is the API that clients should use for determining if a given object is a member of the collection. To enumerate all the members of a collection, use UsdComputeIncludedObjectsFromCollection or UsdComputeIncludedPathsFromCollection.

If expansionRule is not nullptr, it is set to the expansion- rule value that caused the path to be included in or excluded from the collection. If path is not included in the collection, expansionRule is set to UsdTokens->exclude.

It is useful to specify this parameter and use this overload of IsPathIncluded(), when you're interested in traversing a subtree and want to know whether the root of the subtree is included in a collection. For evaluating membership of descendants of the root, please use the other overload of IsPathIncluded(), that takes both a path and the parent expansionRule.

The python version of this method only returns the boolean result. It does not return expansionRule.

USD_API bool UsdCollectionMembershipQuery::IsPathIncluded ( const SdfPath path,
const TfToken parentExpansionRule,
TfToken expansionRule = nullptr 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns whether the given path, path is included in the collection from which this UsdCollectionMembershipQuery object was computed, given the parent-path's inherited expansion rule, parentExpansionRule.

If expansionRule is not nullptr, it is set to the expansion- rule value that caused the path to be included in or excluded from the collection. If path is not included in the collection, expansionRule is set to UsdTokens->exclude.

The python version of this method only returns the boolean result. It does not return expansionRule.

Inequality operator.

Definition at line 135 of file collectionMembershipQuery.h.

bool UsdCollectionMembershipQuery::operator== ( UsdCollectionMembershipQuery const rhs) const
inline

Equality operator.

Definition at line 129 of file collectionMembershipQuery.h.


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