Skip to content

volume_grid core: point classes edited on a volume's planes, the gestures, sessions (P8 part 1) - #1400

Merged
transfix merged 1 commit into
masterfrom
p8/volume-grid-core
Nov 20, 2026
Merged

transfix merged 1 commit into
masterfrom
p8/volume-grid-core

Conversation

@transfix

Copy link
Copy Markdown
Owner

Part 1 of P8 in VOLROVER-LIBRARY-PORTS-ROADMAP.md, volume_grid v1. It is the data side of VolumeGridRover, with no GL in it, so every edit is testable here and runs the same natively, in wasm and from pycvc. Part 2 is the volume_grid node and its component; it is stacked on this one.

New header: inc/cvc/volume/volume_grid.h.

Parameter tables (§1.5)

Three tables, for the keys under <node>.grid:

  • volume_grid_params:
    • view: xy, xz or zy, VolumeGridRover's switch;
    • tool: navigate, points or probe;
    • slice.x, slice.y, slice.z.
  • volume_grid_display_params: point_scale, show_points, crosshairs, grey.
  • volume_grid_source_params: file, var, time.

cvc::point_class_editor

Point classes on the planes of a volume:

  • Marking: add, remove, and VolumeGridRover's toggle. A toggle removes the class's point within its radius on this plane, or else adds one.
  • Selection: by point, by rubber band (replace, add or remove), all, none.
  • Move: moves the selection, cut short at the volume's edge. A point that lands on another point of its class merges with it.
  • Delete and undo (64 steps).
  • Only the shown variable and timestep's classes are drawn, picked or selected.

cvc::point_class_gestures

Turns the picks a slice view writes (down, drag, up, with modifiers) into those edits, the way VolumeGridRover's slice canvases handled the mouse:

  • with the points tool:
    • a click marks or unmarks a point;
    • a drag selects with a rubber band; Shift adds to the selection, Ctrl or Alt takes away;
    • a Shift or Ctrl/Alt click selects or deselects one point;
    • Shift+Ctrl drag moves the selection, as one undo step;
  • navigate moves the other two planes to the voxel.

Class rows

These are the rows a list: widget binds (classes.<i>.{name,color,radius,variable,timestep,points}).

  • reconcile_point_class_rows turns edited, added and removed rows back into classes. Each row keeps its points across a rename, and across another row's add or remove.

Sessions

A node's keys, its transfer function and its classes, in one JSON file.

  • Only the parameter tables' keys and grid.classes.current go in.
  • Truncated, garbage or wrong files raise an error naming the file.

Tests

volume_grid_test (new, in the ports lane, and added to the sanitizer lanes' SAN_CXX_TESTS):

  • T8: the tables and the rows on the tree;
  • the editor and the gestures;
  • T9 and T5: sessions, including bad and truncated files;
  • T6: two editors share nothing; two threads give the results each gives alone; two apps keep their own rows.

test_pycvc_volume_grid.py (new): the bindings (pycvc_volume_grid.i):

  • the editor, the gestures, the three tables with keywords, rows on an app's tree, sessions;
  • the error types: IndexError, ValueError, TypeError, OverflowError and RuntimeError.

Local results (Windows, MSVC Release)

  • volume_grid_test: 21/21 natively, and 21/21 as wasm-mt under node 22.
  • pycvc: pycvc_volume_grid, pycvc_volume_slice and pycvc_point_classes pass, as do 10 neighbouring pycvc tests.
  • Formatting: git-clang-format 18 leaves the changed lines unchanged.
  • Line endings: ci.yml is still CRLF; its only change is the one SAN_CXX_TESTS line.
  • Not run here: Linux, macOS and the sanitizer lanes. CI is the check for those.

…ures, sessions (P8 part 1)

The data side of VolumeGridRover (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md
section 4, P8), with no GL in it, in inc/cvc/volume/volume_grid.h:

- the node's parameter tables: volume_grid_params (view, tool, slice.x/y/z),
  volume_grid_display_params, volume_grid_source_params;
- cvc::point_class_editor: mark, toggle (VolumeGridRover's double-click),
  select by point and rubber band, move the selection (cut short at the edge,
  merging), delete, undo, one plane at a time and only the shown variable and
  timestep's classes;
- cvc::point_class_gestures: a slice view's picks (down, drag, up, Shift /
  Ctrl / Alt) turned into those edits as the legacy slice canvases turned
  mouse events: click marks, drag selects, Shift+Ctrl drag moves, navigate
  moves the other planes;
- the class rows a list: binds, reconciled with the classes as rows are
  edited, added and removed;
- sessions: the keys, the transfer function and the classes in one JSON file.

volume_grid_test (ports lane, native and wasm-mt; and SAN_CXX_TESTS) covers
the tables and rows on the tree (T8), the editor and gestures, sessions with
bad and truncated files (T9, T5), and two editors, threads and apps sharing
nothing (T6). pycvc binds all of it (pycvc_volume_grid.i,
test_pycvc_volume_grid.py).
@transfix
transfix merged commit 8f6218c into master Nov 20, 2026
29 checks passed
@transfix
transfix deleted the p8/volume-grid-core branch November 20, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant