Skip to content

volume_grid: VolumeGridRover as an Ariadne node and component (P8 part 2) - #1401

Merged
transfix merged 7 commits into
masterfrom
p8/volume-grid-node
Nov 21, 2026
Merged

transfix merged 7 commits into
masterfrom
p8/volume-grid-node

Conversation

@transfix

@transfix transfix commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Part 2 of P8 in VOLROVER-LIBRARY-PORTS-ROADMAP.md: VolumeGridRover rebuilt as an Ariadne component, over a new volume_grid scene node. It is stacked on part 1 (#1400), which has the editing core. It targets master so CI runs; once part 1 lands I merge master in.

The node: type: volume_grid

cvc::gl::VolumeGridNode and volume_grid_nodes.h. Keys are under <node>.grid.*; the full table is in docs/ARIADNE.md §5.4.

  • Children:
    • Three volume_slice planes of one volume, realized as <id>_slice_xy, _xz and _zy. Each is tagged with the grid's id and its own name, so a view with show: [<id>] shows that grid alone.
    • Each plane draws overlays: point disks sized by their radius in voxels, rings round the selection, crosshairs in the colour of the axis they run along, and a rubber band while one is dragged.
    • An empty <id>_surfaces group, where P9 and P10 will draw surfaces.
  • Picks and the pointer: picks written to grid.pick.* run part 1's gestures under grid.tool. grid.pointer.* fills the probe (grid.cursor.*).
  • Class rows: grid.classes.* are the rows a list: binds. Editing, adding or removing a row edits the classes.
  • Data channel: grid.points, grid.selection and grid.volume. A point_classes written to grid.points from outside replaces the classes.
  • Requests: load, save_classes, load_classes, load_points, delete_selected, select_all, select_none, undo, step <n>, save_session and load_session.
  • Transfer function: <node>.transfer_function colours all three planes and follows a load. display.grey switches to grey.
  • Job keys: busy, progress and the rest are published for P9's segmentation job.

Pieces the views needed

  • Viewport pointer: <key>: the view writes a pick's fields, with phase hover, as the pointer moves over it with no button down. I couldn't use hover:, because the loader already consumes that key for a group's highlight.
  • axis on a pick: the axis of the slice it landed on.
  • range: key on slider_int and slider_float: the slider takes its range from the bound key's min and max properties, read each frame. The node keeps each slice key's range at the volume's planes.
  • transfer_function_prop: volume_slice_nodes.h now exposes it, so volume_grid parses transfer_function: the way volume_slice does.

The component: volume_grid.ari

  • Units:
    • volume_grid: one window;
    • volume_grid_views and volume_grid_tools: groups for a document that lays out its own windows.
  • Layouts:
    • switch, the default (roadmap §9, 2026-11-08): one slice view under the XY / XZ / ZY switch bound to grid.view, beside a 3D view;
    • quad: the three slice views and the 3D view in a 2×2 grid.
  • Panel:
    • the tool: navigate, points or probe;
    • three tabs: Probe (with the planes, sessions and source), Point classes (list, colour, radius, selection buttons, files) and Transfer function;
    • slot: tabs at the end of the tab container. P9's Segmentation tab and P10's Contours tab go into it, and a document can add its own there.

Demo, goldens, gallery, web

  • Demo: examples/ariadne/documents/volume_grid.ari, with the bunny's SDF, two classes, and PageUp / PageDown / Delete bound to requests. It also has a gallery entry, volume_grid_ari.
  • Goldens: src/cvcGL/test/golden/volume_grid.ari (switch, Point classes tab) and volume_grid_quad.ari, plus volume_grid.vgr. Their PNGs come from CI's llvmpipe render, as orthoslicer demo: three volume_slice planes beside a volren, a slice view down any axis (P7) #1257's did:
    • volume_grid.png is the first run's Windows render; Linux's matches it to within 1 per channel.
    • That first run showed the quad layout's panel pushed past the window's right edge: its 2 x 2 grid was a table, and a table spans the window's width. 7efe873 makes it two horizontal rows, so the panel sits beside the views. volume_grid_quad.png follows from the next run's render.
  • Golden harness: it now adds the source tree's component path, so a golden of a shipped component draws this tree's copy.
  • arigl-web smoke case: the docset's app/volume_grid.ari clicks once through state writes and waits for the node's "added (10, 15, 12) to seeds".

Tests

  • cvcgl_volume_grid (new, headless plus an offscreen part):
    • realize, tags and keys;
    • scripted picks: mark, unmark, band, Shift+Ctrl drag, navigate;
    • every request, rows, the data channel and sessions;
    • two grids in one document (T6);
    • rendered: the plane, the crosshairs and a point's disk.
  • cvcgl_ariadne_volume_grid (new) loads the component over two grids, one per layout, and drives them with real ImGui mouse events:
    • the pointer fills the probe;
    • a click marks and a second click unmarks;
    • a drag selects;
    • the switch follows grid.view;
    • a click in the other grid's XZ view marks that grid only.
  • ariadne_loader_test: VolumeGridDrivesItsNodesKeys, VolumeGridDemoLoadsClean and SliderRangeFromKey. ShippedComponentsLoadClean covers the new component.
  • ariadne_runtime_test: SliderRangeFromTheKeysProperties.

Local results (Windows, MSVC Release, Intel GPU, CVC_REQUIRE_RENDER=1)

Before the rebase onto master 75aff9c:

  • New tests:
    • cvcgl_volume_grid: 64/64 checks, the rendered overlay part included.
    • cvcgl_ariadne_volume_grid: 16/16.
  • Gtest suites, all passing:
    • ariadne_loader_test (245) and ariadne_runtime_test (342);
    • volume_grid_test (21), volume_slice_test (9), point_classes_test (16);
    • tabs_list_test (6) and param_table_test (20).
  • ctest: cvcgl_volume_slice, cvcgl_ariadne_slice_view, cvcgl_ariadne_pick, cvcgl_ariadne_views, cvcgl_ariadne_realize, cvcgl_ariadne_scenes, cvcgl_imgui_tabs_list, cvcgl_tf_binding and cvcgl_camera_slice all pass.
  • cvcgl_ari_golden: both new documents load without warnings and settle. They failed only on the missing PNGs, as expected. In the local renders the points, crosshairs, rows and 3D views all draw; I missed the quad panel's overflow there, which CI's render caught (fixed in 7efe873; cvcgl_ariadne_volume_grid and ariadne_loader_test pass again after it).
  • arigl-web document, run natively: arigl snapshot on the docset's volume_grid.ari prints volume_grid: 32 32 32, slice view down y, added (10, 15, 12) to seeds. The browser itself is CI's arigl-web lane.
  • Formatting: git-clang-format 18 leaves the changed lines unchanged.
  • Found on the way:
    • GeometryNode::setGeometry re-picks the render mode from the geometry, so a lines-only geometry falls back to a surface and draws nothing. The lines overlay therefore sets LINES after each setGeometry.
    • The 64³ bunny SDF has an inside-signed sliver at z = 31 near the grid's edge, which shows in the orthoslicer's data too. The demo opens at z = 24.

Not run here: Linux, macOS, the arigl-web lane, and the goldens against llvmpipe.

…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).
…t 2)

docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md section 4, P8, on part 1's core:

- type: volume_grid (cvc::gl::VolumeGridNode, volume_grid_nodes.h): three
  volume_slice planes of one volume, realized as <id>_slice_xy/_xz/_zy and
  tagged with the grid's id and their names, each drawing its points as disks,
  the selection's rings, crosshairs (in the colour of the axis they run along)
  and a rubber band; an empty <id>_surfaces group for P9 and P10. Keys under
  <node>.grid: the parameter tables, the class rows a list: binds, picks run
  as gestures under the tool, the pointer filling the probe, requests (load,
  save / load classes and points, delete_selected, select_all / none, undo,
  step, save / load session), the job keys; grid.points, grid.selection and
  grid.volume on the data channel; <node>.transfer_function colours all three
  planes and follows a load, display.grey draws them grey.
- The viewport writes a pick's keys as the pointer moves (pointer: <key>,
  phase hover; hover: is the loader's), and a pick names its slice's axis.
- slider_int / slider_float range: key: the range is the bound key's min and
  max properties, read each frame.
- volume_slice_nodes.h exposes transfer_function_prop for both node types.
- volume_grid.ari: the volume_grid window, volume_grid_views and
  volume_grid_tools; the legacy XY / XZ / ZY switch layout (the default) and
  quad; the tool and the Probe, Point classes and Transfer function tabs, the
  tab container ending in slot: tabs (P9's Segmentation tab, P10's Contours).
