wolfhece._drowning_manager ========================== .. py:module:: wolfhece._drowning_manager .. autoapi-nested-parse:: Drowning-victim companion object for WolfMapViewer. All drowning-simulation management logic lives here. ``WolfMapViewer`` holds a single instance as ``self._drowning`` and exposes one-line delegators so that external callers remain unaffected. Design notes ------------ * ``DrowningManager`` owns the ``active_drowning`` reference, the ``mydrownings`` list, and all menu state (``menudrowning`` hierarchy + check-item references). * The wx parent for dialogs and menus is always ``self._viewer``. * ``menu_build()`` is idempotent — the first call creates and appends the "Drowning" menu to the menubar; subsequent calls are no-ops. * ``on_menu()`` is bound to the wx menu and dispatches all drowning commands. * ``new_drowning()`` handles both "Create" and "Add" from the object toolbar. * ``register()`` is called from ``WolfMapViewer.add_object`` to record a newly created ``Drowning_victim_Viewer`` instance and update the active reference. Module Contents --------------- .. py:class:: DrowningManager(viewer: wolfhece.PyDraw.WolfMapViewer) Companion object that owns drowning-victim simulation state. Instantiated once as ``viewer._drowning = DrowningManager(viewer)`` inside ``WolfMapViewer.__init__``. .. py:attribute:: _viewer .. py:attribute:: mydrownings :type: list[wolfhece.drowning_victims.drowning_class.Drowning_victim_Viewer] :value: [] .. py:attribute:: active :type: Drowning_victim_Viewer | None :value: None .. py:attribute:: _menu :type: wx.Menu | None :value: None .. py:attribute:: _menu_plot :type: wx.Menu | None :value: None .. py:attribute:: _item_plot_runs :type: wx.MenuItem | None :value: None .. py:attribute:: _item_plot_cells :type: wx.MenuItem | None :value: None .. py:attribute:: _item_plot_kde :type: wx.MenuItem | None :value: None .. py:method:: register(newobj: wolfhece.drowning_victims.drowning_class.Drowning_victim_Viewer) -> None Add *newobj* to the registry and make it the active drowning. .. py:method:: menu_build() -> None Create and append the 'Drowning' menu to the viewer menubar. Safe to call multiple times — only the first call has any effect. .. py:method:: _on_last_result(event: wx.MenuEvent) -> None .. py:method:: _on_explore(event: wx.MenuEvent) -> None .. py:method:: _on_plot_runs(event: wx.MenuEvent) -> None .. py:method:: _on_plot_cells(event: wx.MenuEvent) -> None .. py:method:: _on_plot_kde(event: wx.MenuEvent) -> None .. py:method:: _on_zoom_hotspots(event: wx.MenuEvent) -> None .. py:method:: _on_bodies(event: wx.MenuEvent) -> None .. py:method:: _on_vpos(event: wx.MenuEvent) -> None .. py:method:: _on_video(event: wx.MenuEvent) -> None .. py:method:: new_drowning(itemlabel: str) -> None Handle 'Create a drowning...' and 'Add a drowning result...' items.