|
Evaluates SdfPathExpressions with prims from a given HdSceneIndex. More...
#include <collectionExpressionEvaluator.h>
Public Types | |
enum | MatchKind { MatchAll , ShallowestMatches , ShallowestMatchesAndAllDescendants } |
Option to configure the paths returned by PopulateMatches. More... | |
Public Member Functions | |
HdCollectionExpressionEvaluator ()=default | |
Default c'tor. Constructs an empty evaluator. | |
HD_API | HdCollectionExpressionEvaluator (const HdSceneIndexBaseRefPtr &sceneIndex, const SdfPathExpression &expr) |
Constructs an evaluator that evaluates expr on prims from sceneIndex using the predicates in HdGetCollectionPredicateLibrary(). | |
HD_API | HdCollectionExpressionEvaluator (const HdSceneIndexBaseRefPtr &sceneIndex, const SdfPathExpression &expr, const HdCollectionPredicateLibrary &predicateLib) |
Constructs an evaluator that evaluates expr on prims from sceneIndex using the predicates in predicateLib . | |
bool | IsEmpty () const |
Returns true if the evaluator has an invalid scene index or an empty underlying SdfPathExpressionEval object. | |
HdSceneIndexBaseRefPtr | GetSceneIndex () const |
Returns the scene index provided during construction, or nullptr if it was default constructed. | |
HD_API SdfPredicateFunctionResult | Match (const SdfPath &path) const |
Returns the result of evaluating the expression (provided on construction) against the scene index prim at path . | |
HD_API void | PopulateAllMatches (const SdfPath &rootPath, SdfPathVector *const result) const |
Updates result with the paths of all prims in the subtree at rootPath (including rootPath ) that match the expression (provided on construction). | |
HD_API void | PopulateMatches (const SdfPath &rootPath, MatchKind matchKind, SdfPathVector *const result) const |
Utility that uses matchKind to configure the paths returned by result when evaluating the expression for the subtree at rootPath (including rootPath ). | |
Evaluates SdfPathExpressions with prims from a given HdSceneIndex.
Definition at line 57 of file collectionExpressionEvaluator.h.
enum MatchKind |
Option to configure the paths returned by PopulateMatches.
Definition at line 128 of file collectionExpressionEvaluator.h.
|
default |
Default c'tor. Constructs an empty evaluator.
HD_API HdCollectionExpressionEvaluator | ( | const HdSceneIndexBaseRefPtr & | sceneIndex, |
const SdfPathExpression & | expr | ||
) |
Constructs an evaluator that evaluates expr
on prims from sceneIndex
using the predicates in HdGetCollectionPredicateLibrary().
HD_API HdCollectionExpressionEvaluator | ( | const HdSceneIndexBaseRefPtr & | sceneIndex, |
const SdfPathExpression & | expr, | ||
const HdCollectionPredicateLibrary & | predicateLib | ||
) |
Constructs an evaluator that evaluates expr
on prims from sceneIndex
using the predicates in predicateLib
.
|
inline |
Returns the scene index provided during construction, or nullptr if it was default constructed.
Definition at line 89 of file collectionExpressionEvaluator.h.
|
inline |
Returns true if the evaluator has an invalid scene index or an empty underlying SdfPathExpressionEval object.
Definition at line 82 of file collectionExpressionEvaluator.h.
HD_API SdfPredicateFunctionResult Match | ( | const SdfPath & | path | ) | const |
Returns the result of evaluating the expression (provided on construction) against the scene index prim at path
.
HD_API void PopulateAllMatches | ( | const SdfPath & | rootPath, |
SdfPathVector *const | result | ||
) | const |
Updates result
with the paths of all prims in the subtree at rootPath
(including rootPath
) that match the expression (provided on construction).
An empty evaluator would leave result
unaffected.
result
is guaranteed to have unique paths because a scene index prim is traversed at most once. HD_API void PopulateMatches | ( | const SdfPath & | rootPath, |
MatchKind | matchKind, | ||
SdfPathVector *const | result | ||
) | const |
Utility that uses matchKind
to configure the paths returned by result
when evaluating the expression for the subtree at rootPath
(including rootPath
).
If matchKind
is MatchAll, the result is identical to that returned by PopulateAllMatches.
Example: Consider a scene index with prims: {"/a", "/a/foobar", "/a/foobar/b", "/a/foobar/bar", "/a/foobar/baz"}
PopulateMatches would return different results for the expression "/a/*bar" depending on matchKind
as follows:
MatchAll : {"/a/foobar", "/a/foobar/bar"}
ShallowestMatches : {"/a/foobar"}
ShallowestMatchesAndAllDescendants: {"/a/foobar", "/a/foobar/b", "/a/foobar/bar", "/a/foobar/baz"}
result
is guaranteed to have unique paths because a scene index prim is traversed at most once.