- The demo examples/ariadne/documents/volume_grid.ari and its gallery entry;
  goldens volume_grid.ari and volume_grid_quad.ari (the golden harness reads
  the source tree's components); an arigl-web case that clicks once through
  state writes and waits for the mark.

Tests: cvcgl_volume_grid (headless picks through state writes, requests, rows,
data channel, sessions, two grids in one document; the overlays rendered),
cvcgl_ariadne_volume_grid (the component over two grids, one per layout, with
real mouse events), ariadne_loader_test's VolumeGrid* and SliderRangeFromKey,
ariadne_runtime_test's SliderRangeFromTheKeysProperties.
… golden

The quad layout's 2 x 2 grid was a table with fixed 200 px columns. A table
with no outer size still spans the rest of the window, so in the window's
horizontal flow it pushed the tools panel past the right edge, behind a
scrollbar (CI's llvmpipe render of volume_grid_quad.ari showed it, and so
did the local one). The quad is now two horizontal rows, XY | XZ over
ZY | 3D, each flowing side by side as the switch layout does, so the panel
sits beside the views.

volume_grid.png is CI's llvmpipe render of volume_grid.ari (Windows,
package-windows / libcvc-release); Linux's (libcvc-release-grpc) matches it
to within 1 per channel. volume_grid_quad.png follows from the next run.
volume_grid_quad.png is CI's llvmpipe render of volume_grid_quad.ari at
7efe873 (package-linux / libcvc-release, LLVM 20): the four views in two
rows with the tools panel beside them. volume_grid.png, taken from the
Windows lane, matched this run's Linux render to within 1 per channel.
Conflicts were both sides adding a neighbour: the demo list and entries,
the extensions header comment, the web smoke cases, the cvcGL test
targets and the node-type registrations. Both kept.
…id-node

demos.json lists volume_grid_ari and skeleton_lab_ari, each with its entry; arigl_web_smoke.mjs runs both cases.
transfix added a commit that referenced this pull request Nov 21, 2026
…id-data

demos.json lists volume_grid_ari and skeleton_lab_ari and arigl_web_smoke.mjs runs both cases, as on #1401. scene_views.cpp: shown_bounds keeps master's subtree entries and counts a hidden node it lets in, with no bounds, so a view waits while a volume_grid's planes wait for their volume.
@transfix
transfix merged commit 596ac55 into master Nov 21, 2026
29 checks passed
@transfix
transfix deleted the p8/volume-grid-node branch November 21, 2026 20:06
transfix added a commit that referenced this pull request Nov 21, 2026
#1401 landed as a squash; this branch already holds its commits (all but
its own merge of master's P2, which 37a7356 repeated here). The tree is
this branch merged with master's fcee28e, the commit before the squash
(clean, docs/ARIADNE.md the only file both touched), so every conflict
with the squash takes this branch's side. Against master the diff is
exactly #1423's own: the same 31 files and lines as against #1401's head.
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