HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Usd_Resolver Class Reference

#include <resolver.h>

Public Member Functions

USD_API Usd_Resolver (const PcpPrimIndex *index, bool skipEmptyNodes=true)
 
USD_API Usd_Resolver (const UsdResolveTarget *resolveTarget, bool skipEmptyNodes=true)
 
bool IsValid () const
 
USD_API bool NextLayer ()
 
USD_API void NextNode ()
 
PcpNodeRef GetNode () const
 
const SdfLayerRefPtrGetLayer () const
 
const SdfPathGetLocalPath () const
 
SdfPath GetLocalPath (TfToken const &propName) const
 
const PcpPrimIndexGetPrimIndex () const
 

Detailed Description

Given a PcpPrimIndex, this class facilitates value resolution by providing a mechanism for walking the composition structure in strong-to-weak order.

Definition at line 47 of file resolver.h.

Constructor & Destructor Documentation

USD_API Usd_Resolver::Usd_Resolver ( const PcpPrimIndex index,
bool  skipEmptyNodes = true 
)
explicit

Constructs a resolver with the given index. The index is held for the duration of the resolver's lifetime. If skipEmptyNodes is true, the resolver will skip over nodes that provide no opinions about the prim represented by index. Otherwise, the resolver will visit all non-inert nodes in the index.

USD_API Usd_Resolver::Usd_Resolver ( const UsdResolveTarget resolveTarget,
bool  skipEmptyNodes = true 
)
explicit

Constructs a resolver with the given resolveTarget. The resolve target provides the prim index as well as the range of nodes and layers this resolver will iterate over. If skipEmptyNodes is true, the resolver will skip over nodes that provide no opinions about the prim represented by index. Otherwise, the resolver will visit all non-inert nodes in the index.

Member Function Documentation

const SdfLayerRefPtr& Usd_Resolver::GetLayer ( ) const
inline

Returns the current layer for the current PcpNode for a valid resolver.

The behavior is undefined if the resolver is not valid.

PERFORMANCE: This returns a const-ref to avoid ref-count bumps during resolution. This is safe under the assumption that no changes will occur during resolution and that the lifetime of this object will be short.

Definition at line 117 of file resolver.h.

const SdfPath& Usd_Resolver::GetLocalPath ( ) const
inline

Returns a translated path for the current PcpNode and Layer for a valid resolver.

The behavior is undefined if the resolver is not valid.

Definition at line 125 of file resolver.h.

SdfPath Usd_Resolver::GetLocalPath ( TfToken const propName) const
inline

Returns a translated path of the property with the given propName for the current PcpNode and Layer for a valid resolver.

The behavior is undefined if the resolver is not valid.

Definition at line 133 of file resolver.h.

PcpNodeRef Usd_Resolver::GetNode ( ) const
inline

Returns the current PCP node for a valid resolver.

This is useful for coarse grained resolution tasks, however individual layers must be inspected in the common case.

The behavior is undefined if the resolver is not valid.

Definition at line 106 of file resolver.h.

const PcpPrimIndex* Usd_Resolver::GetPrimIndex ( ) const
inline

Returns the PcpPrimIndex.

This value is initialized when the resolver is constructed and does not change as a result of calling NextLayer() or NextNode().

Definition at line 142 of file resolver.h.

bool Usd_Resolver::IsValid ( ) const
inline

Returns true when there is a current Node and Layer.

The resolver must be known to be valid before calling any of the accessor or iteration functions, otherwise the behavior will be undefined.

Definition at line 76 of file resolver.h.

USD_API bool Usd_Resolver::NextLayer ( )

Advances the resolver to the next weaker Layer in the layer stack, if the current LayerStack has no more layers, the resolver will be advanced to the next weaker PcpNode. If no layers are available, the resolver will be marked as invalid. Returns true iff the resolver advanced to another node or became invalid.

If the resolver is already invalid, the behavior of this function is undefined.

USD_API void Usd_Resolver::NextNode ( )

Skips all pending layers in the current LayerStack and jumps to the next weaker PcpNode. When no more nodes are available, the resolver will be marked as invalid.

If the resolver is already invalid, the behavior of this function is undefined.


The documentation for this class was generated from the following file: