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 const HdRenderDelegateInfo &info)
32 {
33 return TfCreateRefPtr(new HdRenderIndexAdapterSceneIndex(info));
34 }
35
36 HdRenderIndex * GetRenderIndex() const { return _renderIndex.get(); }
37
38 HD_API
39 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
40
41 HD_API
42 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
43
44 HD_API
46
47private:
48 HD_API
49 HdRenderIndexAdapterSceneIndex(const HdRenderDelegateInfo &info);
50
51 std::unique_ptr<HdRenderDelegate> const _renderDelegate;
52 std::unique_ptr<HdRenderIndex> const _renderIndex;
53
54 friend class _Observer;
55
56 class _Observer : public HdSceneIndexObserver
57 {
58 public:
59 _Observer(HdRenderIndexAdapterSceneIndex * const owner)
60 : _owner(owner) {}
61
62 HD_API
63 void PrimsAdded(
64 const HdSceneIndexBase &sender,
65 const AddedPrimEntries &entries) override;
66
67 HD_API
68 void PrimsRemoved(
69 const HdSceneIndexBase &sender,
70 const RemovedPrimEntries &entries) override;
71
72 HD_API
73 void PrimsDirtied(
74 const HdSceneIndexBase &sender,
75 const DirtiedPrimEntries &entries) override;
76
77 HD_API
78 void PrimsRenamed(
79 const HdSceneIndexBase &sender,
80 const RenamedPrimEntries &entries) override;
81 private:
83 };
84
85 _Observer _observer;
86};
87
88PXR_NAMESPACE_CLOSE_SCOPE
89
90#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 Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:105
Abstract interface to scene data.
Definition: sceneIndex.h:54
Observer of scene data.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
#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:35