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
PcpNodeRef Class Reference

PcpNode represents a node in an expression tree for compositing scene description. More...

#include <node.h>

Classes

struct  Hash
 Hash functor. More...
 

Public Types

typedef PcpNodeRef_ChildrenIterator child_const_iterator
 
typedef PcpNodeRef_ChildrenReverseIterator child_const_reverse_iterator
 
typedef std::pair< child_const_iterator, child_const_iterator > child_const_range
 
typedef std::pair< child_const_reverse_iterator, child_const_reverse_iterator > child_const_reverse_range
 

Public Member Functions

Pcp_CompressedSdSite GetCompressedSdSite (size_t layerIndex) const
 
Arc information

Information pertaining to the arcs connecting this node to its parent and child nodes.

PCP_API PcpArcType GetArcType () const
 Returns the type of arc connecting this node to its parent node.
 
PCP_API PcpNodeRef GetParentNode () const
 Returns this node's immediate parent node.
 
PCP_API child_const_range GetChildrenRange () const
 Returns an iterator range over the children nodes in strongest to weakest order.
 
PCP_API child_const_reverse_range GetChildrenReverseRange () const
 Returns an iterator range over the children nodes in weakest to strongest order.
 
PCP_API PcpNodeRef InsertChild (const PcpLayerStackSite &site, const PcpArc &arc, PcpErrorBasePtr *error)
 Inserts a new child node for site, connected to this node via arc.
 
PCP_API PcpNodeRef InsertChildSubgraph (const PcpPrimIndex_GraphRefPtr &subgraph, const PcpArc &arc, PcpErrorBasePtr *error)
 Inserts subgraph as a child of this node, with the root node of subtree connected to this node via arc.
 
PCP_API PcpNodeRef GetOriginNode () const
 Returns the immediate origin node for this node.
 
PCP_API PcpNodeRef GetOriginRootNode () const
 Walk up to the root origin node for this node.
 
PCP_API PcpNodeRef GetRootNode () const
 Walk up to the root node of this expression.
 
PCP_API const PcpMapExpressionGetMapToParent () const
 Returns mapping function used to translate paths and values from this node to its parent node.
 
PCP_API const PcpMapExpressionGetMapToRoot () const
 Returns mapping function used to translate paths and values from this node directly to the root node.
 
PCP_API int GetSiblingNumAtOrigin () const
 Returns this node's index among siblings with the same arc type at this node's origin.
 
PCP_API int GetNamespaceDepth () const
 Returns the absolute namespace depth of the node that introduced this node.
 
PCP_API int GetDepthBelowIntroduction () const
 Return the number of levels of namespace this node's site is below the level at which it was introduced by an arc.
 
PCP_API SdfPath GetPathAtIntroduction () const
 Returns the path for this node's site when it was introduced.
 
PCP_API SdfPath GetIntroPath () const
 Get the path that introduced this node.
 
PCP_API SdfPath GetPathAtOriginRootIntroduction () const
 Returns the node's path at the same level of namespace as its origin root node was when it was added as a child.
 
Node information

Information pertaining specifically to this node and the opinions that it may or may not provide.

PCP_API PcpLayerStackSite GetSite () const
 Get the site this node represents.
 
PCP_API const SdfPathGetPath () const
 Returns the path for the site this node represents.
 
PCP_API const PcpLayerStackRefPtr & GetLayerStack () const
 Returns the layer stack for the site this node represents.
 
PCP_API bool IsRootNode () const
 Returns true if this node is the root node of the prim index graph.
 
PCP_API void SetIsDueToAncestor (bool isDueToAncestor)
 Get/set whether this node was introduced by being copied from its namespace ancestor, or directly by an arc at this level of namespace.
 
PCP_API bool IsDueToAncestor () const
 
PCP_API void SetHasSymmetry (bool hasSymmetry)
 Get/set whether this node provides any symmetry opinions, either directly or from a namespace ancestor.
 
PCP_API bool HasSymmetry () const
 
PCP_API void SetPermission (SdfPermission perm)
 Get/set the permission for this node.
 
