Loading...
Searching...
No Matches
sceneIndexObserver.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_SCENE_INDEX_OBSERVER_H
8#define PXR_IMAGING_HD_SCENE_INDEX_OBSERVER_H
9
10#include "pxr/pxr.h"
11
13
14#include "pxr/usd/sdf/path.h"
15
16#include "pxr/imaging/hd/api.h"
17#include "pxr/imaging/hd/dataSourceLocator.h"
18
19PXR_NAMESPACE_OPEN_SCOPE
20
22
25
32{
33public:
34
35 HD_API
36 virtual ~HdSceneIndexObserver();
37
42 {
43 SdfPath primPath;
44 TfToken primType;
45
47 AddedPrimEntry(const SdfPath &primPath, const TfToken &primType)
48 : primPath(primPath)
49 , primType(primType)
50 {
51 }
52 };
54
55 //----------------------------------
56
61 {
62 SdfPath primPath;
63
64 RemovedPrimEntry(const SdfPath &primPath)
65 : primPath(primPath)
66 {}
67 };
68
70
71 //----------------------------------
72
79 {
80 SdfPath primPath;
81 HdDataSourceLocatorSet dirtyLocators;
82
84 const SdfPath &primPath,
85 const HdDataSourceLocatorSet &dirtyLocators)
86 : primPath(primPath)
87 , dirtyLocators(dirtyLocators)
88 {}
89 };
90
92
93 //----------------------------------
94
98 {
99 SdfPath oldPrimPath;
100 SdfPath newPrimPath;
102 const SdfPath &oldPrimPath,
103 const SdfPath &newPrimPath)
104 : oldPrimPath(oldPrimPath)
105 , newPrimPath(newPrimPath)
106 {}
107 };
108
110
111 //-------------------------------------------------------------------------
112
120 HD_API
121 virtual void PrimsAdded(
122 const HdSceneIndexBase &sender,
123 const AddedPrimEntries &entries) = 0;
124
129 HD_API
130 virtual void PrimsRemoved(
131 const HdSceneIndexBase &sender,
132 const RemovedPrimEntries &entries) = 0;
133
140 HD_API
141 virtual void PrimsDirtied(
142 const HdSceneIndexBase &sender,
143 const DirtiedPrimEntries &entries) = 0;
144
148 HD_API
149 virtual void PrimsRenamed(
150 const HdSceneIndexBase &sender,
151 const RenamedPrimEntries &entries) = 0;
152
155 HD_API
157 const HdSceneIndexBase &sender,
158 const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries,
159 HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries,
160 HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries);
161
164 HD_API
166 const HdSceneIndexBase &sender,
167 const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries,
168 HdSceneIndexObserver *observer);
169
170
171
172
173
174};
175
176PXR_NAMESPACE_CLOSE_SCOPE
177
178#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:48
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:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:124
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:45
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
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.