HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
renderSettingsFilteringSceneIndex.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_RENDER_SETTINGS_FILTERING_SCENE_INDEX_H
25 #define PXR_IMAGING_HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_H
26 
27 #include "pxr/imaging/hdsi/api.h"
29 
30 #include "pxr/base/vt/array.h"
32 #include "pxr/base/tf/token.h"
33 
35 
36 #define HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_TOKENS \
37  (namespacePrefixes)
38 
39 TF_DECLARE_PUBLIC_TOKENS(HdsiRenderSettingsFilteringSceneIndexTokens, HDSI_API,
41 
43 
44 /// Scene index that provides the following functionality in service of the
45 /// HdRenderSettingsSchema:
46 /// - Filters the namespacedSettings based on the array of input prefixes
47 /// (provided via the \p inputArgs constructor argument) that
48 /// are relevant to the renderer. An empty array implies no filtering.
49 /// - Registers a dependency on the sceneGlobals.activeRenderSettings locator
50 /// to invalidate the renderSetings.active locator.
51 /// - Determines whether the render settings prim is active.
52 ///
55 {
56 public:
57  HDSI_API
58  static HdsiRenderSettingsFilteringSceneIndexRefPtr
59  New(const HdSceneIndexBaseRefPtr &inputSceneIndex,
60  const HdContainerDataSourceHandle &inputArgs);
61 
62  HDSI_API
63  HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
64 
65  HDSI_API
66  SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
67 
68 protected:
69  HDSI_API
71  const HdSceneIndexBaseRefPtr &inputSceneIndex,
72  const HdContainerDataSourceHandle &inputArgs);
73 
74  HDSI_API
75  void _PrimsAdded(
76  const HdSceneIndexBase &sender,
77  const HdSceneIndexObserver::AddedPrimEntries &entries) override;
78 
79  HDSI_API
80  void _PrimsRemoved(
81  const HdSceneIndexBase &sender,
82  const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
83 
84  HDSI_API
85  void _PrimsDirtied(
86  const HdSceneIndexBase &sender,
87  const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
88 
89 private:
90  const VtArray<TfToken> _namespacePrefixes;
91 };
92 
94 
95 #endif //PXR_IMAGING_HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_H
HDSI_API void _PrimsRemoved(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RemovedPrimEntries &entries) override
HDSI_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
#define HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_TOKENS
HDSI_API HdsiRenderSettingsFilteringSceneIndex(const HdSceneIndexBaseRefPtr &inputSceneIndex, const HdContainerDataSourceHandle &inputArgs)
TF_DECLARE_WEAK_AND_REF_PTRS(HdsiRenderSettingsFilteringSceneIndex)
HDSI_API void _PrimsDirtied(const HdSceneIndexBase &sender, const HdSceneIndexObserver::DirtiedPrimEntries &entries) override
static HDSI_API HdsiRenderSettingsFilteringSceneIndexRefPtr New(const HdSceneIndexBaseRefPtr &inputSceneIndex, const HdContainerDataSourceHandle &inputArgs)
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
TF_DECLARE_PUBLIC_TOKENS(HdsiRenderSettingsFilteringSceneIndexTokens, HDSI_API, HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_TOKENS)
Definition: path.h:291
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:212
#define HDSI_API
Definition: api.h:40
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91