PCP_API SdfPermission GetPermission () const
 
PCP_API void SetInert (bool inert)
 Get/set whether this node is inert.
 
PCP_API bool IsInert () const
 
PCP_API void SetCulled (bool culled)
 Get/set whether this node is culled.
 
PCP_API bool IsCulled () const
 
PCP_API void SetRestricted (bool restricted)
 Get/set whether this node is restricted.
 
PCP_API bool IsRestricted () const
 
PCP_API bool CanContributeSpecs () const
 Returns true if this node is allowed to contribute opinions for composition, false otherwise.
 
PCP_API size_t GetSpecContributionRestrictedDepth () const
 Returns the namespace depth (i.e., the path element count) of this node's path when it was restricted from contributing opinions for composition.
 
PCP_API void SetSpecContributionRestrictedDepth (size_t depth)
 Set this node's contribution restriction depth.
 
PCP_API void SetHasSpecs (bool hasSpecs)
 Returns true if this node has opinions authored for composition, false otherwise.
 
PCP_API bool HasSpecs () const
 

Friends

class PcpNodeIterator
 
PCP_API friend std::ostream & operator<< (std::ostream &out, const PcpNodeRef &node)
 

Operators / Miscellaneous

typedef size_t PcpNodeRef::* UnspecifiedBoolType
 Returns true if this is a valid node reference, false otherwise.
 
 operator UnspecifiedBoolType () const
 
bool operator== (const PcpNodeRef &rhs) const
 Returns true if this references the same node as rhs.
 
bool operator!= (const PcpNodeRef &rhs) const
 Inequality operator.
 
PCP_API bool operator< (const PcpNodeRef &rhs) const
 Returns true if this node is 'less' than rhs.
 
bool operator<= (const PcpNodeRef &rhs) const
 Less than or equal operator.
 
bool operator> (const PcpNodeRef &rhs) const
 Greater than operator.
 
bool operator>= (const PcpNodeRef &rhs) const
 Greater than or equal operator.
 
PcpPrimIndex_Graph * GetOwningGraph () const
 Returns the graph that this node belongs to.
 
PCP_API void * GetUniqueIdentifier () const
 Returns a value that uniquely identifies this node.
 

Detailed Description

PcpNode represents a node in an expression tree for compositing scene description.

A node represents the opinions from a particular site. In addition, it may have child nodes, representing nested expressions that are composited over/under this node.

Child nodes are stored and composited in strength order.

Each node holds information about the arc to its parent. This captures both the relative strength of the sub-expression as well as any value-mapping needed, such as to rename opinions from a model to use in a particular instance.

Definition at line 46 of file node.h.

Member Typedef Documentation

◆ child_const_iterator

typedef PcpNodeRef_ChildrenIterator child_const_iterator

Definition at line 49 of file node.h.

◆ child_const_range

typedef std::pair<child_const_iterator, child_const_iterator> child_const_range

Definition at line 52 of file node.h.

◆ child_const_reverse_iterator

typedef PcpNodeRef_ChildrenReverseIterator child_const_reverse_iterator

Definition at line 50 of file node.h.

◆ child_const_reverse_range

typedef std::pair<child_const_reverse_iterator, child_const_reverse_iterator> child_const_reverse_range

Definition at line 54 of file node.h.

◆ UnspecifiedBoolType

typedef size_t PcpNodeRef::* UnspecifiedBoolType

Returns true if this is a valid node reference, false otherwise.

Definition at line 62 of file node.h.

Constructor & Destructor Documentation

◆ PcpNodeRef()

PcpNodeRef ( )
inline

Definition at line 56 of file node.h.

Member Function Documentation

◆ CanContributeSpecs()

PCP_API bool CanContributeSpecs ( ) const

Returns true if this node is allowed to contribute opinions for composition, false otherwise.

◆ GetArcType()

PCP_API PcpArcType GetArcType ( ) const

Returns the type of arc connecting this node to its parent node.

◆ GetChildrenRange()

PCP_API child_const_range GetChildrenRange ( ) const

