wolfhece.opengl.toolbar_icons ============================= .. py:module:: wolfhece.opengl.toolbar_icons .. autoapi-nested-parse:: Procedural icon texture atlas for the on-canvas ToolbarOverlay. Each icon is rasterised with Pillow *ImageDraw* into a 64 × 64 RGBA cell. All cells are packed into a single OpenGL texture uploaded once on first use. Icons are drawn as textured quads tinted by ``glColor4f``. Module Contents --------------- .. py:data:: _CELL :value: 64 .. py:data:: _PAD :value: 12 .. py:data:: _LW :value: 3 .. py:data:: _W :value: (235, 235, 240, 255) .. py:data:: _G :value: (160, 160, 170, 180) .. py:function:: _plus(d: PIL.ImageDraw.ImageDraw, cx, cy, r=8, w=_LW, fill=_W) .. py:function:: _cross(d: PIL.ImageDraw.ImageDraw, cx, cy, r=8, w=_LW, fill=_W) .. py:function:: _dot(d: PIL.ImageDraw.ImageDraw, x, y, r=3, fill=_W) .. py:function:: _arrowhead(d: PIL.ImageDraw.ImageDraw, x1, y1, x2, y2, size=7, fill=_W) Arrowhead at (*x2*, *y2*) coming from (*x1*, *y1*). .. py:function:: _arrow(d: PIL.ImageDraw.ImageDraw, x1, y1, x2, y2, head=7, w=_LW, fill=_W) Line with arrowhead. .. py:function:: _icon_add_zone(d, s, p) Rectangle with centred + sign. .. py:function:: _icon_add_vec(d, s, p) Polyline with vertex dots and + badge. .. py:function:: _icon_capture(d, s, p) Pen / pencil diagonal. .. py:function:: _icon_modify(d, s, p) Vertex dot with 4-way move arrows. .. py:function:: _icon_insert(d, s, p) Line with new vertex inserted in the middle. .. py:function:: _icon_move_vec(d, s, p) Four-way arrow cross (standard move icon). .. py:function:: _icon_rotate(d, s, p) Circular arrow (arc + arrowhead). .. py:function:: _icon_parallel(d, s, p) Two parallel horizontal lines. .. py:function:: _icon_sel_poly(d, s, p) Selection polygon (pentagon outline). .. py:function:: _icon_sel_line(d, s, p) Zigzag polyline (select along path). .. py:function:: _icon_sel_all(d, s, p) Filled square = select all. .. py:function:: _icon_reset_sel(d, s, p) Bold X cross = reset / clear. .. py:function:: _icon_dilate(d, s, p) Small square with outward arrows at corners. .. py:function:: _icon_erode(d, s, p) Inward arrows converging to small square. .. py:function:: _icon_mask_in(d, s, p) Filled triangle = mask inside. .. py:function:: _icon_mask_out(d, s, p) Rectangle with triangular hole = mask outside. .. py:function:: _icon_add_pts(d, s, p) Scattered dots with + badge. .. py:function:: _icon_move_pt(d, s, p) Single dot with arrow showing movement. .. py:function:: _icon_profile(d, s, p) Crosshair / target (select profile). .. py:function:: _icon_plot_cs(d, s, p) Mini axes with curve (plot cross section). .. py:function:: _icon_pick_tile(d, s, p) 2×2 grid (pick tile). .. py:function:: _icon_sculpt(d, s, p) Brush circle with terrain hill inside (open sculpt panel). .. py:function:: _icon_sculpt_smooth(d, s, p) Jagged line (gray) → smooth curve (white): smooth mode. .. py:function:: _icon_sculpt_raise(d, s, p) Baseline + bump with upward arrow: raise mode. .. py:function:: _icon_sculpt_lower(d, s, p) Baseline + hollow with downward arrow: lower/dig mode. .. py:function:: _icon_sculpt_flatten(d, s, p) Irregular terrain + horizontal target line: flatten mode. .. py:function:: _icon_sculpt_noise(d, s, p) Jagged random terrain + sparkle: noise mode. .. py:function:: _icon_profile_brush(d, s, p) Profile brush: plan-view corridor+arrow (left) | cross-section slope (right). .. py:data:: _DRAW_FNS :type: dict[str, object] .. py:data:: ALL_ICONS :type: list[str] :value: ['add_zone', 'add_vec', 'capture', 'modify', 'insert', 'move_vec', 'rotate', 'parallel',... .. py:class:: IconAtlas Singleton that builds and manages a GL texture atlas of toolbar icons. .. py:attribute:: _instance :type: IconAtlas | None :value: None .. py:attribute:: _tex_id :type: int :value: 0 .. py:attribute:: _uvs :type: dict[str, tuple[float, float, float, float]] .. py:attribute:: _ready :type: bool :value: False .. py:method:: get_instance() -> IconAtlas :classmethod: .. py:method:: ensure_ready() .. py:method:: _build() .. py:method:: draw_icon(name: str, x0: float, y0: float, x1: float, y1: float, color: tuple = (1.0, 1.0, 1.0, 1.0)) Render *name* as a textured quad at GL pixel coords.