Treeform
- class Treeform[source]
Bases:
QTreeWidget
Class for displaying tree-like data. Treeform is an abstract class that could be placed in either the viewport or the sidedock.
- Parameters:
- tree
compas.datastructures.Tree
The tree to be displayed. An typical example is the scene object tree:
compas_viewer.viewer.Viewer._tree
.- columnsdict
A dictionary of column names and their corresponding attributes. Example: `` {“Name”: “object.name”, “Object”: “object”}``
- column_editablelist, optional
A list of booleans indicating whether the corresponding column is editable. Defaults to
[False]
.- show_headersbool, optional
Show the header of the tree. Defaults to
True
.- stretchint, optional
Stretch factor of the tree in the grid layout. Defaults to
2
.
- tree
See also
compas.datastructures.Tree
compas.datastructures.tree.TreeNode
compas_viewer.layout.SidedockLayout
References
Examples
from compas_viewer import Viewer viewer = Viewer() for i in range(10): for j in range(10): sp = viewer.add(Sphere(0.1, Frame([i, j, 0], [1, 0, 0], [0, 1, 0])), name=f"Sphere_{i}_{j}") viewer.layout.sidedock.add_element(Treeform(viewer._tree, {"Name":".object.name", "Object":".object"})) viewer.show()
- Attributes:
- tree
compas.datastructures.Tree
The tree to be displayed.
- tree
Methods
Inherited Methods