HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderIndexAdapterSceneIndex.h
Go to the documentation of this file.
1 //
2 // Copyright 2025 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_HD_RENDER_INDEX_ADAPTER_SCENE_INDEX_H
8 #define PXR_IMAGING_HD_RENDER_INDEX_ADAPTER_SCENE_INDEX_H
9 
10 #include "pxr/pxr.h"
11 
13 
15 
16 class HdRenderDelegate;
17 class HdRenderIndex;
20 
21 /// \class HdRenderIndexAdapterSceneIndex
22 ///
23 /// A scene index for "front-end" emulation. That is, the scene index
24 /// is populated from an HdSceneDelegate through the render index owned
25 /// by the scene index.
26 ///
28 {
29 public:
30  static HdRenderIndexAdapterSceneIndexRefPtr New(
31  HdContainerDataSourceHandle const &inputArgs)
32  {
33  return TfCreateRefPtr(new HdRenderIndexAdapterSceneIndex(inputArgs));
34  }
35 
36  static HdRenderIndexAdapterSceneIndexRefPtr New(
37  const HdRenderDelegateInfo &info)
38  {
40  }
41 
42  HdRenderIndex * GetRenderIndex() const { return _renderIndex.get(); }
43 
44  HD_API
45  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
46 
47  HD_API
48  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
49 
50  HD_API
52 
53 private:
54  HD_API
56  HdContainerDataSourceHandle const &inputArgs);
57 
58  HD_API
60 
61  std::unique_ptr<HdRenderDelegate> const _renderDelegate;
62  std::unique_ptr<HdRenderIndex> const _renderIndex;
63 
64  friend class _Observer;
65 
66  class _Observer : public HdSceneIndexObserver
67  {
68  public:
70  : _owner(owner) {}
71 
72  HD_API
73  void PrimsAdded(
74  const HdSceneIndexBase &sender,
75  const AddedPrimEntries &entries) override;
76 
77  HD_API
78  void PrimsRemoved(
79  const HdSceneIndexBase &sender,
80  const RemovedPrimEntries &entries) override;
81 
82  HD_API
83  void PrimsDirtied(
84  const HdSceneIndexBase &sender,
85  const DirtiedPrimEntries &entries) override;
86 
87  HD_API
88  void PrimsRenamed(
89  const HdSceneIndexBase &sender,
90  const RenamedPrimEntries &entries) override;
91  private:
93  };
94 
95  _Observer _observer;
96 };
97 
99 
100 #endif
TfRefPtr< T > TfCreateRefPtr(T *ptr)
Definition: refPtr.h:1190
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
#define HD_API
Definition: api.h:23
static HdRenderIndexAdapterSceneIndexRefPtr New(const HdRenderDelegateInfo &info)
HD_API ~HdRenderIndexAdapterSceneIndex() override
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
std::vector< class SdfPath > SdfPathVector
TF_DECLARE_REF_PTRS(HdRenderIndexAdapterSceneIndex)
Definition: path.h:280
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static HdRenderIndexAdapterSceneIndexRefPtr New(HdContainerDataSourceHandle const &inputArgs)