Loading...
Searching...
No Matches
renderSettingsFilteringSceneIndex.h
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"
28#include "pxr/imaging/hd/filteringSceneIndex.h"
29
30#include "pxr/base/vt/array.h"
32#include "pxr/base/tf/token.h"
33
34PXR_NAMESPACE_OPEN_SCOPE
35
36#define HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_TOKENS \
37 (namespacePrefixes) \
38 (fallbackPrimDs)
39
40TF_DECLARE_PUBLIC_TOKENS(HdsiRenderSettingsFilteringSceneIndexTokens, HDSI_API,
41 HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_TOKENS);
42
44
59{
60public:
61 HDSI_API
62 static HdsiRenderSettingsFilteringSceneIndexRefPtr
63 New(const HdSceneIndexBaseRefPtr &inputSceneIndex,
64 const HdContainerDataSourceHandle &inputArgs);
65
66 HDSI_API
67 HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override;
68
69 HDSI_API
70 SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override;
71
73 HDSI_API
75
76 HDSI_API
77 static const SdfPath& GetRenderScope();
78
79protected:
80 HDSI_API
82 const HdSceneIndexBaseRefPtr &inputSceneIndex,
83 const HdContainerDataSourceHandle &inputArgs);
84
86 HDSI_API
88 const HdSceneIndexBase &sender,
89 const HdSceneIndexObserver::AddedPrimEntries &entries) override;
90
91 HDSI_API
92 void _PrimsRemoved(
93 const HdSceneIndexBase &sender,
94 const HdSceneIndexObserver::RemovedPrimEntries &entries) override;
95
96 HDSI_API
97 void _PrimsDirtied(
98 const HdSceneIndexBase &sender,
99 const HdSceneIndexObserver::DirtiedPrimEntries &entries) override;
100
101private:
102 const VtArray<TfToken> _namespacePrefixes;
103 HdContainerDataSourceHandle _fallbackPrimDs;
104 bool _addedFallbackPrim;
105};
106
107PXR_NAMESPACE_CLOSE_SCOPE
108
109#endif //PXR_IMAGING_HDSI_RENDER_SETTINGS_FILTERING_SCENE_INDEX_H
Abstract interface to scene data.
Definition: sceneIndex.h:65
An abstract base class for a filtering scene index that observes a single input scene index.
Scene index that provides the following functionality in service of the HdRenderSettingsSchema:
HDSI_API void _PrimsAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::AddedPrimEntries &entries) override
Satisfying HdSingleInputFilteringSceneIndexBase.
HDSI_API HdSceneIndexPrim GetPrim(const SdfPath &primPath) const override
Returns a pair of (prim type, datasource) for the object at primPath.
HDSI_API SdfPathVector GetChildPrimPaths(const SdfPath &primPath) const override
Returns the paths of all scene index prims located immediately below primPath.
static HDSI_API const SdfPath & GetFallbackPrimPath()
Public API.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:228
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:98
Small struct representing a 'prim' in the Hydra scene index.
Definition: sceneIndex.h:52
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...