Loading...
Searching...
No Matches
sceneIndexObserver.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_SCENE_INDEX_OBSERVER_H
25#define PXR_IMAGING_HD_SCENE_INDEX_OBSERVER_H
26
27#include "pxr/pxr.h"
28
30
31#include "pxr/usd/sdf/path.h"
32
33#include "pxr/imaging/hd/api.h"
34#include "pxr/imaging/hd/dataSourceLocator.h"
35
36PXR_NAMESPACE_OPEN_SCOPE
37
39
42
49{
50public:
51
52 HD_API
53 virtual ~HdSceneIndexObserver();
54
59 {
60 SdfPath primPath;
61 TfToken primType;
62
64 AddedPrimEntry(const SdfPath &primPath, const TfToken &primType)
65 : primPath(primPath)
66 , primType(primType)
67 {
68 }
69 };
71
72 //----------------------------------
73
78 {
79 SdfPath primPath;
80
81 RemovedPrimEntry(const SdfPath &primPath)
82 : primPath(primPath)
83 {}
84 };
85
87
88 //----------------------------------
89
96 {
97 SdfPath primPath;
98 HdDataSourceLocatorSet dirtyLocators;
99
101 const SdfPath &primPath,
102 const HdDataSourceLocatorSet &dirtyLocators)
103 : primPath(primPath)
104 , dirtyLocators(dirtyLocators)
105 {}
106 };
107
109
110 //----------------------------------
111
115 {
116 SdfPath oldPrimPath;
117 SdfPath newPrimPath;
119 const SdfPath &oldPrimPath,
120 const SdfPath &newPrimPath)
121 : oldPrimPath(oldPrimPath)
122 , newPrimPath(newPrimPath)
123 {}
124 };
125
127
128 //-------------------------------------------------------------------------
129
137 HD_API
138 virtual void PrimsAdded(
139 const HdSceneIndexBase &sender,
140 const AddedPrimEntries &entries) = 0;
141
146 HD_API
147 virtual void PrimsRemoved(
148 const HdSceneIndexBase &sender,
149 const RemovedPrimEntries &entries) = 0;
150
157 HD_API
158 virtual void PrimsDirtied(
159 const HdSceneIndexBase &sender,
160 const DirtiedPrimEntries &entries) = 0;
161
165 HD_API
166 virtual void PrimsRenamed(
167 const HdSceneIndexBase &sender,
168 const RenamedPrimEntries &entries) = 0;
169
172 HD_API
174 const HdSceneIndexBase &sender,
175 const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries,
176 HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries,
177 HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries);
178
181 HD_API
183 const HdSceneIndexBase &sender,
184 const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries,
185 HdSceneIndexObserver *observer);
186
187
188
189
190
191};
192
193PXR_NAMESPACE_CLOSE_SCOPE
194
195#endif // PXR_IMAGING_HD_SCENE_INDEX_OBSERVER_H
Represents a set of data source locators closed under descendancy.
Abstract interface to scene data.
Definition: sceneIndex.h:65
Observer of scene data.
virtual HD_API void PrimsDirtied(const HdSceneIndexBase &sender, const DirtiedPrimEntries &entries)=0
A notification indicating prim datasources have been invalidated.
static HD_API void ConvertPrimsRenamedToRemovedAndAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries, HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries)
A utility for converting prims renamed messages into equivalent removed and added notices.
virtual HD_API void PrimsAdded(const HdSceneIndexBase &sender, const AddedPrimEntries &entries)=0
A notification indicating prims have been added to the scene.
static HD_API void ConvertPrimsRenamedToRemovedAndAdded(const HdSceneIndexBase &sender, const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries, HdSceneIndexObserver *observer)
A utility for converting prims renamed messages into equivalent removed and added notices at the obse...
virtual HD_API void PrimsRenamed(const HdSceneIndexBase &sender, const RenamedPrimEntries &entries)=0
A notification indicating prims (and their descendants) have been renamed or reparented.
virtual HD_API void PrimsRemoved(const HdSceneIndexBase &sender, const RemovedPrimEntries &entries)=0
A notification indicating prims have been removed from the scene.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:141
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:62
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
A notice indicating a prim of a given type was added to the scene.
A notice indicating a prim was invalidated.
A notice indicating a prim subtree was removed from the scene.
A notice indicating a prim (and its descendents) was renamed or reparented.