24 #ifndef PXR_USD_SDF_CHANGE_LIST_H 25 #define PXR_USD_SDF_CHANGE_LIST_H 30 #include "pxr/usd/sdf/api.h" 31 #include "pxr/usd/sdf/path.h" 37 #include <unordered_map> 40 PXR_NAMESPACE_OPEN_SCOPE
44 std::pair<SdfLayerHandle, SdfChangeList>
45 > SdfLayerChangeListVec;
62 enum SubLayerChangeType {
68 void DidReplaceLayerContent();
69 void DidReloadLayerContent();
70 void DidChangeLayerResolvedPath();
71 void DidChangeLayerIdentifier(
const std::string &oldIdentifier);
72 void DidChangeSublayerPaths(
const std::string &subLayerPath,
73 SubLayerChangeType changeType);
75 void DidAddPrim(
const SdfPath &primPath,
bool inert);
76 void DidRemovePrim(
const SdfPath &primPath,
bool inert);
77 void DidReorderPrims(
const SdfPath &parentPath);
78 void DidChangePrimName(
const SdfPath &oldPath,
const SdfPath &newPath);
79 void DidChangePrimVariantSets(
const SdfPath &primPath);
80 void DidChangePrimInheritPaths(
const SdfPath &primPath);
81 void DidChangePrimReferences(
const SdfPath &primPath);
82 void DidChangePrimSpecializes(
const SdfPath &primPath);
84 void DidAddProperty(
const SdfPath &propPath,
bool hasOnlyRequiredFields);
85 void DidRemoveProperty(
const SdfPath &propPath,
bool hasOnlyRequiredFields);
86 void DidReorderProperties(
const SdfPath &propPath);
87 void DidChangePropertyName(
const SdfPath &oldPath,
const SdfPath &newPath);
89 void DidChangeAttributeTimeSamples(
const SdfPath &attrPath);
90 void DidChangeAttributeConnection(
const SdfPath &attrPath);
91 void DidChangeRelationshipTargets(
const SdfPath &relPath);
92 void DidAddTarget(
const SdfPath &targetPath);
93 void DidRemoveTarget(
const SdfPath &targetPath);
118 typedef std::pair<VtValue, VtValue> InfoChange;
126 InfoChangeVec::const_iterator
128 InfoChangeVec::const_iterator iter = infoChanged.begin();
129 for (InfoChangeVec::const_iterator end = infoChanged.end();
130 iter != end; ++iter) {
131 if (iter->first == key) {
144 typedef std::pair<std::string, SubLayerChangeType> SubLayerChange;
145 std::vector<SubLayerChange> subLayerChanges;
151 std::string oldIdentifier;
156 memset(
this, 0,
sizeof(*
this));
160 bool didChangeIdentifier:1;
161 bool didChangeResolvedPath:1;
162 bool didReplaceContent:1;
163 bool didReloadContent:1;
166 bool didReorderChildren:1;
167 bool didReorderProperties:1;
173 bool didChangePrimVariantSets:1;
174 bool didChangePrimInheritPaths:1;
175 bool didChangePrimSpecializes:1;
176 bool didChangePrimReferences:1;
179 bool didChangeAttributeTimeSamples:1;
180 bool didChangeAttributeConnection:1;
181 bool didChangeRelationshipTargets:1;
183 bool didRemoveTarget:1;
186 bool didAddInertPrim:1;
187 bool didAddNonInertPrim:1;
188 bool didRemoveInertPrim:1;
189 bool didRemoveNonInertPrim:1;
192 bool didAddPropertyWithOnlyRequiredFields:1;
193 bool didAddProperty:1;
194 bool didRemovePropertyWithOnlyRequiredFields:1;
195 bool didRemoveProperty:1;
207 const EntryList & GetEntryList()
const {
return _entries; }
211 Entry
const &GetEntry(
const SdfPath & )
const;
213 using const_iterator = EntryList::const_iterator;
216 const_iterator FindEntry(
SdfPath const &)
const;
218 const_iterator begin()
const {
219 return _entries.begin();
222 const_iterator cbegin()
const {
223 return _entries.cbegin();
226 const_iterator end()
const {
227 return _entries.end();
230 const_iterator cend()
const {
231 return _entries.cend();
236 a._entries.
swap(b._entries);
237 a._entriesAccel.swap(b._entriesAccel);
240 Entry &_GetEntry(
SdfPath const &);
245 Entry &_MoveEntry(
SdfPath const &oldPath,
SdfPath const &newPath);
247 EntryList::iterator _MakeNonConstIterator(EntryList::const_iterator i);
249 Entry &_AddNewEntry(
SdfPath const &path);
251 void _EraseEntry(
SdfPath const &);
253 void _RebuildAccel();
256 using _AccelTable = std::unordered_map<SdfPath, size_t, SdfPath::Hash>;
257 std::unique_ptr<_AccelTable> _entriesAccel;
258 static constexpr
size_t _AccelThreshold = 64;
264 PXR_NAMESPACE_CLOSE_SCOPE
266 #endif // PXR_USD_SDF_CHANGE_LIST_H 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...
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.
A path value used to locate objects in layers or scenegraphs.
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.
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.
Provides a container which may hold any type, and provides introspection and iteration over array typ...