wolfhece._drowning_manager

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

class wolfhece._drowning_manager.DrowningManager(viewer: wolfhece.PyDraw.WolfMapViewer)[source]

Companion object that owns drowning-victim simulation state.

Instantiated once as viewer._drowning = DrowningManager(viewer) inside WolfMapViewer.__init__.

_viewer[source]
mydrownings: list[wolfhece.drowning_victims.drowning_class.Drowning_victim_Viewer] = [][source]
active: Drowning_victim_Viewer | None = None[source]
_menu: wx.Menu | None = None[source]
_menu_plot: wx.Menu | None = None[source]
_item_plot_runs: wx.MenuItem | None = None[source]
_item_plot_cells: wx.MenuItem | None = None[source]
_item_plot_kde: wx.MenuItem | None = None[source]
register(newobj: wolfhece.drowning_victims.drowning_class.Drowning_victim_Viewer) None[source]

Add newobj to the registry and make it the active drowning.

menu_build() None[source]

Create and append the ‘Drowning’ menu to the viewer menubar.

Safe to call multiple times — only the first call has any effect.

_on_last_result(event: wx.MenuEvent) None[source]
_on_explore(event: wx.MenuEvent) None[source]
_on_plot_runs(event: wx.MenuEvent) None[source]
_on_plot_cells(event: wx.MenuEvent) None[source]
_on_plot_kde(event: wx.MenuEvent) None[source]
_on_zoom_hotspots(event: wx.MenuEvent) None[source]
_on_bodies(event: wx.MenuEvent) None[source]
_on_vpos(event: wx.MenuEvent) None[source]
_on_video(event: wx.MenuEvent) None[source]
new_drowning(itemlabel: str) None[source]

Handle ‘Create a drowning…’ and ‘Add a drowning result…’ items.