mxutils.DebugNode¶
Description¶
Realizes a simple tree structure used in printing debug information.
Inheritance diagram¶
Attributes¶
Gets an immutable tuple of the child nodes of the node. |
|
Gets the depth of the node in the tree. |
|
Gets the label of the node, i.e., what is printed in a debug tree. |
|
Gets the ID of the node. |
|
Gets the pointed parent node of the node. |
Methods Signature¶
|
Adds a child node to the node. |
|
Finds a node by its ID. |
|
Builds a tree structure from a string representation. |
|
Removes the node from its parent. |
|
Returns the string representation of the current node and its subtree. |
|
Initializes a DebugNode instance. |
|
Returns the label of the node. |
|
Returns the label of the node. |
Methods Definition¶
-
DebugNode.Add(child: mxutils.mxu_scene.DebugNode) → None¶ Adds a child node to the node.
- Parameters
child – The child node to add.
- Raises
ValueError – If the child already has a parent.
-
DebugNode.Find(nid: tuple) → mxutils.mxu_scene.DebugNode | None¶ Finds a node by its ID.
- Parameters
nid – The ID of the node to find.
- Returns
The node with the specified ID, or None if not found.
- Return type
DebugNode | None
-
static
DebugNode.FromString(input: str, indentation: int = 4) → mxutils.mxu_scene.DebugNode¶ Builds a tree structure from a string representation.
- Parameters
input – The string representation of the tree structure.
indentation – The number of spaces used for indentation.
- Returns
The root node of the constructed tree.
- Return type
DebugNode
-
DebugNode.Remove() → None¶ Removes the node from its parent.
-
DebugNode.ToString() → str¶ Returns the string representation of the current node and its subtree.
- Returns
The string representation of the current node and its subtree.
- Return type
str
-
DebugNode.__init__(name: str, nid: tuple[int] | None = None) → None¶ Initializes a DebugNode instance.
- Parameters
name – The label of the node.
nid – The ID of the node as a tuple of integers.
-
DebugNode.__repr__() → str¶ Returns the label of the node.
-
DebugNode.__str__()¶ Returns the label of the node.