This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PcpPrimIndex Class Reference

PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific prim, under composition semantics. More...

#include <primIndex.h>

Public Member Functions

PCP_API PcpPrimIndex ()
 Default construct an empty, invalid prim index.
 
PCP_API PcpPrimIndex (const PcpPrimIndex &rhs)
 Copy-construct a prim index.
 
 PcpPrimIndex (PcpPrimIndex &&rhs) noexcept=default
 Move-construction.
 
PcpPrimIndexoperator= (const PcpPrimIndex &rhs)
 Assignment.
 
PcpPrimIndexoperator= (PcpPrimIndex &&rhs) noexcept=default
 
PCP_API void Swap (PcpPrimIndex &rhs)
 Swap the contents of this prim index with index.
 
void swap (PcpPrimIndex &rhs)
 Same as Swap(), but standard name.
 
bool IsValid () const
 Return true if this index is valid.
 
void SetGraph (const PcpPrimIndex_GraphRefPtr &graph)
 
PcpNodeRef AddChildPrimIndex (const PcpArc &arcToParent, PcpPrimIndex &&childPrimIndex, PcpErrorBasePtr *error)
 Add the nodes in childPrimIndex to this prim index; arcToParent specifies the node in this prim index where the root node of childPrimIndex will be added, along with other information about the composition arc connecting the two prim indexes.
 
const PcpPrimIndex_GraphRefPtr & GetGraph () const
 
PCP_API PcpNodeRef GetRootNode () const
 Returns the root node of the prim index graph.
 
PCP_API const SdfPathGetPath () const
 Returns the path of the prim whose opinions are represented by this prim index.
 
PCP_API bool HasSpecs () const
 Returns true if this prim index contains any scene description opinions.
 
PCP_API bool HasAnyPayloads () const
 Returns true if the prim has any authored payload arcs.
 
PCP_API bool IsUsd () const
 Returns true if this prim index was composed in USD mode.
 
PCP_API bool IsInstanceable () const
 Returns true if this prim index is instanceable.
 
Iteration
PCP_API PcpNodeRange GetNodeRange (PcpRangeType rangeType=PcpRangeTypeAll) const
 Returns range of iterators that encompass all children of the root node with the given arc type as well as their descendants, in strong-to-weak order.
 
PCP_API PcpNodeIterator GetNodeIteratorAtNode (const PcpNodeRef &node) const
 Returns the node iterator that points to the given node if the node is in the prim index graph.
 
PCP_API PcpNodeRange GetNodeSubtreeRange (const PcpNodeRef &node) const
 Returns range of iterators that encompass the given node and all of its descendants in strong-to-weak order.
 
PCP_API PcpPrimRange GetPrimRange (PcpRangeType rangeType=PcpRangeTypeAll) const
 Returns range of iterators that encompasses all prims, in strong-to-weak order.
 
PCP_API PcpPrimRange GetPrimRangeForNode (const PcpNodeRef &node) const
 Returns range of iterators that encompasses all prims from the site of node.
 
Lookup
PCP_API PcpNodeRef GetNodeProvidingSpec (const SdfPrimSpecHandle &primSpec) const
 Returns the node that brings opinions from primSpec into this prim index.
 
PCP_API PcpNodeRef GetNodeProvidingSpec (const SdfLayerHandle &layer, const SdfPath &path) const
 Returns the node that brings opinions from the Sd prim spec at layer and path into this prim index.
 
Diagnostics
PcpErrorVector GetLocalErrors () const
 Return the list of errors local to this prim.
 
PCP_API void PrintStatistics () const
 Prints various statistics about this prim index.
 
PCP_API std::string DumpToString (bool includeInheritOriginInfo=true, bool includeMaps=true) const
 Dump the prim index contents to a string.
 
PCP_API void DumpToDotGraph (const std::string &filename, bool includeInheritOriginInfo=true, bool includeMaps=false) const
 Dump the prim index in dot format to the file named filename.
 
Derived computations
PCP_API void ComputePrimChildNames (TfTokenVector *nameOrder, PcpTokenSet *prohibitedNameSet) const
 Compute the prim child names for the given path.
 
