7#ifndef PXR_USD_PCP_CHANGES_H
8#define PXR_USD_PCP_CHANGES_H
13#include "pxr/usd/pcp/api.h"
14#include "pxr/usd/pcp/errors.h"
18#include "pxr/usd/sdf/path.h"
25PXR_NAMESPACE_OPEN_SCOPE
67 SdfPathVector newRelocatesPrimPaths;
68 PcpErrorVector newRelocatesErrors;
82 , _didChangeExpressionVariablesSource(false)
90 bool _didChangeExpressionVariablesSource;
103 TargetTypeConnection = 1 << 0,
104 TargetTypeRelationshipTarget = 1 << 1
139 SdfPathSet _didChangeSpecsInternal;
153 void Retain(
const PcpLayerStackRefPtr& layerStack);
163 std::set<SdfLayerRefPtr> _layers;
164 std::set<PcpLayerStackRefPtr> _layerStacks;
190 const SdfLayerChangeListVec& changes);
198 const SdfLayerHandle& layer,
199 const std::string& assetPath);
206 const SdfLayerHandle& srcLayer,
207 const std::string& assetPath);
231 const SdfLayerHandle& changedLayer,
243 PcpCacheChanges::TargetType targetType);
273 typedef std::map<PcpLayerStackPtr, PcpLayerStackChanges> LayerStackChanges;
274 typedef std::map<PcpCache*, PcpCacheChanges> CacheChanges;
298 typedef std::map<SdfPath, SdfPath> _PathEditMap;
299 typedef std::map<PcpCache*, _PathEditMap> _RenameChanges;
308 _PathEditMap& _GetRenameChanges(
const PcpCache* cache);
312 void _Optimize()
const;
322 const _PathEditMap* pathChanges);
325 enum _SublayerChangeType {
333 const SdfLayerHandle& layer,
334 const std::string& sublayerPath,
335 _SublayerChangeType changeType)
const;
340 const std::string& sublayerPath,
341 _SublayerChangeType changeType)
const;
346 void _DidChangeSublayerAndLayerStacks(
const PcpCache* cache,
347 const PcpLayerStackPtrVector& stacks,
348 const std::string& sublayerPath,
349 const SdfLayerHandle& sublayer,
350 _SublayerChangeType sublayerChange,
351 std::string* debugSummary);
355 void _DidChangeSublayer(
const PcpCache* cache,
356 const PcpLayerStackPtrVector& layerStacks,
357 const std::string& sublayerPath,
358 const SdfLayerHandle& sublayer,
359 _SublayerChangeType sublayerChange,
360 std::string* debugSummary,
365 void _DidAddOrRemoveSublayer(
const PcpCache* cache,
366 const PcpLayerStackPtrVector& layerStacks,
367 const SdfLayerHandle& layer,
368 const std::string& sublayerPath,
369 _SublayerChangeType sublayerChange,
370 std::string* debugSummary,
371 std::vector<bool> *significant);
374 void _DidChangeLayerStack(
376 const PcpLayerStackPtr& layerStack,
377 bool requiresLayerStackChange,
378 bool requiresLayerStackOffsetsChange,
379 bool requiresSignificantChange);
385 void _DidChangeLayerStackRelocations(
387 const PcpLayerStackPtr& layerStack,
388 std::string* debugSummary);
392 void _DidChangeLayerStackResolvedPath(
394 const PcpLayerStackPtr& layerStack,
395 bool requiresLayerStackChange,
396 std::string* debugSummary);
401 void _DidChangeLayerStackExpressionVariables(
403 const PcpLayerStackPtr& layerStack,
404 std::string* debugSummary);
409 void _DidChangeSpecStackInternal(
413 LayerStackChanges _layerStackChanges;
414 CacheChanges _cacheChanges;
415 _RenameChanges _renameChanges;
419PXR_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.