All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
filteringSceneIndex.h
1//
2// Copyright 2021 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_FILTERING_SCENE_INDEX_H
8#define PXR_IMAGING_HD_FILTERING_SCENE_INDEX_H
9
10#include "pxr/pxr.h"
11
12#include <set>
13#include <unordered_map>
14
17
18#include "pxr/usd/sdf/path.h"
19
20#include "pxr/imaging/hd/dataSource.h"
21#include "pxr/imaging/hd/dataSourceLocator.h"
22#include "pxr/imaging/hd/sceneIndex.h"
23
24PXR_NAMESPACE_OPEN_SCOPE
25
27
35{
36public:
37 virtual std::vector<HdSceneIndexBaseRefPtr> GetInputScenes() const = 0;
38};
39
105{
106public:
107 virtual std::vector<HdSceneIndexBaseRefPtr>
108 GetEncapsulatedScenes() const = 0;
109
110 static HdEncapsulatingSceneIndexBase * Cast(const HdSceneIndexBaseRefPtr &);
111};
112
114
122{
123public:
124 HD_API
125 std::vector<HdSceneIndexBaseRefPtr> GetInputScenes() const final;
126
127protected:
128 HD_API
130 const HdSceneIndexBaseRefPtr &inputSceneIndex);
131
132 virtual void _PrimsAdded(
133 const HdSceneIndexBase &sender,
134 const HdSceneIndexObserver::AddedPrimEntries &entries) = 0;
135
136 virtual void _PrimsRemoved(
137 const HdSceneIndexBase &sender,
139
140 virtual void _PrimsDirtied(
141 const HdSceneIndexBase &sender,
143
144 // Base implementation converts prim removed messages.
145 HD_API
146 virtual void _PrimsRenamed(
147 const HdSceneIndexBase &sender,
149
154 const HdSceneIndexBaseRefPtr &_GetInputSceneIndex() const {
155 return _inputSceneIndex;
156 }
157
158private:
159
160 HdSceneIndexBaseRefPtr _inputSceneIndex;
161
162 friend class _Observer;
163
164 class _Observer : public HdSceneIndexObserver
165 {
166 public:
168 : _owner(owner) {}
169
170 void PrimsAdded(
171 const HdSceneIndexBase &sender,
172 const AddedPrimEntries &entries) override;
173
174 void PrimsRemoved(
175 const HdSceneIndexBase &sender,
176 const RemovedPrimEntries &entries) override;
177
178 void PrimsDirtied(
179 const HdSceneIndexBase &sender,
180 const DirtiedPrimEntries &entries) override;
181
182 void PrimsRenamed(
183 const HdSceneIndexBase &sender,
184 const RenamedPrimEntries &entries) override;
185 private:
187 };
188
189 _Observer _observer;
190
191};
192
193PXR_NAMESPACE_CLOSE_SCOPE
194
195#endif // PXR_IMAGING_HD_FILTERING_SCENE_INDEX_H
A mix-in class for scene indices that implement their behaviour by creating other scene indices (inte...
An abstract base class for scene indexes that have one or more input scene indexes which serve as a b...
Abstract interface to scene data.
Definition: sceneIndex.h:48
Observer of scene data.
An abstract base class for a filtering scene index that observes a single input scene index.
const HdSceneIndexBaseRefPtr & _GetInputSceneIndex() const
Returns the input scene.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
Manage a single instance of an object.