1 #ifndef USD_NOTICE_FRAMEWORK_NOTICE_H
2 #define USD_NOTICE_FRAMEWORK_NOTICE_H
8 #include <pxr/base/arch/demangle.h>
9 #include <pxr/base/tf/notice.h>
10 #include <pxr/base/tf/refBase.h>
11 #include <pxr/base/tf/refPtr.h>
13 #include <pxr/usd/sdf/path.h>
14 #include <pxr/usd/usd/notice.h>
17 #include <unordered_map>
18 #include <unordered_set>
25 std::unordered_set<PXR_NS::TfToken, PXR_NS::TfToken::HashFunctor>;
28 using SdfPathSet = std::unordered_set<PXR_NS::SdfPath, PXR_NS::SdfPath::Hash>;
32 std::unordered_map<PXR_NS::SdfPath, TfTokenSet, PXR_NS::SdfPath::Hash>;
68 PXR_NAMESPACE_USING_DIRECTIVE
69 TF_FATAL_ERROR(
"Abstract class 'StageNotice' cannot be merged.");
86 PXR_NAMESPACE_USING_DIRECTIVE
88 "Abstract class 'StageNotice' does not have a unique identifier.");
99 return PXR_NS::TfCreateRefPtr(_Clone());
117 PXR_NAMESPACE_USING_DIRECTIVE
118 TF_FATAL_ERROR(
"Abstract class 'StageNotice' cannot be cloned.");
145 template <
class Self>
151 template <
class... Args>
154 return PXR_NS::TfCreateRefPtr(
new Self(std::forward<Args>(args)...));
160 return PXR_NS::TfCreateRefPtr(
static_cast<Self*
>(_Clone()));
165 Merge(
dynamic_cast<Self&&
>(notice));
180 return PXR_NS::ArchGetDemangled(
typeid(Self).name());
192 return new Self(
static_cast<const Self&
>(*
this));
283 return _resyncChanges;
347 PXR_NS::SdfPathVector _resyncChanges;
350 PXR_NS::SdfPathVector _infoChanges;
425 return _unmutedLayers;
437 std::vector<std::string> _mutedLayers;
440 std::vector<std::string> _unmutedLayers;
Notice sent after a set of layers have been newly muted or unmuted.
Definition: notice.h:385
LayerMutingChanged(const PXR_NS::UsdNotice::LayerMutingChanged &)
Create notice from PXR_NS::UsdNotice::LayerMutingChanged instance.
virtual UNF_API void Merge(LayerMutingChanged &&) override
Merge notice with another LayerMutingChanged notice.
UNF_API LayerMutingChanged & operator=(const LayerMutingChanged &)
Assignment operator.
UNF_API const std::vector< std::string > & GetUnmutedLayers() const
Returns identifiers of the layers that were unmuted.
Definition: notice.h:423
UNF_API LayerMutingChanged(const LayerMutingChanged &)
Copy constructor.
UNF_API const std::vector< std::string > & GetMutedLayers() const
Returns identifiers of the layers that were muted.
Definition: notice.h:412
Notice sent in response to authored changes that affect any PXR_NS::UsdObject.
Definition: notice.h:227
UNF_API bool HasChangedFields(const PXR_NS::SdfPath &) const
Indicate whether any changed fields affected the path.
UNF_API bool ChangedInfoOnly(const PXR_NS::UsdObject &) const
Indicate whether object was modified but not resynced by the change that generated this notice.
UNF_API TfTokenSet GetChangedFields(const PXR_NS::SdfPath &) const
Return the set of changed fields in layers that affected the path.
UNF_API ObjectsChanged(const ObjectsChanged &)
Copy constructor.
UNF_API const PXR_NS::SdfPathVector & GetChangedInfoOnlyPaths() const
Return vector of paths that are modified but not resynced in lexicographical order.
Definition: notice.h:293
virtual UNF_API void PostProcess() override
Base method for adding post process after merging data within a transaction.
const ChangedFieldMap & GetChangedFieldMap() const
Return map of affected token sets organized per path.
Definition: notice.h:336
ObjectsChanged(const PXR_NS::UsdNotice::ObjectsChanged &)
Create notice from PXR_NS::UsdNotice::ObjectsChanged instance.
virtual UNF_API void Merge(ObjectsChanged &&) override
Merge notice with another ObjectsChanged notice.
UNF_API TfTokenSet GetChangedFields(const PXR_NS::UsdObject &) const
Return the set of changed fields in layers that affected the object.
UNF_API bool ResyncedObject(const PXR_NS::UsdObject &) const
Indicate whether object was resynced by the change that generated this notice.
UNF_API bool HasChangedFields(const PXR_NS::UsdObject &) const
Indicate whether any changed fields affected the object.
UNF_API ObjectsChanged & operator=(const ObjectsChanged &)
Assignment operator.
UNF_API bool AffectedObject(const PXR_NS::UsdObject &object) const
Indicate whether object was affected by the change that generated this notice.
Definition: notice.h:255
UNF_API const PXR_NS::SdfPathVector & GetResyncedPaths() const
Return vector of paths that are resynced in lexicographical order.
Definition: notice.h:281
Notice sent when the given PXR_NS::UsdStage's contents have changed in any way.
Definition: notice.h:204
StageContentsChanged(const PXR_NS::UsdNotice::StageContentsChanged &)
Create notice from PXR_NS::UsdNotice::StageContentsChanged instance.
Definition: notice.h:210
Notice sent when a stage's EditTarget has changed.
Definition: notice.h:363
StageEditTargetChanged(const PXR_NS::UsdNotice::StageEditTargetChanged &)
Create notice from PXR_NS::UsdNotice::StageEditTargetChanged instance.
Definition: notice.h:369
Intermediate interface using the CRTP idiom to provide factory and default merging logic.
Definition: notice.h:146
static PXR_NS::TfRefPtr< Self > Create(Args &&... args)
Create a notice with variadic arguments.
Definition: notice.h:152
virtual void Merge(StageNotice &¬ice) override
Interface method for merging StageNotice.
Definition: notice.h:163
PXR_NS::TfRefPtr< Self > Clone() const
Return a copy of the notice.
Definition: notice.h:158
virtual std::string GetTypeId() const override
Base method for returing unique type identifier.
Definition: notice.h:178
virtual void Merge(Self &&)
Base method for merging notice with similar type.
Definition: notice.h:172
Base class for standalone PXR_NS::UsdStage notices.
Definition: notice.h:47
virtual UNF_API bool IsMergeable() const
Indicate whether notice from the same type can be consolidated during a transaction.
Definition: notice.h:59
PXR_NS::TfRefPtr< StageNotice > Clone() const
Interface method to return a copy of the notice.
Definition: notice.h:97
virtual void PostProcess()
Base method for adding post process after merging data within a transaction.
Definition: notice.h:77
virtual UNF_API std::string GetTypeId() const
Interface method for returing unique type identifier.
Definition: notice.h:84
virtual void Merge(StageNotice &&)
Interface method for merging StageNotice.
Definition: notice.h:66
std::unordered_set< PXR_NS::TfToken, PXR_NS::TfToken::HashFunctor > TfTokenSet
Convenient alias for set of tokens.
Definition: notice.h:25
std::unordered_set< PXR_NS::SdfPath, PXR_NS::SdfPath::Hash > SdfPathSet
Convenient alias for set of paths.
Definition: notice.h:28
std::unordered_map< PXR_NS::SdfPath, TfTokenSet, PXR_NS::SdfPath::Hash > ChangedFieldMap
Convenient alias for map of token sets organized per path.
Definition: notice.h:32