Source code for wolfhece._simtools2d_gpu_manager
"""
Companion manager for Tools 2D GPU menus and actions.
Extracted from PyDraw.WolfMapViewer.
"""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING
import wx
from .PyTranslate import _
if TYPE_CHECKING:
from .PyDraw import WolfMapViewer
[docs]
class SimTools2DGPUManager:
"""Manages the Tools 2D GPU menu and associated actions."""
def __init__(self, viewer: 'WolfMapViewer') -> None:
# ------------------------------------------------------------------
# Menu build
# ------------------------------------------------------------------
# ------------------------------------------------------------------
# Action handlers
# ------------------------------------------------------------------
[docs]
def _on_parameters(self, event: wx.MenuEvent) -> None:
from .PyGui import Wolf2DGPUModel
v = self._viewer
if not isinstance(v.wolfparent, Wolf2DGPUModel):
logging.error(_('This is not a 2D GPU model'))
return
v.wolfparent.show_properties()