HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sceneGlobalsSceneIndex.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICEN SE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_IMAGING_HDSI_SCENE_GLOBALS_SCENE_INDEX_H
25 #define PXR_IMAGING_HDSI_SCENE_GLOBALS_SCENE_INDEX_H
26 
27 #include "pxr/imaging/hdsi/api.h"
28 
30 #include "pxr/usd/sdf/path.h"
31 
33 
35 
36 // undefined -> 2 : Make SGSI a filtering scene index.
37 #define HDSI_SGSI_API_VERSION 2
38 
39 /// \class HdsiSceneGlobalsSceneIndex
40 ///
41 /// Scene index that populates a "sceneGlobals" data source as modeled
42 /// by HdSceneGlobalsSchema and provides public API to mutate it.
43 ///
45 {
46 public:
47  HDSI_API
48  static HdsiSceneGlobalsSceneIndexRefPtr
49  New(const HdSceneIndexBaseRefPtr &inputSceneIndex);
50 
51  // ------------------------------------------------------------------------
52  // Public (non-virtual) API
53  // ------------------------------------------------------------------------
54 
55  /// Caches the provided path and notifies any observers when the active
56  /// render settings prim path is modified.
57  ///
58  HDSI_API
60 
61  // ------------------------------------------------------------------------
62  // Satisfying HdSceneIndexBase
63  // ------------------------------------------------------------------------
64  HDSI_API
66  GetPrim(const SdfPath &primPath) const override final;
67 
68  HDSI_API
70  GetChildPrimPaths(const SdfPath &primPath) const override final;
71 
72 protected:
73  HDSI_API
74  HdsiSceneGlobalsSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex);
75 
76  // ------------------------------------------------------------------------
77  // Satisfying HdSingleInputFilteringSceneIndexBase
78  // ------------------------------------------------------------------------
79  HDSI_API
80  void _PrimsAdded(
81  const HdSceneIndexBase &sender,
82  const HdSceneIndexObserver::AddedPrimEntries &entries) override;
83 
84  HDSI_API
85  void _PrimsRemoved(
86  const HdSceneIndexBase &sender,
87  const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
88 
89  HDSI_API
90  void _PrimsDirtied(
91  const HdSceneIndexBase &sender,
92  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
93 
94 private:
96 
97  SdfPath _activeRenderSettingsPrimPath;
98 };
99 
101 
102 #endif //PXR_IMAGING_HDSI_SCENE_GLOBALS_SCENE_INDEX_H
HDSI_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const overridefinal
Definition: path.h:290
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(HdsiSceneGlobalsSceneIndex)
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:211
#define HDSI_API
Definition: api.h:40
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const overridefinal
HDSI_API HdsiSceneGlobalsSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
HDSI_API void SetActiveRenderSettingsPrimPath(const SdfPath &)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HDSI_API void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
HDSI_API void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
static HDSI_API HdsiSceneGlobalsSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex)