All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
46 AddedPrimEntry() = default;
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() = default;
65 RemovedPrimEntry(const SdfPath &primPath)
66 : primPath(primPath)
67 {}
68 };
69
71
72 //----------------------------------
73
80 {
81 SdfPath primPath;
82 HdDataSourceLocatorSet dirtyLocators;
83
84 DirtiedPrimEntry() = default;
86 const SdfPath &primPath,
87 const HdDataSourceLocatorSet &dirtyLocators)
88 : primPath(primPath)
89 , dirtyLocators(dirtyLocators)
90 {}
91 };
92
94
95 //----------------------------------
96
100 {
101 SdfPath oldPrimPath;
102 SdfPath newPrimPath;
103
104 RenamedPrimEntry() = default;
106 const SdfPath &oldPrimPath,
107 const SdfPath &newPrimPath)
108 : oldPrimPath(oldPrimPath)
109 , newPrimPath(newPrimPath)
110 {}
111 };
112
114
115 //-------------------------------------------------------------------------
116
124 HD_API
125 virtual void PrimsAdded(
126 const HdSceneIndexBase &sender,
127 const AddedPrimEntries &entries) = 0;
128
133 HD_API
134 virtual void PrimsRemoved(
135 const HdSceneIndexBase &sender,
136 const RemovedPrimEntries &entries) = 0;
137
144 HD_API
145 virtual void PrimsDirtied(
146 const HdSceneIndexBase &sender,
147 const DirtiedPrimEntries &entries) = 0;
148
152 HD_API
153 virtual void PrimsRenamed(
154 const HdSceneIndexBase &sender,
155 const RenamedPrimEntries &entries) = 0;
156
159 HD_API
161 const HdSceneIndexBase &sender,
162 const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries,
163 HdSceneIndexObserver::RemovedPrimEntries *outputRemovedEntries,
164 HdSceneIndexObserver::AddedPrimEntries *outputAddedEntries);
165
168 HD_API
170 const HdSceneIndexBase &sender,
171 const HdSceneIndexObserver::RenamedPrimEntries &renamedEntries,
172 HdSceneIndexObserver *observer);
173
174
175
176
177
178};
179
180PXR_NAMESPACE_CLOSE_SCOPE
181
182#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.