24#ifndef PXR_USD_PCP_CHANGES_H
25#define PXR_USD_PCP_CHANGES_H
30#include "pxr/usd/pcp/api.h"
31#include "pxr/usd/pcp/errors.h"
35#include "pxr/usd/sdf/path.h"
42PXR_NAMESPACE_OPEN_SCOPE
84 SdfPathVector newRelocatesPrimPaths;
85 PcpErrorVector newRelocatesErrors;
99 , _didChangeExpressionVariablesSource(false)
107 bool _didChangeExpressionVariablesSource;
120 TargetTypeConnection = 1 << 0,
121 TargetTypeRelationshipTarget = 1 << 1
156 SdfPathSet _didChangeSpecsInternal;
170 void Retain(
const PcpLayerStackRefPtr& layerStack);
180 std::set<SdfLayerRefPtr> _layers;
181 std::set<PcpLayerStackRefPtr> _layerStacks;
207 const SdfLayerChangeListVec& changes);
215 const SdfLayerHandle& layer,
216 const std::string& assetPath);
223 const SdfLayerHandle& srcLayer,
224 const std::string& assetPath);
248 const SdfLayerHandle& changedLayer,
260 PcpCacheChanges::TargetType targetType);
290 typedef std::map<PcpLayerStackPtr, PcpLayerStackChanges> LayerStackChanges;
291 typedef std::map<PcpCache*, PcpCacheChanges> CacheChanges;
315 typedef std::map<SdfPath, SdfPath> _PathEditMap;
316 typedef std::map<PcpCache*, _PathEditMap> _RenameChanges;
325 _PathEditMap& _GetRenameChanges(
const PcpCache* cache);
329 void _Optimize()
const;
339 const _PathEditMap* pathChanges);
342 enum _SublayerChangeType {
350 const SdfLayerHandle& layer,
351 const std::string& sublayerPath,
352 _SublayerChangeType changeType)
const;
357 const std::string& sublayerPath,
358 _SublayerChangeType changeType)
const;
363 void _DidChangeSublayerAndLayerStacks(
const PcpCache* cache,
364 const PcpLayerStackPtrVector& stacks,
365 const std::string& sublayerPath,
366 const SdfLayerHandle& sublayer,
367 _SublayerChangeType sublayerChange,
368 std::string* debugSummary);
372 void _DidChangeSublayer(
const PcpCache* cache,
373 const PcpLayerStackPtrVector& layerStacks,
374 const std::string& sublayerPath,
375 const SdfLayerHandle& sublayer,
376 _SublayerChangeType sublayerChange,
377 std::string* debugSummary,
382 void _DidAddOrRemoveSublayer(
const PcpCache* cache,
383 const PcpLayerStackPtrVector& layerStacks,
384 const SdfLayerHandle& layer,
385 const std::string& sublayerPath,
386 _SublayerChangeType sublayerChange,
387 std::string* debugSummary,
388 std::vector<bool> *significant);
391 void _DidChangeLayerStack(
393 const PcpLayerStackPtr& layerStack,
394 bool requiresLayerStackChange,
395 bool requiresLayerStackOffsetsChange,
396 bool requiresSignificantChange);
402 void _DidChangeLayerStackRelocations(
404 const PcpLayerStackPtr& layerStack,
405 std::string* debugSummary);
409 void _DidChangeLayerStackResolvedPath(
411 const PcpLayerStackPtr& layerStack,
412 bool requiresLayerStackChange,
413 std::string* debugSummary);
418 void _DidChangeLayerStackExpressionVariables(
420 const PcpLayerStackPtr& layerStack,
421 std::string* debugSummary);
426 void _DidChangeSpecStackInternal(
430 LayerStackChanges _layerStackChanges;
431 CacheChanges _cacheChanges;
432 _RenameChanges _renameChanges;
436PXR_NAMESPACE_CLOSE_SCOPE
Types of changes per cache.
std::vector< std::pair< SdfPath, SdfPath > > didChangePath
Must update the path on every namespace object at and below each given path.
SdfPathSet didChangePrims
Must rebuild the prim indexes at each path.
SdfPathSet didChangeSpecs
Must rebuild the prim/property stacks at each path.
SdfPathSet didChangeSignificantly
Must rebuild the indexes at and below each path.
bool didMaybeChangeLayers
Layers used in the composition may have changed.
std::map< SdfPath, int, SdfPath::FastLessThan > didChangeTargets
Must rebuild the connections/targets at each path.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
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 void DidChangeAssetResolver(const PcpCache *cache)
The asset resolver has changed, invalidating previously-resolved asset paths.
PCP_API bool IsEmpty() const
Returns true iff there are no 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 DidChangePaths(const PcpCache *cache, const SdfPath &oldPath, const SdfPath &newPath)
The composed object at oldPath was moved to newPath.
PCP_API void DidChangeSpecStack(const PcpCache *cache, const SdfPath &path)
The spec stack for the prim or property at path in cache has changed.
PCP_API void Apply() const
Applies the changes to the layer stacks and caches.
PCP_API const CacheChanges & GetCacheChanges() const
Returns a map of all of the cache changes.
PCP_API void DidMaybeFixAsset(const PcpCache *cache, const PcpSite &site, const SdfLayerHandle &srcLayer, const std::string &assetPath)
Tries to load the asset at assetPath.
PCP_API void DidUnmuteLayer(const PcpCache *cache, const std::string &layerId)
The layer identified by layerId was unmuted in cache.
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.
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 DidMuteLayer(const PcpCache *cache, const std::string &layerId)
The layer identified by layerId was muted in cache.
PCP_API const LayerStackChanges & GetLayerStackChanges() const
Returns a map of all of the layer stack changes.
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...
PCP_API void DidChange(const PcpCache *cache, const SdfLayerChangeListVec &changes)
Breaks down changes into individual changes on cache.
PCP_API void DidDestroyCache(const PcpCache *cache)
Remove any changes for cache.
Represents the layer stack associated with a set of expression variables.
Types of changes per layer stack.
SdfRelocatesMap newRelocatesTargetToSource
New relocation maps for this layer stack.
bool didChangeLayers
Must rebuild the layer tree. Implies didChangeLayerOffsets.
bool didChangeExpressionVariables
Must rebuild expression variables.
VtDictionary newExpressionVariables
New expression variables for this layer stack.
bool didChangeLayerOffsets
Must rebuild the layer offsets.
bool didChangeSignificantly
A significant layer stack change means the composed opinions of the layer stack may have changed in a...
SdfPathSet pathsAffectedByRelocationChanges
Paths that are affected by the above relocation changes.
bool didChangeRelocates
Must rebuild the relocation tables.
Represents a stack of layers that contribute opinions to composition.
Structure used to temporarily retain layers and layerStacks within a code block.
void Retain(const PcpLayerStackRefPtr &layerStack)
Ensure that layerStack exists until this object is destroyed.
void Swap(PcpLifeboat &other)
Swap the contents of this and other.
void Retain(const SdfLayerRefPtr &layer)
Ensure that layer exists until this object is destroyed.
const std::set< PcpLayerStackRefPtr > & GetLayerStacks() const
Returns reference to the set of layer stacks currently being held in the lifeboat.
A site specifies a path in a layer stack of scene description.
A scene description container that can combine with other such containers to form simple component as...
A path value used to locate objects in layers or scenegraphs.
A map with string keys and VtValue values.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.