25#ifndef PXR_IMAGING_HD_COLLECTION_EXPRESSION_EVALUATOR_H
26#define PXR_IMAGING_HD_COLLECTION_EXPRESSION_EVALUATOR_H
30#include "pxr/imaging/hd/api.h"
34#include "pxr/usd/sdf/pathExpressionEval.h"
35#include "pxr/usd/sdf/predicateLibrary.h"
39PXR_NAMESPACE_OPEN_SCOPE
45using SdfPathVector = std::vector<class SdfPath>;
68 const HdSceneIndexBaseRefPtr &sceneIndex,
76 const HdSceneIndexBaseRefPtr &sceneIndex,
83 return !_sceneIndex || _eval.IsEmpty();
88 HdSceneIndexBaseRefPtr
113 SdfPathVector *
const result)
const;
131 ShallowestMatchesAndAllDescendants
163 SdfPathVector *
const result)
const;
166 HdSceneIndexBaseRefPtr _sceneIndex;
173PXR_NAMESPACE_CLOSE_SCOPE
Evaluates SdfPathExpressions with prims from a given HdSceneIndex.
HdSceneIndexBaseRefPtr GetSceneIndex() const
Returns the scene index provided during construction, or nullptr if it was default constructed.
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 predicat...
HD_API HdCollectionExpressionEvaluator(const HdSceneIndexBaseRefPtr &sceneIndex, const SdfPathExpression &expr)
Constructs an evaluator that evaluates expr on prims from sceneIndex using the predicates in HdGetCol...
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 ...
HdCollectionExpressionEvaluator()=default
Default c'tor. Constructs an empty evaluator.
HD_API SdfPredicateFunctionResult Match(const SdfPath &path) const
Returns the result of evaluating the expression (provided on construction) against the scene index pr...
bool IsEmpty() const
Returns true if the evaluator has an invalid scene index or an empty underlying SdfPathExpressionEval...
MatchKind
Option to configure the paths returned by PopulateMatches.
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...
Abstract interface to scene data.
Objects of this class represent a logical expression syntax tree consisting of SdfPath matching patte...
A path value used to locate objects in layers or scenegraphs.
Represents the result of a predicate function: a pair of the boolean result and a Constancy token ind...
Represents a library of predicate functions for use with SdfPredicateExpression.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Small struct representing a 'prim' in the Hydra scene index.