24#ifndef PXR_USD_USD_NOTICE_H
25#define PXR_USD_USD_NOTICE_H
28#include "pxr/usd/usd/api.h"
33#include "pxr/usd/sdf/path.h"
36PXR_NAMESPACE_OPEN_SCOPE
55 const UsdStageWeakPtr &
GetStage()
const {
return _stage; }
58 UsdStageWeakPtr _stage;
129 using _PathsToChangesMap =
130 std::map<SdfPath, std::vector<const SdfChangeList::Entry*>>;
132 static const _PathsToChangesMap& _GetEmptyChangesMap();
136 const _PathsToChangesMap *resyncChanges,
137 const _PathsToChangesMap *infoChanges,
138 const _PathsToChangesMap *assetPathChanges)
140 , _resyncChanges(resyncChanges)
141 , _infoChanges(infoChanges)
142 , _assetPathChanges(assetPathChanges) {}
145 const _PathsToChangesMap *resyncChanges);
188 using _UnderlyingIterator = _PathsToChangesMap::const_iterator;
190 using iterator_category = std::forward_iterator_tag;
191 using value_type =
const SdfPath&;
192 using reference =
const SdfPath&;
193 using pointer =
const SdfPath*;
194 using difference_type =
195 typename _UnderlyingIterator::difference_type;
197 iterator() =
default;
198 reference operator*()
const {
return dereference(); }
199 pointer operator->()
const {
return &(dereference()); }
201 iterator& operator++() {
202 ++_underlyingIterator;
206 iterator operator++(
int) {
207 iterator result = *
this;
208 ++_underlyingIterator;
212 bool operator==(
const iterator& other)
const{
213 return _underlyingIterator == other._underlyingIterator;
216 bool operator!=(
const iterator& other)
const{
217 return _underlyingIterator != other._underlyingIterator;
230 USD_API
bool HasChangedFields()
const;
233 _UnderlyingIterator GetBase()
const {
234 return _underlyingIterator;
238 _UnderlyingIterator base()
const {
245 explicit iterator(_UnderlyingIterator baseIter)
246 : _underlyingIterator(baseIter) {}
248 inline reference dereference()
const {
249 return _underlyingIterator->first;
252 _UnderlyingIterator _underlyingIterator;
255 using const_iterator = iterator;
260 explicit operator SdfPathVector()
const {
261 return SdfPathVector(
begin(),
end());
266 return !_changes || _changes->empty();
271 return _changes ? _changes->size() : 0;
276 return iterator(_changes->cbegin());
281 return iterator(_changes->cbegin());
286 return iterator(_changes->cend());
291 return iterator(_changes->cend());
298 return const_iterator(_changes->find(path));
303 explicit PathRange(
const _PathsToChangesMap* changes)
307 const _PathsToChangesMap* _changes;
383 const _PathsToChangesMap *_resyncChanges;
384 const _PathsToChangesMap *_infoChanges;
385 const _PathsToChangesMap *_assetPathChanges;
417 const std::vector<std::string>& mutedLayers,
418 const std::vector<std::string>& unmutedLayers)
420 _mutedLayers(mutedLayers),
421 _unMutedLayers(unmutedLayers) {}
440 return _unMutedLayers;
444 const std::vector<std::string>& _mutedLayers;
445 const std::vector<std::string>& _unMutedLayers;
451PXR_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.