utils.h
1 //
2 // Copyright 2024 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HDSI_UTILS_H
8 #define PXR_IMAGING_HDSI_UTILS_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hd/collectionPredicateLibrary.h"
12 #include "pxr/imaging/hdsi/api.h"
13 #include "pxr/usd/sdf/path.h"
15 #include "pxr/base/tf/token.h"
16 #include <optional>
17 
18 PXR_NAMESPACE_OPEN_SCOPE
19 
21 
24 class SdfPathExpression;
25 
26 struct HdSceneIndexPrim;
27 
31 
36 HDSI_API
37 void
38 HdsiUtilsCompileCollection(
39  const HdCollectionsSchema &collections,
40  const TfToken &collectionName,
41  const HdSceneIndexBaseRefPtr &sceneIndex,
42  const HdCollectionPredicateLibrary &predicateLibrary,
43  SdfPathExpression *expr,
44  std::optional<HdCollectionExpressionEvaluator> *eval);
45 
49 HDSI_API
50 void
51 HdsiUtilsCompileCollection(
52  const HdCollectionsSchema &collections,
53  const TfToken &collectionName,
54  const HdSceneIndexBaseRefPtr &sceneIndex,
55  SdfPathExpression *expr,
56  std::optional<HdCollectionExpressionEvaluator> *eval);
57 
62 
66 HDSI_API
67 bool
68 HdsiUtilsIsPruned(
69  const SdfPath &primPath,
71 
73 HDSI_API
74 void
75 HdsiUtilsRemovePrunedChildren(
76  const SdfPath &parentPath,
78  SdfPathVector *children);
79 
83 
89 HDSI_API
90 SdfPath
91 HdsiUtilsGetBoundMaterial(
92  const HdSceneIndexPrim& prim);
93 
95 
96 PXR_NAMESPACE_CLOSE_SCOPE
97 
98 #endif //PXR_IMAGING_HDSI_UTILS_H
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.
Definition: declarePtrs.h:72
Objects of this class represent a logical expression syntax tree consisting of SdfPathPattern s,...
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:35
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
The HdCollectionsSchema specifies a wrapper container for collection entries with the key being the c...
Abstract interface to scene data.
Definition: sceneIndex.h:54
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
Evaluates SdfPathExpressions with prims from a given HdSceneIndex.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...