Loading...
Searching...
No Matches
filteringSceneIndex.h
1//
2// Copyright 2021 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/LICENSE-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_HD_FILTERING_SCENE_INDEX_H
25#define PXR_IMAGING_HD_FILTERING_SCENE_INDEX_H
26
27#include "pxr/pxr.h"
28
29#include <set>
30#include <unordered_map>
31
34
35#include "pxr/usd/sdf/path.h"
36
37#include "pxr/imaging/hd/dataSource.h"
38#include "pxr/imaging/hd/dataSourceLocator.h"
39#include "pxr/imaging/hd/sceneIndex.h"
40
41PXR_NAMESPACE_OPEN_SCOPE
42
44
52{
53public:
54 virtual std::vector<HdSceneIndexBaseRefPtr> GetInputScenes() const = 0;
55};
56
58
66{
67public:
68 HD_API
69 std::vector<HdSceneIndexBaseRefPtr> GetInputScenes() const final;
70
71protected:
72 HD_API
74 const HdSceneIndexBaseRefPtr &inputSceneIndex);
75
76 virtual void _PrimsAdded(
77 const HdSceneIndexBase &sender,
79
80 virtual void _PrimsRemoved(
81 const HdSceneIndexBase &sender,
83
84 virtual void _PrimsDirtied(
85 const HdSceneIndexBase &sender,
87
88 // Base implementation converts prim removed messages.
89 HD_API
90 virtual void _PrimsRenamed(
91 const HdSceneIndexBase &sender,
93
98 const HdSceneIndexBaseRefPtr &_GetInputSceneIndex() const {
99 return _inputSceneIndex;
100 }
101
102private:
103
104 HdSceneIndexBaseRefPtr _inputSceneIndex;
105
106 friend class _Observer;
107
108 class _Observer : public HdSceneIndexObserver
109 {
110 public:
112 : _owner(owner) {}
113
114 void PrimsAdded(
115 const HdSceneIndexBase &sender,
116 const AddedPrimEntries &entries) override;
117
118 void PrimsRemoved(
119 const HdSceneIndexBase &sender,
120 const RemovedPrimEntries &entries) override;
121
122 void PrimsDirtied(
123 const HdSceneIndexBase &sender,
124 const DirtiedPrimEntries &entries) override;
125
126 void PrimsRenamed(
127 const HdSceneIndexBase &sender,
128 const RenamedPrimEntries &entries) override;
129 private:
131 };
132
133 _Observer _observer;
134
135};
136
137PXR_NAMESPACE_CLOSE_SCOPE
138
139#endif // PXR_IMAGING_HD_FILTERING_SCENE_INDEX_H
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:65
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:89
Manage a single instance of an object.