Loading...
Searching...
No Matches
renderIndexAdapterSceneIndex.h
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
12#include "pxr/imaging/hd/sceneIndex.h"
13
14PXR_NAMESPACE_OPEN_SCOPE
15
16class HdRenderDelegate;
17class HdRenderIndex;
18struct HdRenderDelegateInfo;
20
28{
29public:
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 {
39 return TfCreateRefPtr(new HdRenderIndexAdapterSceneIndex(info));
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
53private:
54 HD_API
56 HdContainerDataSourceHandle const &inputArgs);
57
58 HD_API
59 HdRenderIndexAdapterSceneIndex(const HdRenderDelegateInfo &info);
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:
69 _Observer(HdRenderIndexAdapterSceneIndex * const owner)
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
98PXR_NAMESPACE_CLOSE_SCOPE
99
100#endif
A scene index for "front-end" emulation.
HD_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource).
HD_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
The render index is part of the Hydra 1.0 API and is only used for emulation purposes so that HdScene...
Abstract interface to scene data.
Definition sceneIndex.h:55
Observer of scene data.
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition declarePtrs.h:58
Small struct representing a 'prim' in the Hydra scene index.
Definition sceneIndex.h:36