![]() |
|
A wrapper around HdCollectionExpressionEvaluator that uses the "unrolled" instance proxy view of the scene to provide instancing-aware evaluation of collection path expressions. More...
#include <instancingAwareCollectionExpressionEvaluator.h>
Classes | |
| struct | MatchResult |
| Result type for AppendAllMatches. More... | |
Public Member Functions | |
| HdInstancingAwareCollectionExpressionEvaluator ()=default | |
| Default constructor. Constructs an empty evaluator. | |
| HD_API | HdInstancingAwareCollectionExpressionEvaluator (const HdInstanceProxyViewSceneIndexRefPtr &proxyViewSceneIndex, const SdfPathExpression &expr, const HdCollectionPredicateLibrary &predicateLib) |
Constructs an evaluator for expr evaluated against the input scene of proxyViewSceneIndex using predicateLib. | |
| bool | IsEmpty () const |
| Returns true if the evaluator that uses the proxy view's input scene has no valid scene index or expression. | |
| HD_API SdfPredicateFunctionResult | Match (const SdfPath &path) const |
Evaluates the expression at path using the evaluator backed by the proxy view's input scene. | |
| HD_API MatchResult | GetAllMatches (const SdfPath &rootPath, HdCollectionExpressionEvaluator::MatchKind matchKind, bool includeInstanceProxyMatches=false) const |
| Convenience wrapper that calls AppendAllMatches() on a default-constructed MatchResult and returns it. | |
| HD_API void | AppendAllMatches (const SdfPath &rootPath, HdCollectionExpressionEvaluator::MatchKind matchKind, bool includeInstanceProxyMatches, MatchResult *const result) const |
Accumulates two-pass match results into result. | |
A wrapper around HdCollectionExpressionEvaluator that uses the "unrolled" instance proxy view of the scene to provide instancing-aware evaluation of collection path expressions.
Outermost instance prims (that correspond to leaf USD instance prims that aren't under a prototype) are classified as fully or partially matched, and matched instance proxy prims can be accumulated into the result.
This evaluator takes a HdInstanceProxyViewSceneIndexRefPtr (and not any HdSceneIndexBaseRefPtr) as its c'tor argument to facilitate a two-pass evaluation of the expression in AppendAllMatches().
Definition at line 41 of file instancingAwareCollectionExpressionEvaluator.h.
| struct HdInstancingAwareCollectionExpressionEvaluator::MatchResult |
Result type for AppendAllMatches.
Definition at line 45 of file instancingAwareCollectionExpressionEvaluator.h.
| Class Members | ||
|---|---|---|
| SdfPathSet | fullyMatchedInstances |
Outermost instance prim paths where ALL instance proxy descendants match the expression. This includes the constant-true case (Match() returned true with IsConstant()=true) and the varying case where every proxy prim is matched. XXX If the outermost instance alone is matched, it is currently not classified as fully/partially matched. Should it be the former? (i.e. /Path/To/OuterInstance// is fully matched, but /Path/To/OuterInstance is not) |
| SdfPathSet | matchedInstanceProxyPaths |
Instance proxy prim paths that matched the expression. Populated only when |
| SdfPathSet | nonInstanceMatches |
Paths of prims that matched the expression excluding outermost instance prim paths. XXX This currently includes prims under /UsdNiPropagatedPrototypes. Should we filter those out? |
| SdfPathSet | partiallyMatchedInstances |
Outermost instance prim paths where SOME but not all instance proxy descendants match the expression. It does not matter if the outermost instance itself matches or not. |
|
default |
Default constructor. Constructs an empty evaluator.
| HD_API HdInstancingAwareCollectionExpressionEvaluator | ( | const HdInstanceProxyViewSceneIndexRefPtr & | proxyViewSceneIndex, |
| const SdfPathExpression & | expr, | ||
| const HdCollectionPredicateLibrary & | predicateLib ) |
Constructs an evaluator for expr evaluated against the input scene of proxyViewSceneIndex using predicateLib.
proxyViewSceneIndex is held as a non-owning TfWeakPtr and provides instance proxy traversal for pass 2 of AppendAllMatches().
| HD_API void AppendAllMatches | ( | const SdfPath & | rootPath, |
| HdCollectionExpressionEvaluator::MatchKind | matchKind, | ||
| bool | includeInstanceProxyMatches, | ||
| MatchResult *const | result ) const |
Accumulates two-pass match results into result.
When includeInstanceProxyMatches=true, all proxy paths are traversed and those that match are accumulated into result->matchedInstanceProxyPaths.
| HD_API MatchResult GetAllMatches | ( | const SdfPath & | rootPath, |
| HdCollectionExpressionEvaluator::MatchKind | matchKind, | ||
| bool | includeInstanceProxyMatches = false ) const |
Convenience wrapper that calls AppendAllMatches() on a default-constructed MatchResult and returns it.
|
inline |
Returns true if the evaluator that uses the proxy view's input scene has no valid scene index or expression.
XXX Should this include the proxy view evaluator as well?
Definition at line 89 of file instancingAwareCollectionExpressionEvaluator.h.
| HD_API SdfPredicateFunctionResult Match | ( | const SdfPath & | path | ) | const |
Evaluates the expression at path using the evaluator backed by the proxy view's input scene.
The rationale is that clients shouldn't have to concern themselves with instance proxy prim paths that don't exist in the input scene. The instance proxy view is only needed when evaluating an expression over all prims in the scene to drive invalidation.