24 #ifndef PXR_USD_PCP_CHANGES_H 25 #define PXR_USD_PCP_CHANGES_H 30 #include "pxr/usd/pcp/api.h" 33 #include "pxr/usd/sdf/path.h" 41 PXR_NAMESPACE_OPEN_SCOPE
80 SdfPathVector newRelocatesPrimPaths;
100 TargetTypeConnection = 1 << 0,
101 TargetTypeRelationshipTarget = 1 << 1
136 SdfPathSet _didChangeSpecsInternal;
150 void Retain(
const PcpLayerStackRefPtr& layerStack);
160 std::set<SdfLayerRefPtr> _layers;
161 std::set<PcpLayerStackRefPtr> _layerStacks;
187 const SdfLayerChangeListVec& changes);
195 const SdfLayerHandle& layer,
196 const std::string& assetPath);
203 const SdfLayerHandle& srcLayer,
204 const std::string& assetPath);
239 const SdfLayerHandle& changedLayer,
251 PcpCacheChanges::TargetType targetType);
286 typedef std::map<PcpLayerStackPtr, PcpLayerStackChanges> LayerStackChanges;
287 typedef std::map<PcpCache*, PcpCacheChanges> CacheChanges;
311 typedef std::map<SdfPath, SdfPath> _PathEditMap;
312 typedef std::map<PcpCache*, _PathEditMap> _RenameChanges;
324 _PathEditMap& _GetRenameChanges(
const PcpCache* cache);
328 void _Optimize()
const;
338 const _PathEditMap* pathChanges);
341 enum _SublayerChangeType {
349 const SdfLayerHandle& layer,
350 const std::string& sublayerPath,
351 _SublayerChangeType changeType)
const;
356 const std::string& sublayerPath,
357 _SublayerChangeType changeType)
const;
362 void _DidChangeSublayerAndLayerStacks(
const PcpCache* cache,
363 const PcpLayerStackPtrVector& stacks,
364 const std::string& sublayerPath,
365 const SdfLayerHandle& sublayer,
366 _SublayerChangeType sublayerChange,
367 std::string* debugSummary);
371 void _DidChangeSublayer(
const PcpCache* cache,
372 const PcpLayerStackPtrVector& layerStacks,
373 const std::string& sublayerPath,
374 const SdfLayerHandle& sublayer,
375 _SublayerChangeType sublayerChange,
376 std::string* debugSummary,
380 void _DidChangeLayerStack(
382 const PcpLayerStackPtr& layerStack,
383 bool requiresLayerStackChange,
384 bool requiresLayerStackOffsetsChange,
385 bool requiresSignificantChange);
391 void _DidChangeLayerStackRelocations(
393 const PcpLayerStackPtr & layerStack,
394 std::string* debugSummary);
398 void _DidChangeLayerStackResolvedPath(
400 const PcpLayerStackPtr& layerStack,
401 bool requiresLayerStackChange,
402 std::string* debugSummary);
407 void _DidChangeSpecStackInternal(
411 LayerStackChanges _layerStackChanges;
412 CacheChanges _cacheChanges;
413 _RenameChanges _renameChanges;
417 PXR_NAMESPACE_CLOSE_SCOPE
419 #endif // PXR_USD_PCP_CHANGES_H std::vector< std::pair< SdfPath, SdfPath > > didChangePath
Must update the path on every namespace object at and below each given path.
A scene description container that can combine with other such containers to form simple component as...
bool didChangeSignificantly
A significant layer stack change means the composed opinions of the layer stack may have changed in a...
Standard pointer typedefs.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Represents a stack of layers that contribute opinions to composition.
bool didChangeLayers
Must rebuild the layer tree. Implies didChangeLayerOffsets.
PCP_API void DidMaybeFixAsset(const PcpCache *cache, const PcpSite &site, const SdfLayerHandle &srcLayer, const std::string &assetPath)
Tries to load the asset at assetPath.
bool didChangeLayerOffsets
Must rebuild the layer offsets.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
PCP_API void DidChangePaths(const PcpCache *cache, const SdfPath &oldPath, const SdfPath &newPath)
The composed object at oldPath was moved to newPath.
A site specifies a path in a layer stack of scene description.
PCP_API void Swap(PcpChanges &other)
Swap the contents of this and other.
PCP_API const PcpLifeboat & GetLifeboat() const
Returns the lifeboat responsible for maintaining the lifetime of layers and layer stacks during chang...
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
PCP_API void DidUnmuteLayer(const PcpCache *cache, const std::string &layerId)
The layer identified by layerId was unmuted in cache.
PCP_API void DidChangeLayers(const PcpCache *cache)
The sublayer tree changed.
SdfPathSet didChangeSpecs
Must rebuild the prim/property stacks at each path.
PCP_API const LayerStackChanges & GetLayerStackChanges() const
Returns a map of all of the layer stack changes.
PCP_API void DidMaybeFixSublayer(const PcpCache *cache, const SdfLayerHandle &layer, const std::string &assetPath)
Tries to load the sublayer of layer at sublayerPath.
PCP_API void DidChangeAssetResolver(const PcpCache *cache)
The asset resolver has changed, invalidating previously-resolved asset paths.
SdfPathSet didChangeSignificantly
Must rebuild the indexes at and below each path.
SdfPathSet pathsAffectedByRelocationChanges
Paths that are affected by the above relocation changes.
PCP_API void DidMuteLayer(const PcpCache *cache, const std::string &layerId)
The layer identified by layerId was muted in cache.
Represents a range of contiguous elements.
Types of changes per layer stack.
std::map< SdfPath, int, SdfPath::FastLessThan > didChangeTargets
Must rebuild the connections/targets at each path.
PCP_API void DidChangeSpecStack(const PcpCache *cache, const SdfPath &path)
The spec stack for the prim or property at path in cache has changed.
A path value used to locate objects in layers or scenegraphs.
PCP_API void Apply() const
Applies the changes to the layer stacks and caches.
Types of changes per cache.
void Swap(PcpLifeboat &other)
Swap the contents of this and other.
PCP_API void DidChangeRelocates(const PcpCache *cache, const SdfPath &path)
The relocates that affect prims and properties at and below the given cache path have changed.
PCP_API void DidDestroyCache(const PcpCache *cache)
Remove any changes for cache.
bool didMaybeChangeLayers
Layers used in the composition may have changed.
bool didChangeRelocates
Must rebuild the relocation tables.
PCP_API bool IsEmpty() const
Returns true iff there are no changes.
SdfRelocatesMap newRelocatesTargetToSource
New relocation maps for this layer stack.
void Retain(const SdfLayerRefPtr &layer)
Ensure that layer exists until this object is destroyed.
PCP_API void DidChangeLayerOffsets(const PcpCache *cache)
The sublayer offsets changed.
PCP_API void DidChangeSignificantly(const PcpCache *cache, const SdfPath &path)
The object at path changed significantly enough to require recomputing the entire prim or property in...
PCP_API const CacheChanges & GetCacheChanges() const
Returns a map of all of the cache changes.
Structure used to temporarily retain layers and layerStacks within a code block.
PCP_API void DidChange(const TfSpan< const PcpCache * > &caches, const SdfLayerChangeListVec &changes)
Breaks down changes into individual changes on the caches in caches.
PCP_API void DidChangeSpecs(const PcpCache *cache, const SdfPath &path, const SdfLayerHandle &changedLayer, const SdfPath &changedPath)
The spec stack for the prim or property has changed, due to the addition or removal of the spec in ch...
PCP_API void DidChangeTargets(const PcpCache *cache, const SdfPath &path, PcpCacheChanges::TargetType targetType)
The connections on the attribute or targets on the relationship have changed.
const std::set< PcpLayerStackRefPtr > & GetLayerStacks() const
Returns reference to the set of layer stacks currently being held in the lifeboat.
SdfPathSet didChangePrims
Must rebuild the prim indexes at each path.