|
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 PcpMapExpression & | GetMapToParent () const |
Returns mapping function used to translate paths and values from this node to its parent node. | |
PCP_API const PcpMapExpression & | GetMapToRoot () 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 SdfPath & | GetPath () 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. | |
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.
typedef std::pair<child_const_iterator, child_const_iterator> child_const_range |
typedef PcpNodeRef_ChildrenReverseIterator child_const_reverse_iterator |
typedef std::pair<child_const_reverse_iterator, child_const_reverse_iterator> child_const_reverse_range |
typedef size_t PcpNodeRef::* UnspecifiedBoolType |
|
inline |
PCP_API bool CanContributeSpecs | ( | ) | const |
Returns true if this node is allowed to contribute opinions for composition, false otherwise.
PCP_API PcpArcType GetArcType | ( | ) | const |
Returns the type of arc connecting this node to its 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.
|
inline |
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 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().
PCP_API const PcpLayerStackRefPtr & GetLayerStack | ( | ) | const |
Returns the layer stack for the site this node represents.
PCP_API const PcpMapExpression & GetMapToParent | ( | ) | const |
Returns mapping function used to translate paths and values from this node to its parent node.
PCP_API const PcpMapExpression & GetMapToRoot | ( | ) | const |
Returns mapping function used to translate paths and values from this node directly to the root node.
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.
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.
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.
|
inline |
PCP_API PcpNodeRef GetParentNode | ( | ) | const |
Returns this node's immediate parent node.
Will return NULL if this node is a root node.
PCP_API const SdfPath & GetPath | ( | ) | const |
Returns the path for the site this node represents.
PCP_API SdfPath GetPathAtIntroduction | ( | ) | const |
Returns the path for this node's site when it was introduced.
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.
PCP_API PcpNodeRef GetRootNode | ( | ) | const |
Walk up to the root node of this expression.
PCP_API int GetSiblingNumAtOrigin | ( | ) | const |
Returns this node's index among siblings with the same arc type at this node's origin.
PCP_API PcpLayerStackSite GetSite | ( | ) | const |
Get the site this node represents.
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.
PCP_API void * GetUniqueIdentifier | ( | ) | const |
Returns a value that uniquely identifies this node.
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 bool IsRootNode | ( | ) | const |
Returns true if this node is the root node of the prim index graph.
|
inline |
|
inline |
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.
|
inline |
|
inline |
|
inline |
|
inline |
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.
PCP_API void SetHasSpecs | ( | bool | hasSpecs | ) |
Returns true if this node has opinions authored for composition, false otherwise.
PCP_API void SetHasSymmetry | ( | bool | hasSymmetry | ) |
Get/set whether this node provides any symmetry opinions, either directly or from a namespace ancestor.
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.
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 void SetPermission | ( | SdfPermission | perm | ) |
Get/set the permission for this node.
This indicates whether specs on this node can be accessed from other nodes.
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.
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.
|
friend |