HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
legacyRenderSettingsSceneIndex.h
Go to the documentation of this file.
1 //
2 // Copyright 2026 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_USD_IMAGING_USD_IMAGING_LEGACY_RENDER_SETTINGS_SCENE_INDEX_H
8 #define PXR_USD_IMAGING_USD_IMAGING_LEGACY_RENDER_SETTINGS_SCENE_INDEX_H
9 
11 
17 
18 #include "pxr/usd/sdf/path.h"
19 
21 #include "pxr/base/tf/token.h"
22 #include "pxr/base/vt/value.h"
23 
24 #include "pxr/pxr.h"
25 
26 #include <unordered_map>
27 
29 
31 
32 /// UsdImagingLegacyRenderSettingsSceneIndex
33 ///
34 /// A scene index to expose options set with SetRendererSetting()
35 /// into Hydra where downstream scene indices may query them or
36 /// respond to changes. Only sends dirty notices when an option's
37 /// value actually changes (checked using VtValue::operator ==).
40 {
41 public:
43  static
44  UsdImagingLegacyRenderSettingsSceneIndexRefPtr
45  New(const HdSceneIndexBaseRefPtr& inputSceneIndex);
46 
49  GetPrim(const SdfPath& primPath) const override;
50 
53  GetChildPrimPaths(const SdfPath& primPath) const override;
54 
56  void
58  const TfToken& id,
59  const VtValue& value);
60 
61 protected:
62  void
64  const HdSceneIndexBase&,
65  const HdSceneIndexObserver::AddedPrimEntries &entries) override;
66  void
68  const HdSceneIndexBase&,
69  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
70  void
72  const HdSceneIndexBase&,
73  const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
74 
76  HdSceneIndexBaseRefPtr const &inputSceneIndex);
77 
78 private:
79  using _MapType = std::unordered_map<TfToken, VtValue, TfToken::HashFunctor>;
80  using _EntryType = _MapType::value_type;
81 
82  void
83  _Compose();
84 
85  _MapType _map;
86  HdContainerDataSourceHandle _dataSource;
87 };
88 
90 
91 #endif // PXR_USD_IMAGING_USD_IMAGING_LEGACY_RENDER_SETTINGS_SCENE_INDEX_H
#define USDIMAGING_API
Definition: api.h:23
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLfloat * value
Definition: glcorearb.h:824
UsdImagingLegacyRenderSettingsSceneIndex(HdSceneIndexBaseRefPtr const &inputSceneIndex)
USDIMAGING_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
uint64 value_type
Definition: GA_PrimCompat.h:29
Definition: token.h:70
void _PrimsRemoved(const HdSceneIndexBase &, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
void _PrimsDirtied(const HdSceneIndexBase &, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(UsdImagingLegacyRenderSettingsSceneIndex)
std::vector< class SdfPath > SdfPathVector
USDIMAGING_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Definition: path.h:280
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
void _PrimsAdded(const HdSceneIndexBase &, const HdSceneIndexObserver::AddedPrimEntries &entries) override
static USDIMAGING_API UsdImagingLegacyRenderSettingsSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex)
Definition: value.h:89
USDIMAGING_API void SetRenderSetting(const TfToken &id, const VtValue &value)