maxon.NodePathInterface¶
Description¶
maxon.NodePath
identifies a graph node (a true node, port or port list) within a node graph.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.
Attributes¶
Methods Signature¶
|
Compares this and other. |
|
|
|
Parses a node path given as a character block into a NodePath object. |
|
Returns the length of this path. |
Returns the hash code of |
|
|
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 ( |
Returns the last element of this path. |
|
|
Returns only the path of the node without ports. |
Returns the hierarchy depth of the true node which is identified by this path.
|
|
Returns the path of the parent of this path. |
|
|
Returns a part of this node path as a new NodePath. |
Returns the port part of this path as a new NodePath.
|
|
Returns only the relative port path without the node path. |
|
Returns the path to the @ref Port “top-level port” of this path.
|
|
|
Checks if this path is an empty path. |
Checks if the identifier i stands for the input or output port list of a node, so if it is either ‘<’ or ‘>’. |
|
Checks if this path contains anything. |
|
Checks if this path identifies a port of the root node of a node system.
|
|
Checks if this path identifies a “top-level port”.
|
|
|
|
|
|
|
Prepends a node prefix at the beginning of this path. |
|
Checks whether this path starts with other. |
|
|
|
Appends a node subpath at the end of this path. |
|
Checks if self equals to other. |
|
Returns the path element at the given #index. |
|
Return hash(self). |
|
Returns an iterator pointing to the first identifier of this path. |
|
Return self<=value. |
|
Return self<value. |
|
Checks if self is not equals to other. |
Methods Definition¶
-
NodePathInterface.
Compare
(other)¶ Compares this and other.
- Parameters
other – Another
maxon.NodePath
- Return type
- Returns
Result of the comparison
-
static
NodePathInterface.
DescribeIO
(*args)¶
-
static
NodePathInterface.
FromCString
(path)¶ Parses a node path given as a character block into a NodePath object.
The given #path has to match the format returned by ToCString, otherwise an error is returned.
- Parameters
path (
maxon.Block
[maxon.Char
]) – The path to parse.- Returns
The parsed NodePath.
- Return type
-
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.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 (
maxon.NODE_KIND.NODE
), for example node/child. - A path which ends with < or > is a port list (maxon.NODE_KIND.INPUTS
ormaxon.NODE_KIND.OUTPUTS
), for example node/child/<. - A path which contains < or >, but does not end with such an identifier is a port (maxon.NODE_KIND.INPORT
ormaxon.NODE_KIND.OUTPORT
), for example node/child/</in.- Returns
The node kind of the graph node identified by this path.
- Return type
-
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
-
NodePathInterface.
GetNode
()¶ Returns only the path of the node without ports.
- Returns
maxon.NodePath
with the node path on success.- Return type
-
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
- 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
-
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
-
NodePathInterface.
GetPortPath
()¶ Returns only the relative port path without the node path.
- Returns
PathBlock with the ports on success.
- Return type
-
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
-
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
[maxon.InternedId
]) – The prefix to insert.- Returns
The newly
maxon.NodePath
- Return type
-
NodePathInterface.
PrivateGetKind
()¶
-
NodePathInterface.
StartsWith
(other)¶ Checks whether this path starts with other.
- Parameters
other (
maxon.Block
[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
()¶
-
NodePathInterface.
__add__
(other)¶ Appends a node subpath at the end of this path.
- Parameters
other (Union[
maxon.Id
, str,maxon.InternedId
,maxon.NodePath
]) – The subpath to append.- Returns
The operation result.
- Return type
-
NodePathInterface.
__eq__
(other)¶ Checks if self equals to other.
- Parameters
other (Union[
maxon.Id
, str,maxon.InternedId
,maxon.NodePath
]) – The other to check against self.- Returns
True if this equals other, False otherwise.
-
NodePathInterface.
__getitem__
(index)¶ Returns the path element at the given #index.
Note
The index is zero-based, i.e., from 0 up to length-1.
- Parameters
index (int) – The index of the element to return. It has to be within the bounds, otherwise the behaviour is undefined.
- Returns
The path element at index.
- Return type
-
NodePathInterface.
__hash__
()¶ Return hash(self).
-
NodePathInterface.
__iter__
()¶ Returns an iterator pointing to the first identifier of this path.
- Returns
Generator pointing to first identifier.
- Return type
Generator[
maxon.InternedId
]
-
NodePathInterface.
__le__
(other)¶ Return self<=value.
-
NodePathInterface.
__lt__
(other)¶ Return self<value.
-
NodePathInterface.
__ne__
(other)¶ Checks if self is not equals to other.
- Parameters
other (Union[
maxon.Id
, str,maxon.InternedId
,maxon.NodePath
]) – The other to check against self.- Returns
True if this is not equals other, False otherwise.