7 #ifndef PXR_USD_PCP_LAYER_STACK_H
8 #define PXR_USD_PCP_LAYER_STACK_H
20 #include <tbb/spin_mutex.h>
24 #include <unordered_set>
34 class Pcp_LayerStackRegistry;
35 class Pcp_MutedLayers;
123 {
return *_expressionVariables; }
128 const std::unordered_set<std::string>&
130 {
return _expressionVariableDependencies; }
229 void _BlowRelocations();
230 void _Compute(
const std::string &fileFormatTarget,
231 const Pcp_MutedLayers &mutedLayers);
234 const SdfLayerHandle &
layer,
239 const std::string & sessionOwner,
240 const Pcp_MutedLayers & mutedLayers,
251 Pcp_LayerStackRegistryPtr _registry;
269 std::vector<PcpMapFunction> _mapFunctions;
273 double _timeCodesPerSecond;
284 struct _SublayerSourceInfo {
285 _SublayerSourceInfo() =
default;
287 const SdfLayerHandle& layer_,
288 const std::string& authoredSublayerPath_,
289 const std::string& computedSublayerPath_)
291 , authoredSublayerPath(authoredSublayerPath_)
292 , computedSublayerPath(computedSublayerPath_) { }
294 SdfLayerHandle
layer;
295 std::string authoredSublayerPath;
296 std::string computedSublayerPath;
300 std::vector<_SublayerSourceInfo> _sublayerSourceInfo;
303 std::set<std::string> _mutedAssetPaths;
307 std::unique_ptr<PcpErrorVector> _localErrors;
321 _RelocatesVarMap _relocatesVariables;
322 tbb::spin_mutex _relocatesVariablesMutex;
328 std::shared_ptr<PcpExpressionVariables> _expressionVariables;
331 std::unordered_set<std::string> _expressionVariableDependencies;
337 std::ostream&
operator<<(std::ostream&,
const PcpLayerStackPtr&);
339 std::ostream&
operator<<(std::ostream&,
const PcpLayerStackRefPtr&);
362 const std::vector<std::pair<SdfLayerHandle, SdfRelocates>> &layerRelocates,
392 const PcpLayerStackPtr& layerStack,
const SdfLayerHandle &changedLayer);
396 #endif // PXR_USD_PCP_LAYER_STACK_H
virtual PCP_API ~PcpLayerStack()
PCP_API const SdfRelocatesMap & GetRelocatesTargetToSource() const
PCP_API const SdfLayerOffset * GetLayerOffsetForLayer(const SdfLayerHandle &) const
PCP_API std::ostream & operator<<(std::ostream &, const PcpLayerStackPtr &)
void Pcp_BuildRelocateMap(const std::vector< std::pair< SdfLayerHandle, SdfRelocates >> &layerRelocates, SdfRelocatesMap *relocatesMap, PcpErrorVector *errors)
Builds a relocates map from a list of layer and SdfRelocates value pairs.
PCP_API const PcpLayerStackIdentifier & GetIdentifier() const
Returns the identifier for this layer stack.
friend bool Pcp_NeedToRecomputeDueToAssetPathChange(const PcpLayerStackPtr &)
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
PCP_API SdfLayerHandleVector GetSessionLayers() const
PCP_API const SdfRelocatesMap & GetIncrementalRelocatesSourceToTarget() const
GLsizei const GLchar *const * path
std::map< std::string, std::string > FileFormatArguments
PCP_API const SdfRelocatesMap & GetRelocatesSourceToTarget() const
std::set< SdfHandleTo< SdfLayer >::Handle > SdfLayerHandleSet
PCP_API void Apply(const PcpLayerStackChanges &changes, PcpLifeboat *lifeboat)
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_REF_PTRS(SdfLayer)
friend class Pcp_LayerStackRegistry
TF_DECLARE_WEAK_AND_REF_PTRS(PcpLayerStack)
GLenum GLuint GLint GLint layer
PCP_API const SdfRelocatesMap & GetIncrementalRelocatesTargetToSource() const
void Pcp_ComputeRelocationsForLayerStack(const PcpLayerStack &layerStack, SdfRelocatesMap *relocatesSourceToTarget, SdfRelocatesMap *relocatesTargetToSource, SdfRelocatesMap *incrementalRelocatesSourceToTarget, SdfRelocatesMap *incrementalRelocatesTargetToSource, SdfPathVector *relocatesPrimPaths, PcpErrorVector *errors)
std::vector< TfRefPtr< SdfLayer > > SdfLayerRefPtrVector
std::vector< class SdfPath > SdfPathVector
double GetTimeCodesPerSecond() const
PCP_API const SdfPathVector & GetPathsToPrimsWithRelocates() const
GLsizei GLsizei GLchar * source
PCP_API bool PcpNegativeLayerOffsetScaleAllowed()
PcpErrorVector GetLocalErrors() const
Return the list of errors local to this layer stack.
bool Pcp_NeedToRecomputeDueToAssetPathChange(const PcpLayerStackPtr &layerStack)
std::unique_ptr< Variable > VariableUniquePtr
Variables are held by reference.
const std::unordered_set< std::string > & GetExpressionVariableDependencies() const
std::vector< PcpErrorBasePtr > PcpErrorVector
PCP_API bool HasLayer(const SdfLayerHandle &layer) const
PCP_API const SdfLayerTreeHandle & GetSessionLayerTree() const
PCP_API bool HasRelocates() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
PCP_API const SdfLayerRefPtrVector & GetLayers() const
#define PXR_NAMESPACE_CLOSE_SCOPE
const PcpExpressionVariables & GetExpressionVariables() const
Return the composed expression variables for this layer stack.
bool IsUsd() const
Return true if this layer stack is in USD mode.
PCP_API const std::set< std::string > & GetMutedLayers() const
PCP_API PcpMapExpression GetExpressionForRelocatesAtPath(const SdfPath &path)
bool Pcp_NeedToRecomputeLayerStackTimeCodesPerSecond(const PcpLayerStackPtr &layerStack, const SdfLayerHandle &changedLayer)
PCP_API const SdfLayerTreeHandle & GetLayerTree() const
bool Pcp_IsValidRelocatesEntry(const SdfPath &source, const SdfPath &target, std::string *errorMessage)