materialBindingResolvingSceneIndex.h
1 //
2 // Copyright 2022 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 #ifndef PXR_IMAGING_HDSI_MATERIAL_BINDING_RESOLVING_SCENE_INDEX_H
7 #define PXR_IMAGING_HDSI_MATERIAL_BINDING_RESOLVING_SCENE_INDEX_H
8 
9 #include "pxr/imaging/hd/filteringSceneIndex.h"
10 #include "pxr/imaging/hdsi/api.h"
11 
12 #include "pxr/pxr.h"
13 
14 PXR_NAMESPACE_OPEN_SCOPE
15 
17 
23 {
24 public:
25  HDSI_API
26  static HdsiMaterialBindingResolvingSceneIndexRefPtr
27  New(const HdSceneIndexBaseRefPtr& inputSceneIndex,
28  const TfTokenVector& purposePriorityOrder,
29  const TfToken& dstPurpose);
30 
31 public: // HdSceneIndex overrides
32  HDSI_API
33  HdSceneIndexPrim GetPrim(const SdfPath& primPath) const override;
34  HDSI_API
35  SdfPathVector GetChildPrimPaths(const SdfPath& primPath) const override;
36 
37 protected: // HdSingleInputFilteringSceneIndexBase overrides
38  void _PrimsAdded(
39  const HdSceneIndexBase& sender,
40  const HdSceneIndexObserver::AddedPrimEntries& entries) override;
41  void _PrimsRemoved(
42  const HdSceneIndexBase& sender,
43  const HdSceneIndexObserver::RemovedPrimEntries& entries) override;
44  void _PrimsDirtied(
45  const HdSceneIndexBase& sender,
46  const HdSceneIndexObserver::DirtiedPrimEntries& entries) override;
47 
48 protected:
50  const HdSceneIndexBaseRefPtr& inputSceneIndex,
51  const TfTokenVector& purposePriorityOrder,
52  const TfToken& dstPurpose);
54 
55 private:
56  TfTokenVector _purposePriorityOrder;
57  TfToken _dstPurpose;
58 };
59 
60 PXR_NAMESPACE_CLOSE_SCOPE
61 
62 #endif
An abstract base class for a filtering scene index that observes a single input scene index.
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
Scene Index that resolves materialBindings that have multiple purposes into a single purpose.
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
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
Abstract interface to scene data.
Definition: sceneIndex.h:54
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58