Karana.KUtils.MultibodyWebUI#
A GUI used to inspect a Multibody.
Classes#
MultibodyWebUI class. |
|
Interface for an info card for a given item type. |
|
Package Contents#
- class Karana.KUtils.MultibodyWebUI.MultibodyWebUI(mbody: Karana.Dynamics.Multibody, *, port: int = 29534, stick_parts: Literal['auto', 'always', 'never'] = 'auto', stick_parts_config: Karana.Dynamics.StickPartsConfig | None = None, graphics_origin_frame: Karana.Frame.Frame | None = None, name_to_label_map: dict[int | str, str] | None = None, sp: Karana.Dynamics.StatePropagator | None = None, sim: Sim | None = None, time_display_period: float | None = 0.01)[source]#
MultibodyWebUI class.
This class creates a Multibody-centric web-based GUI
- sim = None#
- cleanups#
- worker#
- server#
- router#
- error_count = 0#
- notifier#
- selection: Karana.WebUI.State#
- hovered: Karana.WebUI.State#
- webscene_selection_mode = 'Body'#
- scene: Karana.Scene.ProxyScene#
- graphics: Karana.Scene.WebScene#
- graphics_frame#
- effects#
- visjs_frames_server: Karana.KUtils.visjs.GraphServer#
- visjs_frames_iframe#
- visjs_label_map = None#
- visjs_server: Karana.KUtils.visjs.MultibodyGraphServer#
- visjs_iframe#
- visjs_servers: dict[int, tuple[Karana.KUtils.visjs.MultibodyGraphServer, bool]]#
- mbody_tree_view#
- subtrees_tree_view#
- wmain#
- treeviews_options = []#
- wtreeviews#
- wwebscene_selection_mode#
- webscene_view_mode = 'pers_free'#
- wwebscene_view_mode#
- wdeselect#
- wreset_viz#
# slider to scale the stick parts slider_opts = kw.SliderOptions() slider_opts.min = 0.01 slider_opts.max = 1 slider_opts.step = 0.01
- waxes_scale#
- wcamera_physical#
- wcamera_collision#
- wcamera_stick#
- wshadows#
- wlayout_3d#
- wscene#
- wtoolbar#
- dock#
- info_panel#
- setAxesGlobalScale(part: float, line: float | None = None)[source]#
Set the global scaling factor for axes.
- class Karana.KUtils.MultibodyWebUI.AbstractCard(context: GuiContext)[source]#
Bases:
abc.ABC,WrappedTypeMixin[T]Interface for an info card for a given item type.
- property item: T#
Get the current item or throw an error if it isn’t set.
- getItem() T | None[source]#
Get the current item or None if it isn’t set.
If the item was previously set but has gone out of scope, throws an error.
- property context: GuiContext#
- property label: str#
- Abstractmethod:
Get a text label for this card.
- property wroot: Karana.WebUI.Layout#
Get the root widget for this card.
- teardown(_: T, /)[source]#
Do any necessary cleanup when leaving the given item.
Cards MAY override this if any cleanup is needed.
- setup(item: T, item_context: Karana.WebUI.Json, /)[source]#
Set up the card for the new item.
Derived Card classes SHOULD call this to update the header and summary.
- class Karana.KUtils.MultibodyWebUI.GuiContext[source]#
- dock: Karana.WebUI.Dock#
- router: Karana.WebUI.Router#
- selection: Karana.WebUI.State#
- multibody: Karana.Dynamics.Multibody#
- scene: Karana.Scene.ProxyScene#
- graphics: Karana.Scene.WebScene#
- effects: Karana.KUtils.MultibodyWebUI._effects.EffectManager#
- mbody_tree_view: Karana.WebUI.TreeView#
- subtrees_tree_view: Karana.WebUI.TreeView#
- setup_visjs: Callable#
- setup_info_panel: Callable#
- visjs_servers: dict[int, tuple[Karana.KUtils.visjs.MultibodyGraphServer, bool]]#
- visjs_frames_server: Karana.KUtils.visjs.NetworkGraph#
- setup_frames_visjs: Callable#
- visjs_iframe: Karana.WebUI.IFrame#
- graphics_frame: Karana.WebUI.IFrame#
- signal_error: Callable#
- worker: Karana.KUtils.MultibodyWebUI._worker.AsyncWorker#