wolfhece._sculpt_manager
Sculpt brush and profile brush companion object for WolfMapViewer.
All sculpt-brush and profile-brush interaction logic lives here.
WolfMapViewer holds a single instance as self._sculpt and exposes
one-line delegators for every method so that external callers remain
unaffected.
Design notes
SculptManagerowns all private transient state (cursor positions, pressure, show-overlay flags, rect-rotation helpers, brush-refresh coalescing flag). The public panel references (sculpt_panel,profile_panel) stay as regular attributes onWolfMapViewerbecausewolf_sculpt.pysets them directly (mapviewer.sculpt_panel = self).Six event-hook methods let the viewer delegate its mouse / keyboard / action events with a single call.
wx parent for dialogs is always
self._viewer.
Module Contents
- class wolfhece._sculpt_manager.SculptManager(viewer: wolfhece.PyDraw.WolfMapViewer)[source]
Companion object that owns sculpt-brush and profile-brush logic.
- on_wheel(ctx: wolfhece._viewer_plugin_handlers.MouseContext) bool[source]
Handle mouse-wheel brush controls when action == ‘sculpt’.
- Parameters:
ctx –
MouseContextbuilt from the wheel event. The relevant fields areshift,ctrl,alt,wheel_rotationandwheel_delta.return). (Returns True if the event was fully consumed (caller should)
- on_left_down(ctx: wolfhece._viewer_plugin_handlers.MouseContext) bool[source]
Handle left-button press for sculpt / profile actions.
- Parameters:
ctx –
MouseContextbuilt from the left-down event. The relevant fields arex,y,left_downandshift.return). (Returns True if the event was consumed (caller should)
- on_motion(ctx: wolfhece._viewer_plugin_handlers.MouseContext) bool[source]
Handle mouse motion for sculpt / profile actions.
- Parameters:
ctx – Pre-built
MouseContextwith world coordinates, pixel coordinates, modifier flags, button states and stylus pressure. The caller (On_Mouse_Motion) stores this object inviewer._mouse_contextbefore calling this method, so tooltip helpers can read it directly.return). (Returns True when the event is fully consumed (caller should)
pan (Returns False when sculpt middle-drag must fall through to the)
code
'profile'. (or when the action is neither 'sculpt' nor)
- on_end_action(prev_action: str) None[source]
Clean up sculpt / profile state and notify panels when action ends.
- on_key_z(ctx: wolfhece._viewer_plugin_handlers.KeyboardSnapshot) bool[source]
Handle Ctrl+Z undo for sculpt / profile.
Returns
Trueif the key was consumed (caller should skip the default zoom-on-array action).
- on_key_r(ctx: wolfhece._viewer_plugin_handlers.KeyboardSnapshot) bool[source]
Guard: suppress reset-selection when sculpt RECTANGLE rotate mode is active.
Returns
Trueif R was suppressed; the caller is responsible for callinge.Skip()so the key event continues to propagate.
- hide_size() None[source]
Callback scheduled via
viewer.schedule_onceto hide the radius-size overlay.
- hide_zone() None[source]
Callback scheduled via
viewer.schedule_onceto hide the search-zone overlay.
- get_event_pressure(e) float[source]
Return stylus pressure in [0, 1].
Reads from WinTab (Wintab32.dll) when available, which works reliably on wx.GLCanvas. Falls back to wx then to 1.0.
- profile_apply_at(x: float, y: float) None[source]
Apply the profile brush at world position (x, y).
- request_brush_refresh() None[source]
Schedule a single Refresh() for the next event-loop idle.
Multiple calls from the same burst of mouse-motion events all land here; only the first actually posts a deferred call so that one repaint serves all pending GPU patches.