Tree Form¤
compas_model.viewer.treeform
¤
Classes¤
ModelTreeForm
¤
ModelTreeForm(
controller: ModelViewer,
selection_changed: Callable[[list[Element]], None] | None = None,
projection: Literal["hierarchy", "types", "collections"] = "hierarchy",
)
Tree widget synchronized with a model viewer controller.
Parameters:
-
controller(ModelViewer) –Controller providing model hierarchy and concrete scene objects.
-
selection_changed(Callable[[list[Element]], None] | None, default:None) –Optional callback receiving the selected model elements.
Notes
Tree items retain only element GUIDs. Model.tree remains the source of
hierarchy, and selection and visibility remain properties of the concrete
ElementObject instances managed by the controller.
Functions:¤
install_model_tree
¤
install_model_tree(
controller: ModelViewer,
selection_changed: Callable[[list[Element]], None] | None = None,
) -> ModelTreeForm
Replace COMPAS Viewer's generic scene tree with a model tree.
Parameters:
-
controller(ModelViewer) –Model viewer controller whose viewer UI should be updated.
Returns:
-
ModelTreeForm–Installed model hierarchy form.