Returns an iterator range over the children nodes in strongest to weakest order.

◆ GetChildrenReverseRange()

PCP_API child_const_reverse_range GetChildrenReverseRange ( ) const

Returns an iterator range over the children nodes in weakest to strongest order.

◆ GetCompressedSdSite()

Pcp_CompressedSdSite GetCompressedSdSite ( size_t  layerIndex) const
inline

Definition at line 326 of file node.h.

◆ GetDepthBelowIntroduction()

PCP_API int GetDepthBelowIntroduction ( ) const

Return the number of levels of namespace this node's site is below the level at which it was introduced by an arc.

◆ GetIntroPath()

PCP_API SdfPath GetIntroPath ( ) const

Get the path that introduced this node.

Specifically, this is the path the parent node had at the level of namespace where this node was added as a child. For a root node, this returns the absolute root path. See also GetDepthBelowIntroduction().

◆ GetLayerStack()

PCP_API const PcpLayerStackRefPtr & GetLayerStack ( ) const

Returns the layer stack for the site this node represents.

◆ GetMapToParent()

PCP_API const PcpMapExpression & GetMapToParent ( ) const

Returns mapping function used to translate paths and values from this node to its parent node.

◆ GetMapToRoot()

PCP_API const PcpMapExpression & GetMapToRoot ( ) const

Returns mapping function used to translate paths and values from this node directly to the root node.

◆ GetNamespaceDepth()

PCP_API int GetNamespaceDepth ( ) const

Returns the absolute namespace depth of the node that introduced this node.

Note that this does not count any variant selections.

◆ GetOriginNode()

PCP_API PcpNodeRef GetOriginNode ( ) const

Returns the immediate origin node for this node.

The origin node is the node that caused this node to be brought into the prim index. In most cases, this is the same as the parent node. For implied inherits, the origin is the node from which this node was propagated.

◆ GetOriginRootNode()

PCP_API PcpNodeRef GetOriginRootNode ( ) const

Walk up to the root origin node for this node.

This is the very first node that caused this node to be added to the graph. For instance, the root origin node of an implied inherit is the original inherit node.

◆ GetOwningGraph()

PcpPrimIndex_Graph * GetOwningGraph ( ) const
inline

Returns the graph that this node belongs to.

Definition at line 109 of file node.h.

◆ GetParentNode()

PCP_API PcpNodeRef GetParentNode ( ) const

Returns this node's immediate parent node.

Will return NULL if this node is a root node.

◆ GetPath()

PCP_API const SdfPath & GetPath ( ) const

Returns the path for the site this node represents.

◆ GetPathAtIntroduction()

PCP_API SdfPath GetPathAtIntroduction ( ) const

Returns the path for this node's site when it was introduced.

◆ GetPathAtOriginRootIntroduction()

PCP_API SdfPath GetPathAtOriginRootIntroduction ( ) const

Returns the node's path at the same level of namespace as its origin root node was when it was added as a child.

For most nodes, this will return the same result as GetPathAtIntroduction(). But for implied class nodes, GetPathAtIntroduction() returns the path at which the implied node was added to the tree which could be at deeper level of namespace than its origin was introduced if the origin node was already ancestral when it was implied. In some cases, what you really need is the path that the original authored class arc maps to at this node's implied site and this function returns that.

◆ GetRootNode()

PCP_API PcpNodeRef GetRootNode ( ) const

Walk up to the root node of this expression.

◆ GetSiblingNumAtOrigin()

PCP_API int GetSiblingNumAtOrigin ( ) const

Returns this node's index among siblings with the same arc type at this node's origin.

◆ GetSite()

PCP_API PcpLayerStackSite GetSite ( ) const

Get the site this node represents.

◆ GetSpecContributionRestrictedDepth()

PCP_API size_t GetSpecContributionRestrictedDepth ( ) const

Returns the namespace depth (i.e., the path element count) of this node's path when it was restricted from contributing opinions for composition.

If this spec has no such restriction, returns 0.

Note that unlike the value returned by GetNamespaceDepth, this value does include variant selections.

