7#ifndef PXR_USD_SDF_CHANGE_LIST_H
8#define PXR_USD_SDF_CHANGE_LIST_H
13#include "pxr/usd/sdf/api.h"
14#include "pxr/usd/sdf/path.h"
20#include <unordered_map>
23PXR_NAMESPACE_OPEN_SCOPE
27 std::pair<SdfLayerHandle, SdfChangeList>
28 > SdfLayerChangeListVec;
45 enum SubLayerChangeType {
51 SDF_API
void DidReplaceLayerContent();
52 SDF_API
void DidReloadLayerContent();
53 SDF_API
void DidChangeLayerResolvedPath();
54 SDF_API
void DidChangeLayerIdentifier(
const std::string &oldIdentifier);
55 SDF_API
void DidChangeSublayerPaths(
const std::string &subLayerPath,
56 SubLayerChangeType changeType);
58 SDF_API
void DidAddPrim(
const SdfPath &primPath,
bool inert);
59 SDF_API
void DidRemovePrim(
const SdfPath &primPath,
bool inert);
60 SDF_API
void DidMovePrim(
const SdfPath &oldPath,
const SdfPath &newPath);
61 SDF_API
void DidReorderPrims(
const SdfPath &parentPath);
62 SDF_API
void DidChangePrimName(
const SdfPath &oldPath,
const SdfPath &newPath);
63 SDF_API
void DidChangePrimVariantSets(
const SdfPath &primPath);
64 SDF_API
void DidChangePrimInheritPaths(
const SdfPath &primPath);
65 SDF_API
void DidChangePrimReferences(
const SdfPath &primPath);
66 SDF_API
void DidChangePrimSpecializes(
const SdfPath &primPath);
68 SDF_API
void DidAddProperty(
const SdfPath &propPath,
bool hasOnlyRequiredFields);
69 SDF_API
void DidRemoveProperty(
const SdfPath &propPath,
bool hasOnlyRequiredFields);
70 SDF_API
void DidReorderProperties(
const SdfPath &propPath);
71 SDF_API
void DidChangePropertyName(
const SdfPath &oldPath,
const SdfPath &newPath);
73 SDF_API
void DidChangeAttributeTimeSamples(
const SdfPath &attrPath);
74 SDF_API
void DidChangeAttributeConnection(
const SdfPath &attrPath);
75 SDF_API
void DidChangeRelationshipTargets(
const SdfPath &relPath);
76 SDF_API
void DidAddTarget(
const SdfPath &targetPath);
77 SDF_API
void DidRemoveTarget(
const SdfPath &targetPath);
79 SDF_API
void DidChangeInfo(
const SdfPath &path,
const TfToken &key,
102 typedef std::pair<VtValue, VtValue> InfoChange;
110 InfoChangeVec::const_iterator
112 InfoChangeVec::const_iterator iter = infoChanged.begin();
113 for (InfoChangeVec::const_iterator end = infoChanged.end();
114 iter != end; ++iter) {
115 if (iter->first == key) {
128 typedef std::pair<std::string, SubLayerChangeType> SubLayerChange;
129 std::vector<SubLayerChange> subLayerChanges;
135 std::string oldIdentifier;
140 memset(
this, 0,
sizeof(*
this));
144 bool didChangeIdentifier:1;
145 bool didChangeResolvedPath:1;
146 bool didReplaceContent:1;
147 bool didReloadContent:1;
150 bool didReorderChildren:1;
151 bool didReorderProperties:1;
157 bool didChangePrimVariantSets:1;
158 bool didChangePrimInheritPaths:1;
159 bool didChangePrimSpecializes:1;
160 bool didChangePrimReferences:1;
163 bool didChangeAttributeTimeSamples:1;
164 bool didChangeAttributeConnection:1;
165 bool didChangeRelationshipTargets:1;
167 bool didRemoveTarget:1;
170 bool didAddInertPrim:1;
171 bool didAddNonInertPrim:1;
172 bool didRemoveInertPrim:1;
173 bool didRemoveNonInertPrim:1;
176 bool didAddPropertyWithOnlyRequiredFields:1;
177 bool didAddProperty:1;
178 bool didRemovePropertyWithOnlyRequiredFields:1;
179 bool didRemoveProperty:1;
191 const EntryList & GetEntryList()
const {
return _entries; }
195 Entry
const &GetEntry(
const SdfPath & )
const;
197 using const_iterator = EntryList::const_iterator;
200 const_iterator FindEntry(
SdfPath const &)
const;
202 const_iterator begin()
const {
203 return _entries.begin();
206 const_iterator cbegin()
const {
207 return _entries.cbegin();
210 const_iterator end()
const {
211 return _entries.end();
214 const_iterator cend()
const {
215 return _entries.cend();
220 a._entries.
swap(b._entries);
221 a._entriesAccel.swap(b._entriesAccel);
224 Entry &_GetEntry(
SdfPath const &);
229 Entry &_MoveEntry(
SdfPath const &oldPath,
SdfPath const &newPath);
231 EntryList::iterator _MakeNonConstIterator(EntryList::const_iterator i);
233 Entry &_AddNewEntry(
SdfPath const &path);
235 void _EraseEntry(
SdfPath const &);
237 void _RebuildAccel();
240 using _AccelTable = std::unordered_map<SdfPath, size_t, SdfPath::Hash>;
241 std::unique_ptr<_AccelTable> _entriesAccel;
242 static constexpr size_t _AccelThreshold = 64;
248PXR_NAMESPACE_CLOSE_SCOPE
A list of scene description modifications, organized by the namespace paths where the changes occur.
TfSmallVector< std::pair< SdfPath, Entry >, 1 > EntryList
Map of change entries at various paths in a layer.
A path value used to locate objects in layers or scenegraphs.
This is a small-vector class with local storage optimization, the local storage can be specified via ...
void swap(TfSmallVector &rhs)
Swap two vector instances.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
Entry of changes at a single path in namespace.
bool HasInfoChange(TfToken const &key) const
Return true if this entry has an info change for key, false otherwise.
InfoChangeVec::const_iterator FindInfoChange(TfToken const &key) const
Return the iterator in infoChanged whose first element is key, or infoChanged.end() if there is no su...