maxon.frameworks.graph.NodePathInterface

Description

A maxon.frameworks.graph.NodePath identifies a graph node (a true node, port or port list) within a node graph.
It consists of a list of identifiers (one for each hierarchy level) just like the path of a file in a file system. In the textual notation of a path we use / as separator character (except around < or >, see below).
The root node has an empty path, and port lists use the special identifiers < (input port list) and > (output port list).
For example in the graph there are the following paths:
  • The empty path identifies the root node.

  • < is the path of the input port list of the root node (containing the object port), > of the output port list (containing the center port).

  • <object, <object/geometry, <object/bounds are the paths of the input ports of the root node.

  • >center is the path of the output port of the root node.

  • x is the path of the child node x.

  • x has the input port x<bounds and the output port x>c.

  • x has the inner node x/n with ports x/n<in and x/n>out.

A path cannot contain more than one of the port list identifiers < or >.
All methods which initialize or modify a path return an error if the result was such an invalid path.
To make the string representation shorter and more readable, the separator character / is only used between regular identifiers, but not around the port list identifiers < or >.
Therefore we write e.g. x/n>out instead of x/n/>/out.

Inheritance diagram

Inheritance

Child Class:

Attributes

maxon.frameworks.graph.NodePathInterface.INPUTS

maxon.frameworks.graph.NodePathInterface.OUTPUTS

maxon.frameworks.graph.NodePathInterface.TEMPLATE

Methods Signature

Compare(other)

Compares this and other.

DescribeIO()

GetCount()

Returns the length of this path.

GetHashCode()

Returns the hash code of maxon.frameworks.graph.NodePath.

GetKind()

Returns the node kind of the graph node which is identified by this path: - A path without path list identifiers < or > is a true node (NODE_KIND::NODE), for example node/child.

GetLastId()

Returns the last element of this path.

GetNode()

Returns only the path of the node without ports.

GetNodeDepth()

Returns the hierarchy depth of the true node which is identified by this path.

GetParent()

Returns the path of the parent of this path.

GetPart(src, count)

Returns a part of this node path as a new NodePath.

GetPortPart()

Returns the port part of this path as a new NodePath.

GetPortPath()

Returns only the relative port path without the node path.

GetTopLevelPort()

Returns the path to the @ref Port “top-level port” of this path.

IsEmpty()

Checks if this path is an empty path.

IsInputsOrOutputs(i)

Checks if the identifier i stands for the input or output port list of a node, so if it is either ‘<’ or ‘>’.

IsPopulated()

Checks if this path contains anything.

IsPortOfRoot()

Checks if this path identifies a port of the root node of a node system.

IsTopLevelPort()

Checks if this path identifies a “top-level port”.

LessThan(other)

LessThanOrEqual(other)

Prepend(prefix)

Prepends a node prefix at the beginning of this path.

PrivateGetKind()

StartsWith(other)

Checks whether this path starts with other.

ToString()

Methods Definition

NodePathInterface.Compare(other)

Compares this and other.

Parameters

other – Another maxon.frameworks.graph.NodePath

Return type

maxon.COMPARERESULT

Returns

Result of the comparison

NodePathInterface.DescribeIO()
NodePathInterface.GetCount()

Returns the length of this path.

Note

The path elements have indices from 0 up to length-1.

Returns

Number of elements of this path.

Return type

int

NodePathInterface.GetHashCode()

Returns the hash code of maxon.frameworks.graph.NodePath.

Returns

Hash code.

Return type

int

NodePathInterface.GetKind()

Returns the node kind of the graph node which is identified by this path: - A path without path list identifiers < or > is a true node (NODE_KIND::NODE), for example node/child. - A path which ends with < or > is a port list (NODE_KIND::INPUTS or NODE_KIND::OUTPUTS), for example node/child/<. - A path which contains < or >, but does not end with such an identifier is a port (NODE_KIND::INPORT or NODE_KIND::OUTPORT), for example node/child/</in.

Returns

The node kind of the graph node identified by this path.

Return type

maxon.frameworks.graph.NODE_KIND

NodePathInterface.GetLastId()