◆ GetUniqueIdentifier()

PCP_API void * GetUniqueIdentifier ( ) const

Returns a value that uniquely identifies this node.

◆ InsertChild()

PCP_API PcpNodeRef InsertChild ( const PcpLayerStackSite site,
const PcpArc arc,
PcpErrorBasePtr *  error 
)

Inserts a new child node for site, connected to this node via arc.

◆ InsertChildSubgraph()

PCP_API PcpNodeRef InsertChildSubgraph ( const PcpPrimIndex_GraphRefPtr &  subgraph,
const PcpArc arc,
PcpErrorBasePtr *  error 
)

Inserts subgraph as a child of this node, with the root node of subtree connected to this node via arc.

◆ IsRootNode()

PCP_API bool IsRootNode ( ) const

Returns true if this node is the root node of the prim index graph.

◆ operator UnspecifiedBoolType()

operator UnspecifiedBoolType ( ) const
inline

Definition at line 63 of file node.h.

◆ operator!=()

bool operator!= ( const PcpNodeRef rhs) const
inline

Inequality operator.

See also
PcpNodeRef::operator==(const PcpNodeRef&)

Definition at line 74 of file node.h.

◆ operator<()

PCP_API bool operator< ( const PcpNodeRef rhs) const

Returns true if this node is 'less' than rhs.

The ordering of nodes is arbitrary and does not indicate the relative strength of the nodes.

◆ operator<=()

bool operator<= ( const PcpNodeRef rhs) const
inline

Less than or equal operator.

See also
PcpNodeRef::operator<(const PcpNodeRef&)

Definition at line 86 of file node.h.

◆ operator==()

bool operator== ( const PcpNodeRef rhs) const
inline

Returns true if this references the same node as rhs.

Definition at line 68 of file node.h.

◆ operator>()

bool operator> ( const PcpNodeRef rhs) const
inline

Greater than operator.

See also
PcpNodeRef::operator<(const PcpNodeRef&)

Definition at line 92 of file node.h.

◆ operator>=()

bool operator>= ( const PcpNodeRef rhs) const
inline

Greater than or equal operator.

See also
PcpNodeRef::operator<(const PcpNodeRef&)

Definition at line 98 of file node.h.

◆ SetCulled()

PCP_API void SetCulled ( bool  culled)

Get/set whether this node is culled.

If a node is culled, it and all descendant nodes provide no opinions to the index. A culled node is also considered inert.

◆ SetHasSpecs()

PCP_API void SetHasSpecs ( bool  hasSpecs)

Returns true if this node has opinions authored for composition, false otherwise.

◆ SetHasSymmetry()

PCP_API void SetHasSymmetry ( bool  hasSymmetry)

Get/set whether this node provides any symmetry opinions, either directly or from a namespace ancestor.

◆ SetInert()

PCP_API void SetInert ( bool  inert)

Get/set whether this node is inert.

An inert node never provides any opinions to a prim index. Such a node may exist purely as a marker to represent certain composition structure, but should never contribute opinions.

◆ SetIsDueToAncestor()

PCP_API void SetIsDueToAncestor ( bool  isDueToAncestor)

Get/set whether this node was introduced by being copied from its namespace ancestor, or directly by an arc at this level of namespace.

◆ SetPermission()

PCP_API void SetPermission ( SdfPermission  perm)

Get/set the permission for this node.

This indicates whether specs on this node can be accessed from other nodes.

◆ SetRestricted()

PCP_API void SetRestricted ( bool  restricted)

Get/set whether this node is restricted.

A restricted node is a node that cannot contribute opinions to the index due to permissions.

◆ SetSpecContributionRestrictedDepth()

PCP_API void SetSpecContributionRestrictedDepth ( size_t  depth)

Set this node's contribution restriction depth.

Note that this function typically does not need to be called, since functions that restrict contributions (e.g., SetInert) automatically set the restriction depth appropriately.

Friends And Related Function Documentation

◆ PcpNodeIterator

friend class PcpNodeIterator
friend

Definition at line 336 of file node.h.


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