PCP_API void ComputePrimChildNamesInSubtree (const PcpNodeRef &subtreeRootNode, TfTokenVector *nameOrder, PcpTokenSet *prohibitedNameSet) const
 Compute the prim child names for this prim when composed from only the subtree starting at subtreeRootNode.
 
PCP_API void ComputePrimPropertyNames (TfTokenVector *nameOrder) const
 Compute the prim property names for the given path.
 
PCP_API SdfVariantSelectionMap ComposeAuthoredVariantSelections () const
 Compose the authored prim variant selections.
 
PCP_API std::string GetSelectionAppliedForVariantSet (const std::string &variantSet) const
 Return the variant selection applied for the named variant set.
 

Friends

class PcpPrimIterator
 

Detailed Description

PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific prim, under composition semantics.

PcpComputePrimIndex() builds an index ("indexes") the given prim site. At any site there may be scene description values expressing arcs that represent instructions to pull in further scene description. PcpComputePrimIndex() recursively follows these arcs, building and ordering the results.

Definition at line 61 of file primIndex.h.

Constructor & Destructor Documentation

◆ PcpPrimIndex() [1/3]

PCP_API PcpPrimIndex ( )

Default construct an empty, invalid prim index.

◆ PcpPrimIndex() [2/3]

PCP_API PcpPrimIndex ( const PcpPrimIndex rhs)

Copy-construct a prim index.

◆ PcpPrimIndex() [3/3]

PcpPrimIndex ( PcpPrimIndex &&  rhs)
defaultnoexcept

Move-construction.

Member Function Documentation

◆ AddChildPrimIndex()

PcpNodeRef AddChildPrimIndex ( const PcpArc arcToParent,
PcpPrimIndex &&  childPrimIndex,
PcpErrorBasePtr *  error 
)

Add the nodes in childPrimIndex to this prim index; arcToParent specifies the node in this prim index where the root node of childPrimIndex will be added, along with other information about the composition arc connecting the two prim indexes.

Return the node in this prim index corresponding to the root node of childPrimIndex.

◆ ComposeAuthoredVariantSelections()

PCP_API SdfVariantSelectionMap ComposeAuthoredVariantSelections ( ) const

Compose the authored prim variant selections.

These are the variant selections expressed in scene description. Note that these selections may not have actually been applied, if they are invalid.

Note
This result is not cached, but computed each time.

◆ ComputePrimChildNames()

PCP_API void ComputePrimChildNames ( TfTokenVector nameOrder,
PcpTokenSet prohibitedNameSet 
) const

Compute the prim child names for the given path.

errors will contain any errors encountered while performing this operation.

◆ ComputePrimChildNamesInSubtree()

PCP_API void ComputePrimChildNamesInSubtree ( const PcpNodeRef subtreeRootNode,
TfTokenVector nameOrder,
PcpTokenSet prohibitedNameSet 
) const

Compute the prim child names for this prim when composed from only the subtree starting at subtreeRootNode.

◆ ComputePrimPropertyNames()

PCP_API void ComputePrimPropertyNames ( TfTokenVector nameOrder) const

Compute the prim property names for the given path.

errors will contain any errors encountered while performing this operation. The nameOrder vector must not contain any duplicate entries.

◆ DumpToDotGraph()

PCP_API void DumpToDotGraph ( const std::string &  filename,
bool  includeInheritOriginInfo = true,
bool  includeMaps = false 
) const

Dump the prim index in dot format to the file named filename.

See Dump(...) for information regarding arguments.

◆ DumpToString()

PCP_API std::string DumpToString ( bool  includeInheritOriginInfo = true,
bool  includeMaps = true 
) const

Dump the prim index contents to a string.

If includeInheritOriginInfo is true, output for implied inherit nodes will include information about the originating inherit node. If includeMaps is true, output for each node will include the mappings to the parent and root node.

◆ GetGraph()

const PcpPrimIndex_GraphRefPtr & GetGraph ( ) const
inline

Definition at line 112 of file primIndex.h.

◆ GetLocalErrors()

PcpErrorVector GetLocalErrors ( ) const
inline

Return the list of errors local to this prim.

Definition at line 206 of file primIndex.h.

◆ GetNodeIteratorAtNode()

