Returns a FoscTreeNode.
A tree node.
| depth | |
| depthwiseInventory | A dictionary of all nodes in a rhythm-tree, organized by their depth relative the root node. |
| index | |
| improperParentage | The improper parentage of a node in a rhythm-tree, being the sequence of node beginning with itself and ending with the root node of the tree. |
| isRoot | |
| properParentage | The proper parentage of a node in a rhythm-tree, being the sequence of node beginning with the node’s immediate parent and ending with the root node of the tree. |
| root | |
| siblings |
A dictionary of all nodes in a rhythm-tree, organized by their depth relative the root node.
Returns dictionary.
Example
a = FoscTreeContainer(name: 'a');
b = FoscTreeContainer(name: 'b');
c = FoscTreeContainer(name: 'c');
d = FoscTreeContainer(name: 'd');
e = FoscTreeContainer(name: 'e');
f = FoscTreeContainer(name: 'f');
g = FoscTreeContainer(name: 'g');
a.addAll([b, c]);
b.addAll([d, e]);
c.addAll([f, g]);
i = a.depthwiseInventory;
k = i.keys.as(Array).sort;
o = [];
k.do { |depth, items|
o = o.add("depth: %".format(depth));
i[depth].do { |node|
o = o.add("%%".format("".padLeft(depth, "\t"), node.name));
};
};
o.join("\n");depth: 0
a
depth: 1
b
c
depth: 2
d
e
f
gThe improper parentage of a node in a rhythm-tree, being the sequence of node beginning with itself and ending with the root node of the tree.
Returns array of tree nodes.
Example
a = FoscTreeContainer();
b = FoscTreeContainer();
c = FoscTreeNode();
a.add(b);
b.add(c);
a.improperParentage == [a]; // truetrue
b.improperParentage == [b, a]; // truetrue
c.improperParentage == [c, b, a]; // truetrueThe proper parentage of a node in a rhythm-tree, being the sequence of node beginning with the node’s immediate parent and ending with the root node of the tree.
Returns array of tree nodes.
Example
a = FoscTreeContainer();
b = FoscTreeContainer();
c = FoscTreeNode();
a.add(b);
b.add(c);
a.properParentage == []; // truetrue
b.properParentage == [a]; // truetrue
c.properParentage == [b, a]; // truetrue