7#ifndef PXR_USD_USD_NOTICE_H
8#define PXR_USD_USD_NOTICE_H
11#include "pxr/usd/usd/api.h"
16#include "pxr/usd/sdf/path.h"
19PXR_NAMESPACE_OPEN_SCOPE
38 const UsdStageWeakPtr &
GetStage()
const {
return _stage; }
41 UsdStageWeakPtr _stage;
112 using _PathsToChangesMap =
113 std::map<SdfPath, std::vector<const SdfChangeList::Entry*>>;
115 static const _PathsToChangesMap& _GetEmptyChangesMap();
119 const _PathsToChangesMap *resyncChanges,
120 const _PathsToChangesMap *infoChanges,
121 const _PathsToChangesMap *assetPathChanges)
123 , _resyncChanges(resyncChanges)
124 , _infoChanges(infoChanges)
125 , _assetPathChanges(assetPathChanges) {}
128 const _PathsToChangesMap *resyncChanges);
171 using _UnderlyingIterator = _PathsToChangesMap::const_iterator;
173 using iterator_category = std::forward_iterator_tag;
174 using value_type =
const SdfPath&;
175 using reference =
const SdfPath&;
176 using pointer =
const SdfPath*;
177 using difference_type =
178 typename _UnderlyingIterator::difference_type;
180 iterator() =
default;
181 reference operator*()
const {
return dereference(); }
182 pointer operator->()
const {
return &(dereference()); }
184 iterator& operator++() {
185 ++_underlyingIterator;
189 iterator operator++(
int) {
190 iterator result = *
this;
191 ++_underlyingIterator;
195 bool operator==(
const iterator& other)
const{
196 return _underlyingIterator == other._underlyingIterator;
199 bool operator!=(
const iterator& other)
const{
200 return _underlyingIterator != other._underlyingIterator;
213 USD_API
bool HasChangedFields()
const;
216 _UnderlyingIterator GetBase()
const {
217 return _underlyingIterator;
221 _UnderlyingIterator base()
const {
228 explicit iterator(_UnderlyingIterator baseIter)
229 : _underlyingIterator(baseIter) {}
231 inline reference dereference()
const {
232 return _underlyingIterator->first;
235 _UnderlyingIterator _underlyingIterator;
238 using const_iterator = iterator;
243 explicit operator SdfPathVector()
const {
244 return SdfPathVector(
begin(),
end());
249 return !_changes || _changes->empty();
254 return _changes ? _changes->size() : 0;
259 return iterator(_changes->cbegin());
264 return iterator(_changes->cbegin());
269 return iterator(_changes->cend());
274 return iterator(_changes->cend());
281 return const_iterator(_changes->find(path));
286 explicit PathRange(
const _PathsToChangesMap* changes)
290 const _PathsToChangesMap* _changes;
366 const _PathsToChangesMap *_resyncChanges;
367 const _PathsToChangesMap *_infoChanges;
368 const _PathsToChangesMap *_assetPathChanges;
400 const std::vector<std::string>& mutedLayers,
401 const std::vector<std::string>& unmutedLayers)
403 _mutedLayers(mutedLayers),
404 _unMutedLayers(unmutedLayers) {}
423 return _unMutedLayers;
427 const std::vector<std::string>& _mutedLayers;
428 const std::vector<std::string>& _unMutedLayers;
434PXR_NAMESPACE_CLOSE_SCOPE
A path value used to locate objects in layers or scenegraphs.
The base class for objects used to notify interested parties (listeners) when events have occurred.
Notice sent after a set of layers have been newly muted or unmuted.
const std::vector< std::string > & GetMutedLayers() const
Returns the identifier of the layers that were muted.
const std::vector< std::string > & GetUnmutedLayers() const
Returns the identifier of the layers that were unmuted.
An iterable range of paths to objects that have changed.
iterator begin() const
Return iterator to the start of this range.
size_t size() const
Return the number of paths in this range.
const_iterator cbegin() const
Return iterator to the start of this range.
bool empty() const
Return true if this range contains any paths, false otherwise.
iterator end() const
Return the end iterator for this range.
const_iterator cend() const
Return the end iterator for this range.
const_iterator find(const SdfPath &path) const
Return an iterator to the specified path in this range if it exists, or end() if it does not.
Notice sent in response to authored changes that affect UsdObjects.
USD_API PathRange GetChangedInfoOnlyPaths() const
Return the set of paths that have only info changes (those that do not affect the structure of cached...
bool AffectedObject(const UsdObject &obj) const
Return true if obj was possibly affected by the layer changes that generated this notice.
USD_API TfTokenVector GetChangedFields(const UsdObject &obj) const
Return the set of changed fields in layers that affected obj.
USD_API TfTokenVector GetChangedFields(const SdfPath &path) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API bool ResolvedAssetPathsResynced(const UsdObject &obj) const
Return true if asset path values in obj were resynced by the layer changes that generated this notice...
USD_API PathRange GetResyncedPaths() const
Return the set of paths that are resynced in lexicographical order.
USD_API bool HasChangedFields(const UsdObject &obj) const
Return true if there are any changed fields that affected obj, false otherwise.
USD_API bool HasChangedFields(const SdfPath &path) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
USD_API PathRange GetResolvedAssetPathsResyncedPaths() const
Return the set of paths affected by changes that may cause asset path values to resolve to different ...
USD_API bool ChangedInfoOnly(const UsdObject &obj) const
Return true if obj was changed but not resynced by the layer changes that generated this notice.
USD_API bool ResyncedObject(const UsdObject &obj) const
Return true if obj was resynced by the layer changes that generated this notice.
Ultra-conservative notice sent when the given UsdStage's contents have changed in any way.
Notice sent when a stage's EditTarget has changed.
Base class for UsdStage notices.
const UsdStageWeakPtr & GetStage() const
Return the stage associated with this notice.
Container class for Usd notices.
Base class for Usd scenegraph objects, providing common API.
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
std::vector< TfToken > TfTokenVector
Convenience types.