Returns the last element of this path.

Returns

Last element of this path, or an empty identifier if the path is empty.

Return type

maxon.frameworks.graph.InternedId

NodePathInterface.GetNode()

Returns only the path of the node without ports.

Returns

maxon.frameworks.graph.NodePath with the node path on success.

Return type

maxon.frameworks.graph.NodePath

NodePathInterface.GetNodeDepth()
Returns the hierarchy depth of the true node which is identified by this path.
If this path identifies a true node directly, the depth is the number of path elements. Otherwise, if this path identifies a port or port list, the depth is the depth of the innermost enclosing true node, i.e., the number of path elements up to but excluding the port list identifier.
For example all of the paths node/child, node/child/< and node/child/</in have a node depth of 2 because for all those paths node/child is the innermost true node.
Returns

The depth of the true node given by this path.

Return type

int

NodePathInterface.GetParent()

Returns the path of the parent of this path.

Return type

maxon.frameworks.graph.NodePath

Returns

The parent of this path, or an empty path if this path is already the root path.

NodePathInterface.GetPart(src, count)

Returns a part of this node path as a new NodePath.

Parameters
  • src (int) – Position where the new partial path will start. This has to be within the bounds, otherwise an error is returned.

  • count (int) – Number of identifiers for the partial path. If it is larger than the number of available identifiers an error is returned.

Returns

The partial path.

Return type

maxon.frameworks.graph.NodePath

NodePathInterface.GetPortPart()
Returns the port part of this path as a new NodePath.
The port parts starts at the input/output list identifier.
Returns

The port part of this path.

Return type

maxon.frameworks.graph.NodePath

NodePathInterface.GetPortPath()

Returns only the relative port path without the node path.

Returns

PathBlock with the ports on success.

Return type

maxon.Block`(:class:`maxon.InternedId)

NodePathInterface.GetTopLevelPort()
Returns the path to the @ref Port “top-level port” of this path.
The top-level port of a port is the outermost enclosing port, i.e., an enclosing port which is a direct child of a port list, or the port itself it this is already a direct child of a port list.
Returns

The path to the top-level port of the port given by this path. If this path doesn’t represent a port, an error is returned.

Return type

maxon.frameworks.graph.NodePath

NodePathInterface.IsEmpty()

Checks if this path is an empty path. The root node of a node system is identified by an empty path.

Returns

True if this is an empty path (of length 0), False otherwise.

Return type

bool

NodePathInterface.IsInputsOrOutputs(i)

Checks if the identifier i stands for the input or output port list of a node, so if it is either ‘<’ or ‘>’.

Parameters

i (maxon.InternedId) – An identifier for a general node.

Returns

True if the identifier stands for the input or output port list.

Return type

bool

NodePathInterface.IsPopulated()

Checks if this path contains anything.

Returns

True if this is not an empty path (of length 0), False otherwise.

Return type

bool

NodePathInterface.IsPortOfRoot()
Checks if this path identifies a port of the root node of a node system.
This includes not only top-level ports, but also nested ports.
Returns

True if this path stands for a port of the root node, False otherwise.

Return type

bool

NodePathInterface.IsTopLevelPort()
Checks if this path identifies a “top-level port”.
A top-level port is a port which is not nested within another port, but a direct child of the input or output port list of a node.
Return type

bool

Returns

True if this path stands for a top-level port, False otherwise.

NodePathInterface.LessThan(other)
NodePathInterface.LessThanOrEqual(other)
NodePathInterface.Prepend(prefix)

Prepends a node prefix at the beginning of this path.

Parameters

prefix (maxon.Block`(:class:`maxon.InternedId)) – The prefix to insert.

Returns

The newly maxon.frameworks.graph.NodePath

Return type

maxon.frameworks.graph.NodePath

NodePathInterface.PrivateGetKind()
NodePathInterface.StartsWith(other)

Checks whether this path starts with other.

Parameters

other (maxon.Block`(:class:`maxon.InternedId)) – Another path.

Returns

True if this path starts with the given path or in case of error, otherwise False.

Return type

bool

NodePathInterface.ToString()