24 #ifndef PXR_USD_PCP_LAYER_STACK_H
25 #define PXR_USD_PCP_LAYER_STACK_H
30 #include "pxr/usd/pcp/api.h"
31 #include "pxr/usd/pcp/errors.h"
33 #include "pxr/usd/pcp/mapExpression.h"
37 #include <tbb/spin_mutex.h>
43 PXR_NAMESPACE_OPEN_SCOPE
50 class Pcp_LayerStackRegistry;
51 class Pcp_MutedLayers;
82 const SdfLayerRefPtrVector&
GetLayers()
const;
116 return _localErrors ? *_localErrors.get() : PcpErrorVector();
122 bool HasLayer(
const SdfLayerHandle& layer)
const;
203 friend class Pcp_LayerStackRegistry;
207 friend bool Pcp_NeedToRecomputeDueToAssetPathChange(
const PcpLayerStackPtr&);
211 const std::string &fileFormatTarget,
212 const Pcp_MutedLayers &mutedLayers,
216 void _BlowRelocations();
217 void _Compute(
const std::string &fileFormatTarget,
218 const Pcp_MutedLayers &mutedLayers);
221 const SdfLayerHandle & layer,
226 const std::string & sessionOwner,
227 const Pcp_MutedLayers & mutedLayers,
228 SdfLayerHandleSet *seenLayers,
229 PcpErrorVector *errors);
237 Pcp_LayerStackRegistryPtr _registry;
250 SdfLayerRefPtrVector _layers;
255 std::vector<PcpMapFunction> _mapFunctions;
259 double _timeCodesPerSecond;
266 struct _SublayerSourceInfo {
268 const SdfLayerHandle& layer_,
269 const std::string& authoredSublayerPath_,
270 const std::string& computedSublayerPath_)
272 , authoredSublayerPath(authoredSublayerPath_)
273 , computedSublayerPath(computedSublayerPath_) { }
275 SdfLayerHandle layer;
276 std::string authoredSublayerPath;
277 std::string computedSublayerPath;
281 std::vector<_SublayerSourceInfo> _sublayerSourceInfo;
284 std::set<std::string> _mutedAssetPaths;
288 std::unique_ptr<PcpErrorVector> _localErrors;
301 SdfPath::FastLessThan> _RelocatesVarMap;
302 _RelocatesVarMap _relocatesVariables;
303 tbb::spin_mutex _relocatesVariablesMutex;
306 SdfPathVector _relocatesPrimPaths;
312 std::ostream&
operator<<(std::ostream&,
const PcpLayerStackPtr&);
314 std::ostream&
operator<<(std::ostream&,
const PcpLayerStackRefPtr&);
320 Pcp_ComputeRelocationsForLayerStack(
321 const SdfLayerRefPtrVector & layers,
326 SdfPathVector *relocatesPrimPaths);
334 Pcp_NeedToRecomputeDueToAssetPathChange(
const PcpLayerStackPtr& layerStack);
340 Pcp_NeedToRecomputeLayerStackTimeCodesPerSecond(
341 const PcpLayerStackPtr& layerStack,
const SdfLayerHandle &changedLayer);
351 PXR_NAMESPACE_CLOSE_SCOPE
353 #endif // PXR_USD_PCP_LAYER_STACK_H
An expression that yields a PcpMapFunction value.
A unit of scene description that you combine with other units of scene description to form a shot...
PcpErrorVector GetLocalErrors() const
Return the list of errors local to this layer stack.
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.
PCP_API const SdfRelocatesMap & GetIncrementalRelocatesSourceToTarget() const
Returns incremental relocation source-to-target mapping for this layer stack.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
PCP_API const SdfLayerTreeHandle & GetLayerTree() const
Returns the layer tree representing the structure of this layer stack.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
PCP_API const SdfRelocatesMap & GetRelocatesTargetToSource() const
Returns relocation target-to-source mapping for this layer stack.
PCP_API const SdfLayerRefPtrVector & GetLayers() const
Returns the layers in this layer stack in strong-to-weak order.
PCP_API SdfLayerHandleVector GetSessionLayers() const
Returns only the session layers in the layer stack in strong-to-weak order.
PCP_API const SdfPathVector & GetPathsToPrimsWithRelocates() const
Returns a list of paths to all prims across all layers in this layer stack that contained relocates...
Enable a concrete base class for use with TfRefPtr.
PCP_API const SdfLayerOffset * GetLayerOffsetForLayer(const SdfLayerHandle &) const
Returns the layer offset for the given layer, or NULL if the layer can't be found or is the identity...
Types of changes per layer stack.
PCP_API const SdfRelocatesMap & GetRelocatesSourceToTarget() const
Returns relocation source-to-target mapping for this layer stack.
PCP_API void Apply(const PcpLayerStackChanges &changes, PcpLifeboat *lifeboat)
Apply the changes in changes.
std::map< std::string, std::string > FileFormatArguments
Type for specifying additional file format-specific arguments to layer API.
PCP_API const PcpLayerStackIdentifier & GetIdentifier() const
Returns the identifier for this layer stack.
A path value used to locate objects in layers or scenegraphs.
PCP_API bool PcpIsTimeScalingForLayerTimeCodesPerSecondDisabled()
Returns true when the environment variable has been set to disable the behavior where differing time ...
PCP_API const std::set< std::string > & GetMutedLayers() const
Returns the set of layers that were muted in this layer stack.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
PCP_API bool HasLayer(const SdfLayerHandle &layer) const
Returns true if this layer stack contains the given layer, false otherwise.
PCP_API PcpMapExpression GetExpressionForRelocatesAtPath(const SdfPath &path)
Return a PcpMapExpression representing the relocations that affect namespace at and below the given p...
PCP_API const SdfRelocatesMap & GetIncrementalRelocatesTargetToSource() const
Returns incremental relocation target-to-source mapping for this layer stack.
An asset resolver context allows clients to provide additional data to the resolver for use during re...
Represents a time offset and scale between layers.
Structure used to temporarily retain layers and layerStacks within a code block.
Enable a concrete base class for use with TfWeakPtr.
double GetTimeCodesPerSecond() const
Return the time codes per second value of the layer stack.
Arguments used to identify a layer stack.
std::unique_ptr< Variable > VariableUniquePtr
Variables are held by reference.