PCP_API PcpNodeIterator GetNodeIteratorAtNode ( const PcpNodeRef node) const

Returns the node iterator that points to the given node if the node is in the prim index graph.

Returns the end of the node range if the node is not contained in this prim index.

◆ GetNodeProvidingSpec() [1/2]

PCP_API PcpNodeRef GetNodeProvidingSpec ( const SdfLayerHandle &  layer,
const SdfPath path 
) const

Returns the node that brings opinions from the Sd prim spec at layer and path into this prim index.

If no such node exists, returns an invalid PcpNodeRef.

◆ GetNodeProvidingSpec() [2/2]

PCP_API PcpNodeRef GetNodeProvidingSpec ( const SdfPrimSpecHandle &  primSpec) const

Returns the node that brings opinions from primSpec into this prim index.

If no such node exists, returns an invalid PcpNodeRef.

◆ GetNodeRange()

PCP_API PcpNodeRange GetNodeRange ( PcpRangeType  rangeType = PcpRangeTypeAll) const

Returns range of iterators that encompass all children of the root node with the given arc type as well as their descendants, in strong-to-weak order.

By default, this returns a range encompassing the entire index.

◆ GetNodeSubtreeRange()

PCP_API PcpNodeRange GetNodeSubtreeRange ( const PcpNodeRef node) const

Returns range of iterators that encompass the given node and all of its descendants in strong-to-weak order.

◆ GetPath()

PCP_API const SdfPath & GetPath ( ) const

Returns the path of the prim whose opinions are represented by this prim index.

◆ GetPrimRange()

PCP_API PcpPrimRange GetPrimRange ( PcpRangeType  rangeType = PcpRangeTypeAll) const

Returns range of iterators that encompasses all prims, in strong-to-weak order.

◆ GetPrimRangeForNode()

PCP_API PcpPrimRange GetPrimRangeForNode ( const PcpNodeRef node) const

Returns range of iterators that encompasses all prims from the site of node.

node must belong to this prim index.

◆ GetRootNode()

PCP_API PcpNodeRef GetRootNode ( ) const

Returns the root node of the prim index graph.

◆ GetSelectionAppliedForVariantSet()

PCP_API std::string GetSelectionAppliedForVariantSet ( const std::string &  variantSet) const

Return the variant selection applied for the named variant set.

If none was applied, this returns an empty string. This can be different from the authored variant selection; for example, if the authored selection is invalid.

◆ HasAnyPayloads()

PCP_API bool HasAnyPayloads ( ) const

Returns true if the prim has any authored payload arcs.

The payload contents are only resolved and included if this prim's path is in the payload inclusion set provided in PcpPrimIndexInputs.

◆ HasSpecs()

PCP_API bool HasSpecs ( ) const

Returns true if this prim index contains any scene description opinions.

◆ IsInstanceable()

PCP_API bool IsInstanceable ( ) const

Returns true if this prim index is instanceable.

Instanceable prim indexes with the same instance key are guaranteed to have the same set of opinions, but may not have local opinions about name children.

See also
PcpInstanceKey

◆ IsUsd()

PCP_API bool IsUsd ( ) const

Returns true if this prim index was composed in USD mode.

See also
PcpCache::IsUsd().

◆ IsValid()

bool IsValid ( ) const
inline

Return true if this index is valid.

A default-constructed index is invalid.

Definition at line 93 of file primIndex.h.

◆ operator=()

PcpPrimIndex & operator= ( const PcpPrimIndex rhs)
inline

Assignment.

Definition at line 76 of file primIndex.h.

◆ PrintStatistics()

PCP_API void PrintStatistics ( ) const

Prints various statistics about this prim index.

◆ SetGraph()

void SetGraph ( const PcpPrimIndex_GraphRefPtr &  graph)
inline

Definition at line 95 of file primIndex.h.

◆ Swap()

PCP_API void Swap ( PcpPrimIndex rhs)

Swap the contents of this prim index with index.

◆ swap()

void swap ( PcpPrimIndex rhs)
inline

Same as Swap(), but standard name.

Definition at line 89 of file primIndex.h.

Friends And Related Function Documentation

◆ PcpPrimIterator

friend class PcpPrimIterator
friend

Definition at line 280 of file primIndex.h.


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