"""
ActionKind — canonical enumeration of every interactive action in WolfMapViewer.
Inheriting from ``str`` means that all existing comparisons of the form
``self.action == 'sculpt'``
continue to work during progressive migration: ActionKind.SCULPT is a plain
``str`` whose value is ``'sculpt'``, so equality is transparent.
Convention
----------
* Values are **lowercase** for all actions that are set through
:meth:`WolfMapViewer.start_action`, which applies ``.lower()``
before storing the string in ``self.action``.
"""
from enum import Enum
[docs]
class ActionKind(str, Enum):
"""All interactive actions of WolfMapViewer."""
# --- cloud ---
[docs]
ADD_POINTS_TO_CLOUD = 'add points to cloud'
[docs]
MOVE_POINT_IN_CLOUD = 'move point in cloud'
# --- tiles ---
[docs]
CREATE_POLYGON_TILES = 'create polygon - tiles'
[docs]
SELECT_ACTIVE_TILE = 'select active tile'
[docs]
SELECT_ACTIVE_IMAGE_TILE = 'select active image tile'
# --- LAZ ---
[docs]
LAZ_TMP_VECTOR = 'laz tmp vector'
# --- triangulations ---
[docs]
MOVE_TRIANGLES = 'move triangles'
[docs]
ROTATE_TRIANGLES = 'rotate triangles'
# --- vertex editing ---
[docs]
CAPTURE_VERTICES = 'capture vertices'
[docs]
MODIFY_VERTICES = 'modify vertices'
[docs]
INSERT_VERTICES = 'insert vertices'
# --- dynamics ---
[docs]
DYNAMIC_PARALLEL = 'dynamic parallel'
# --- vector / zone ---
[docs]
MOVE_VECTOR = 'move vector'
[docs]
MOVE_ZONE = 'move zone'
[docs]
ROTATE_VECTOR = 'rotate vector'
[docs]
ROTATE_ZONE = 'rotate zone'
# --- image ---
[docs]
OFFSET_SCALE_IMAGE = 'offset/scale image'
# --- node selection ---
[docs]
SELECT_NODE_BY_NODE = 'select node by node'
[docs]
SELECT_NODE_BY_NODE_RESULTS = 'select node by node - results'
# --- vector-based selection ---
[docs]
SELECT_BY_VECTOR_INSIDE = 'select by vector inside'
[docs]
SELECT_BY_VECTOR_OUTSIDE = 'select by vector outside'
[docs]
SELECT_BY_VECTOR_ALONG = 'select by vector along'
[docs]
SELECT_BY_TMP_VECTOR_INSIDE = 'select by tmp vector inside'
[docs]
SELECT_BY_TMP_VECTOR_ALONG = 'select by tmp vector along'
[docs]
SELECT_ACTIVE_VECTOR_INSIDE = 'select active vector inside'
[docs]
SELECT_ACTIVE_VECTOR_ALL = 'select active vector all'
[docs]
SELECT_ACTIVE_VECTOR2_INSIDE= 'select active vector2 inside'
[docs]
SELECT_ACTIVE_VECTOR2_ALL = 'select active vector2 all'
# --- asset / rendering ---
[docs]
PICK_PIE_CENTER = 'pick pie center'
[docs]
PICK_BAR_POSITION = 'pick bar position'
[docs]
PICK_CURVE_ORIGIN = 'pick curve canvas origin'
# --- sculpt / profile ---
# --- boundary conditions ---
[docs]
SELECT_BC = 'select bc'
# --- misc geometry ---
[docs]
DISTANCE_ALONG_VECTOR = 'distance along vector'
[docs]
BRIDGE_GLTF = 'bridge gltf'
# --- LiDAXe ---
[docs]
PICK_CATCHMENT_LIDAXE = 'pick catchment from lidaxe'
[docs]
PICK_PATH_LIDAXE = 'pick path from lidaxe'
# --- Alaro ---
[docs]
PLOT_ALARO_XY = 'plot alaro xy'
# --- point picks ---
[docs]
PICK_BRIDGE = 'pick bridge'
[docs]
PICK_WEIR = 'pick weir'
[docs]
PICK_MUNICIPALITY = 'pick municipality'
[docs]
PICK_A_PICTURE = 'pick a picture'
[docs]
PLOT_CROSS_SECTION = 'plot cross section'
[docs]
PICK_LANDMAP_FULL = 'pick landmap full'
[docs]
PICK_LANDMAP_LOW = 'pick landmap low'
# --- cross-section / 1D ---
[docs]
SELECT_NEAREST_PROFILE = 'select nearest profile'
[docs]
SET_1D_PROFILE = 'set 1d profile'
# --- hydrology ---
[docs]
PICK_OUTLET = 'pick outlet'
[docs]
PICK_INTERIOR_POINT = 'pick interior point'
[docs]
PICK_FORCED_EXCHANGES = 'pick forced exchanges'
[docs]
REMOVE_FORCED_EXCHANGES = 'remove forced exchanges'
[docs]
FIND_UPSTREAM_WATERSHED = 'find upstream watershed'
[docs]
FIND_UPSTREAM_WATERSHED_LIMIT = 'find upstream watershed - limit to sub'
[docs]
FIND_PATH_TO_OUTLET = 'find path to outlet'
[docs]
SELECT_UPSTREAM_WATERSHED = 'select upstream watershed'
[docs]
SELECT_UPSTREAM_WATERSHED_LIMIT = 'select upstream watershed - limit to sub'
[docs]
SELECT_UPSTREAM_RIVERS = 'select upstream rivers'
[docs]
SELECT_UPSTREAM_RIVERS_LIMIT= 'select upstream rivers - limit to sub'
[docs]
SELECT_DOWNSTREAM_RIVERS = 'select downstream rivers'
# ---------------------------------------------------------------------------
# Action groups — frozensets for membership tests replacing substring hacks.
# Usage: ``if self.action in SELECT_BY_VECTOR_ACTIONS: ...``
# ---------------------------------------------------------------------------
#: All "select by (tmp) vector" actions (right-click adds polygon vertex).
[docs]
SELECT_BY_VECTOR_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.SELECT_BY_VECTOR_INSIDE,
ActionKind.SELECT_BY_VECTOR_OUTSIDE,
ActionKind.SELECT_BY_VECTOR_ALONG,
ActionKind.SELECT_BY_TMP_VECTOR_INSIDE,
ActionKind.SELECT_BY_TMP_VECTOR_ALONG,
})
#: Actions that select vectors by clicking in the viewer.
[docs]
SELECT_ACTIVE_VECTOR_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.SELECT_ACTIVE_VECTOR_INSIDE,
ActionKind.SELECT_ACTIVE_VECTOR_ALL,
ActionKind.SELECT_ACTIVE_VECTOR2_INSIDE,
ActionKind.SELECT_ACTIVE_VECTOR2_ALL,
})
#: Both node-by-node selection modes.
[docs]
SELECT_NODE_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.SELECT_NODE_BY_NODE,
ActionKind.SELECT_NODE_BY_NODE_RESULTS,
})
#: Both landmap pick modes.
[docs]
PICK_LANDMAP_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.PICK_LANDMAP_FULL,
ActionKind.PICK_LANDMAP_LOW,
})
#: Actions that track polygon vertices during mouse motion.
[docs]
POLYGON_VERTEX_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.SELECT_BY_VECTOR_INSIDE,
ActionKind.SELECT_BY_VECTOR_OUTSIDE,
ActionKind.SELECT_BY_VECTOR_ALONG,
ActionKind.SELECT_BY_TMP_VECTOR_INSIDE,
ActionKind.SELECT_BY_TMP_VECTOR_ALONG,
ActionKind.CAPTURE_VERTICES,
ActionKind.DYNAMIC_PARALLEL,
ActionKind.LAZ_TMP_VECTOR,
ActionKind.CREATE_POLYGON_TILES,
})
#: Both "find upstream watershed" actions (with and without sub-basin limit).
[docs]
FIND_UPSTREAM_WATERSHED_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.FIND_UPSTREAM_WATERSHED,
ActionKind.FIND_UPSTREAM_WATERSHED_LIMIT,
})
#: Both "select upstream watershed" actions.
[docs]
SELECT_UPSTREAM_WATERSHED_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.SELECT_UPSTREAM_WATERSHED,
ActionKind.SELECT_UPSTREAM_WATERSHED_LIMIT,
})
#: Both "select upstream rivers" actions.
[docs]
SELECT_UPSTREAM_RIVERS_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.SELECT_UPSTREAM_RIVERS,
ActionKind.SELECT_UPSTREAM_RIVERS_LIMIT,
})
#: Actions that stress OpenGL drawing (suppress tooltip refresh, etc.).
[docs]
HEAVY_GL_ACTIONS: frozenset[ActionKind] = frozenset({
ActionKind.ADD_POINTS_TO_CLOUD,
ActionKind.MOVE_POINT_IN_CLOUD,
ActionKind.TRANSFORM_ASSET_BOUNDS,
ActionKind.MOVE_VECTOR,
ActionKind.MOVE_TRIANGLES,
ActionKind.ROTATE_VECTOR,
ActionKind.ROTATE_TRIANGLES,
ActionKind.MOVE_ZONE,
ActionKind.ROTATE_ZONE,
ActionKind.MODIFY_VERTICES,
ActionKind.INSERT_VERTICES,
ActionKind.CAPTURE_VERTICES,
ActionKind.LAZ_TMP_VECTOR,
ActionKind.CREATE_POLYGON_TILES,
ActionKind.DISTANCE_ALONG_VECTOR,
})