HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialFilteringSceneIndexBase.h
Go to the documentation of this file.
1 //
2 // Copyright 2021 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef HD_MATERIAL_FILTERING_SCENE_INDEX_H
8 #define HD_MATERIAL_FILTERING_SCENE_INDEX_H
9 
10 
13 
14 #include <functional>
15 
17 
19 
20 /// \class HdMaterialFilteringSceneIndexBase
21 ///
22 /// Base class for implementing scene indices which read from and write to
23 /// only material network data sources. Subclasses implement only
24 /// _GetFilteringFunction to provide a callback to run when a material network
25 /// is first queried.
28 {
29 public:
30  HD_API
31  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override final;
32 
33  HD_API
34  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override final;
35 
36  using FilteringFnc =
37  std::function<void(HdMaterialNetworkInterface *)>;
38 
39  HD_API
41 
42 protected:
43  virtual FilteringFnc _GetFilteringFunction() const = 0;
44 
45  HD_API
46  void _PrimsAdded(
47  const HdSceneIndexBase &sender,
48  const HdSceneIndexObserver::AddedPrimEntries &entries) override final;
49 
50  HD_API
51  void _PrimsRemoved(
52  const HdSceneIndexBase &sender,
53  const HdSceneIndexObserver::RemovedPrimEntries &entries) override final;
54 
55  HD_API
56  void _PrimsDirtied(
57  const HdSceneIndexBase &sender,
58  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override final;
59 
60  HD_API
62  const HdSceneIndexBaseRefPtr &inputSceneIndex);
63 
64 };
65 
67 
68 #endif //HD_MATERIAL_FILTERING_SCENE_INDEX_H
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const overridefinal
HD_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) overridefinal
virtual FilteringFnc _GetFilteringFunction() const =0
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(HdMaterialFilteringSceneIndexBase)
#define HD_API
Definition: api.h:23
HD_API FilteringFnc GetFilteringFunction() const
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const overridefinal
HD_API void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) overridefinal
HD_API void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) overridefinal
std::vector< class SdfPath > SdfPathVector
Definition: path.h:273
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
std::function< void(HdMaterialNetworkInterface *)> FilteringFnc
HD_API HdMaterialFilteringSceneIndexBase(const HdSceneIndexBaseRefPtr &inputSceneIndex)