|
Represents a stack of layers that contribute opinions to composition. More...
#include <layerStack.h>
Public Member Functions | |
PCP_API const PcpLayerStackIdentifier & | GetIdentifier () const |
Returns the identifier for this layer stack. | |
bool | IsUsd () const |
Return true if this layer stack is in USD mode. | |
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 SdfLayerTreeHandle & | GetLayerTree () const |
Returns the layer tree representing the structure of the non-session layers in the layer stack. | |
PCP_API const SdfLayerTreeHandle & | GetSessionLayerTree () const |
Returns the layer tree representing the structure of the session layers in the layer stack or null if there are no session layers. | |
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. | |
PCP_API const SdfLayerOffset * | GetLayerOffsetForLayer (const SdfLayerRefPtr &) const |
Return the layer offset for the given layer, or NULL if the layer can't be found or is the identity. | |
PCP_API const SdfLayerOffset * | GetLayerOffsetForLayer (size_t layerIdx) const |
Returns the layer offset for the layer at the given index in this layer stack. | |
PCP_API const std::set< std::string > & | GetMutedLayers () const |
Returns the set of layers that were muted in this layer stack. | |
PcpErrorVector | GetLocalErrors () const |
Return the list of errors local to this layer stack. | |
PCP_API bool | HasLayer (const SdfLayerHandle &layer) const |
Returns true if this layer stack contains the given layer, false otherwise. | |
PCP_API bool | HasLayer (const SdfLayerRefPtr &layer) const |
const PcpExpressionVariables & | GetExpressionVariables () const |
Return the composed expression variables for this layer stack. | |
const std::unordered_set< std::string > & | GetExpressionVariableDependencies () const |
Return the set of expression variables used during the computation of this layer stack. | |
double | GetTimeCodesPerSecond () const |
Return the time codes per second value of the layer stack. | |
PCP_API const SdfRelocatesMap & | GetRelocatesSourceToTarget () const |
Returns relocation source-to-target mapping for this layer stack. | |
PCP_API const SdfRelocatesMap & | GetRelocatesTargetToSource () const |
Returns relocation target-to-source mapping for this layer stack. | |
PCP_API const SdfRelocatesMap & | GetIncrementalRelocatesSourceToTarget () const |
Returns incremental relocation source-to-target mapping for this layer stack. | |
PCP_API const SdfRelocatesMap & | GetIncrementalRelocatesTargetToSource () const |
Returns incremental relocation target-to-source mapping for this layer stack. | |
PCP_API const SdfPathVector & | GetPathsToPrimsWithRelocates () const |
Returns a list of paths to all prims across all layers in this layer stack that contained relocates. | |
PCP_API void | Apply (const PcpLayerStackChanges &changes, PcpLifeboat *lifeboat) |
Apply the changes in changes . | |
PCP_API PcpMapExpression | GetExpressionForRelocatesAtPath (const SdfPath &path) |
Return a PcpMapExpression representing the relocations that affect namespace at and below the given path. | |
PCP_API bool | HasRelocates () const |
Return true if there are any relocated prim paths in this layer stack. | |
Public Member Functions inherited from TfRefBase | |
TfRefBase (TfRefBase const &) | |
TfRefBase & | operator= (TfRefBase const &) |
size_t | GetCurrentCount () const |
Return the current reference count of this object. | |
bool | IsUnique () const |
Return true if only one TfRefPtr points to this object. | |
void | SetShouldInvokeUniqueChangedListener (bool shouldCall) |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Friends | |
class | PcpCache |
Additional Inherited Members | |
Public Types inherited from TfRefBase | |
typedef void(* | UniqueChangedFuncPtr) (TfRefBase const *, bool) |
Static Public Member Functions inherited from TfRefBase | |
static TF_API void | SetUniqueChangedListener (UniqueChangedListener listener) |
Protected Member Functions inherited from TfWeakBase | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
Represents a stack of layers that contribute opinions to composition.
Each PcpLayerStack is identified by a PcpLayerStackIdentifier. This identifier contains all of the parameters needed to construct a layer stack, such as the root layer, session layer, and path resolver context.
PcpLayerStacks are constructed and managed by a Pcp_LayerStackRegistry.
Definition at line 50 of file layerStack.h.
PCP_API void Apply | ( | const PcpLayerStackChanges & | changes, |
PcpLifeboat * | lifeboat | ||
) |
Apply the changes in changes
.
This blows caches. It's up to the client to pull on those caches again as needed.
Objects that are no longer needed and would be destroyed are retained in lifeboat
and won't be destroyed until lifeboat
is itself destroyed. This gives the client control over the timing of the destruction of those objects. Clients may choose to pull on the caches before destroying lifeboat
. That may cause the caches to again retain the objects, meaning they won't be destroyed when lifeboat
is destroyed.
For example, if blowing a cache means an SdfLayer is no longer needed then lifeboat
will hold an SdfLayerRefPtr to that layer. The client can then pull on that cache, which could cause the cache to hold an SdfLayerRefPtr to the layer again. If so then destroying changes
will not destroy the layer. In any case, we don't destroy the layer and then read it again. However, if the client destroys lifeboat
before pulling on the cache then we would destroy the layer then read it again.
PCP_API PcpMapExpression GetExpressionForRelocatesAtPath | ( | const SdfPath & | path | ) |
Return a PcpMapExpression representing the relocations that affect namespace at and below the given path.
The value of this expression will continue to track the effective relocations if they are changed later. In USD mode only, this will return a null expression if there are no relocations on this layer stack.
|
inline |
Return the set of expression variables used during the computation of this layer stack.
For example, this may include the variables used in expression variable expressions in sublayer asset paths.
Definition at line 129 of file layerStack.h.
|
inline |
Return the composed expression variables for this layer stack.
Definition at line 122 of file layerStack.h.
PCP_API const PcpLayerStackIdentifier & GetIdentifier | ( | ) | const |
Returns the identifier for this layer stack.
PCP_API const SdfRelocatesMap & GetIncrementalRelocatesSourceToTarget | ( | ) | const |
Returns incremental relocation source-to-target mapping for this layer stack.
This map contains the individual relocation entries found across all layers in this layer stack; it does not combine ancestral entries with descendant entries. For instance, if this layer stack contains relocations { /A: /B } and { /A/C: /A/D }, this map will contain { /A: /B } and { /A/C: /A/D }.
PCP_API const SdfRelocatesMap & GetIncrementalRelocatesTargetToSource | ( | ) | const |
Returns incremental relocation target-to-source mapping for this layer stack.
See GetIncrementalRelocatesTargetToSource for more details.
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.
PCP_API const SdfLayerOffset * GetLayerOffsetForLayer | ( | const SdfLayerRefPtr & | ) | const |
Return the layer offset for the given layer, or NULL if the layer can't be found or is the identity.
PCP_API const SdfLayerOffset * GetLayerOffsetForLayer | ( | size_t | layerIdx | ) | const |
Returns the layer offset for the layer at the given index in this layer stack.
Returns NULL if the offset is the identity.
PCP_API const SdfLayerRefPtrVector & GetLayers | ( | ) | const |
Returns the layers in this layer stack in strong-to-weak order.
Note that this is only the local layer stack – it does not include any layers brought in by references inside prims.
PCP_API const SdfLayerTreeHandle & GetLayerTree | ( | ) | const |
Returns the layer tree representing the structure of the non-session layers in the layer stack.
|
inline |
Return the list of errors local to this layer stack.
Definition at line 110 of file layerStack.h.
PCP_API const std::set< std::string > & GetMutedLayers | ( | ) | const |
Returns the set of layers that were muted in this layer stack.
PCP_API const SdfPathVector & GetPathsToPrimsWithRelocates | ( | ) | const |
Returns a list of paths to all prims across all layers in this layer stack that contained relocates.
PCP_API const SdfRelocatesMap & GetRelocatesSourceToTarget | ( | ) | const |
Returns relocation source-to-target mapping for this layer stack.
This map combines the individual relocation entries found across all layers in this layer stack; multiple entries that affect a single prim will be combined into a single entry. For instance, if this layer stack contains relocations { /A: /B } and { /A/C: /A/D }, this map will contain { /A: /B } and { /B/C: /B/D }. This allows consumers to go from unrelocated namespace to relocated namespace in a single step.
PCP_API const SdfRelocatesMap & GetRelocatesTargetToSource | ( | ) | const |
Returns relocation target-to-source mapping for this layer stack.
See GetRelocatesSourceToTarget for more details.
PCP_API SdfLayerHandleVector GetSessionLayers | ( | ) | const |
Returns only the session layers in the layer stack in strong-to-weak order.
PCP_API const SdfLayerTreeHandle & GetSessionLayerTree | ( | ) | const |
Returns the layer tree representing the structure of the session layers in the layer stack or null if there are no session layers.
|
inline |
Return the time codes per second value of the layer stack.
This is usually the same as the computed time codes per second of the root layer but may be computed from the session layer when its present.
Definition at line 135 of file layerStack.h.
PCP_API bool HasLayer | ( | const SdfLayerHandle & | layer | ) | const |
Returns true if this layer stack contains the given layer, false otherwise.
PCP_API bool HasRelocates | ( | ) | const |
Return true if there are any relocated prim paths in this layer stack.
|
inline |
Return true if this layer stack is in USD mode.
Definition at line 64 of file layerStack.h.
|
friend |
Definition at line 217 of file layerStack.h.