HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialBindingResolvingSceneIndex.h
Go to the documentation of this file.
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 
10 #include "pxr/imaging/hdsi/api.h"
11 
12 #include "pxr/pxr.h"
13 
15 
17 
18 /// Scene Index that resolves materialBindings that have multiple purposes into
19 /// a single purpose. The first binding encountered in \p purposePriorityOrder
20 /// will be provided as \p dstPurpose.
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 
61 
62 #endif
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
HdsiMaterialBindingResolvingSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex, const TfTokenVector &purposePriorityOrder, const TfToken &dstPurpose)
Definition: token.h:70
std::vector< class SdfPath > SdfPathVector
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
#define HDSI_API
Definition: api.h:23
void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
static HDSI_API HdsiMaterialBindingResolvingSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex, const TfTokenVector &purposePriorityOrder, const TfToken &dstPurpose)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(HdsiMaterialBindingResolvingSceneIndex)