opynsim.ui#
- opynsim.ui.show_hello_ui() None#
Displays OPynSim’s ‘hello world’ user interface in a window.
Blocks and runs the GUI main loop until the window is closed.
- opynsim.ui.show_model_in_state(model: Model, model_state: ModelState, *, dimensions: tuple[int, int] = (640, 480), background_color: graphics.Color = Color(1, 1, 1, 1), draw_floor: bool = False, scene_cache: graphics.SceneCache | None = None) None#
Displays an interactive visualizer for the given
opynsim.Model+opynsim.ModelStatein a window.Blocks and runs the GUI main loop until the window is closed.
- Parameters:
model (opynsim.Model) – The model to show.
model_state (opynsim.ModelState) – The state of the model to render. Should be realized to at least
opynsim.ModelStateStage.REPORT.dimensions (tuple[int, int]) – The desired output resolution (width, height) of the rendered image in pixels.
background_color (opynsim.graphics.Color) – The desired background color of the rendered scene.
draw_floor (bool) – Toggles drawing a chequered floor at Y=0 in the scene.
scene_cache (opynsim.graphics.SceneCache) – A scene cache from which the implementation pulls cached scene elements (shaders, meshes, etc.). Otherwise, the implementation loads all assets every time this function is called (slow).