Skip to content

viewport mode: slice: a parallel view down one axis, picks that name the voxel (P7) - #1251

Merged
transfix merged 19 commits into
masterfrom
p7/slice-camera
Nov 17, 2026
Merged

transfix merged 19 commits into
masterfrom
p7/slice-camera

Conversation

@transfix

Copy link
Copy Markdown
Owner

The second piece of P7 (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §6 items 2 and 3). Stacked on #1249: it carries #1249's two commits until that merges, then gets rebased onto master. Only the last commit (9f32d8e) is this PR's own.

What lands

  • CameraController::Mode::Slice: a parallel view straight down x, y or z (setSliceAxis), no rotation.
    • The screen axes are VolumeGridRover's: down z, x right and y up (XY); down y, x right and z up (XZ); down x, z right and y up (ZY).
    • frameSlice fits a box's face and refits on resize until the user zooms.
    • A drag pans; the movement keys slide and zoom; Tab cannot leave the mode.
    • The pose is its own: state slice.axis, slice.center.*, slice.scale.
    • mouseWheelAt zooms about the pointer, through the zoom's glide too. The attached interactor passes the event's position.
  • The viewport widget:
    • mode: slice with axis: given as a name (x | y | z, or xy / xz / zy) or as { bind: <key> }, read every frame. So one viewport can follow VolumeGridRover's view switch.
    • A slice view frames on the volume_slice nodes on its axis and leaves out the other axes' (seen edge-on, each would draw a line).
  • Picks:
    • A slice view meets the plane of its slice exactly. There is no cell-picker tolerance, and overlays drawn on top don't get in the way.
    • It writes i, j, k and value beside x, y, z.
    • Past the volume's edge it still writes the plane's point, with hit 0, so a drag keeps reporting.
    • An orbit view's pick on a volume_slice node also names its voxel.
  • Docs: ARIADNE.md §5.18, the roadmap's §6 items 2 and 3, scene_views.h, CameraController.h.

Tests (Windows Release, CVC_REQUIRE_RENDER=1)

  • New cvcgl_camera_slice (headless), 37 checks:
    • each axis's view and the state keys;
    • pan and keys;
    • the wheel at the pointer, immediate and through the glide;
    • the refit on resize;
    • mode switches and resetView.
  • New cvcgl_ariadne_slice_view (offscreen), 17 checks:
    • the bound axis switching xy to xz;
    • the edge-on red slice drawing no pixel;
    • picks through SceneViews::pick and the left button (i, j, k, value);
    • the point past the edge;
    • the wheel keeping the point under the pointer;
    • an orbit view's voxel.
  • test_pycvc_gl_camera.py gains a Slice section.
  • All pass. Still passing: cvcgl_camera_map, cvcgl_camera, cvcgl_ariadne_pick, cvcgl_ariadne_views, cvcgl_volume_slice.

No new or renamed CI jobs. clang-format is clean on the changed lines.

The first P7 piece of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §6 (items 1 and 4).

- Core: cvc::slice_source, extract_slice and color_slice (inc/cvc/volume/volume_slice.h): a
  plane of a volume in memory, or of a file read one plane at a time (region reads, the last
  few planes cached), coloured through a cvc::tf::model. The plane's axes are VolumeGridRover's
  XY / XZ / ZY views. volume_slice_params has a param_table.
- cvcGL: VolumeSliceNode, a textured quad coloured on the CPU through <node>.transfer_function,
  one 2D texture per change of plane (written in place when the size is the same). Keys under
  <node>.slice.*, info.* published, pickRay meets a world ray with the plane exactly and names
  the voxel and its value. Its children are overlays: the quad is pushed back by
  slice.overlay_offset so they stay on top. GeometryNode::setTextureInterpolate for nearest
  sampling.
- Ariadne: `type: volume_slice` in register_cvcgl_extensions (volume_slice_nodes.h); its
  transfer function is bound (tf_binding target volume_slice), so a tf_editor colours it.
- pycvc: extract_slice, color_slice, slice_source, the axis helpers and the parameter table.
- Tests: volume_slice_test (ports lane: native and wasm-mt under node), cvcgl_volume_slice
  (keys, region reads, pickRay, two apps; offscreen: voxel colours, nearest filter, an overlay
  on top), test_pycvc_volume_slice.py.
- Docs: ARIADNE.md §5.4, the roadmap's §6 items 1 and 4.
…the voxel (P7)

The second P7 piece of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §6 (items 2 and 3).

- CameraController::Mode::Slice: a parallel view straight down x, y or z (setSliceAxis), with
  VolumeGridRover's screen axes (down z: x right, y up; down y: x right, z up; down x: z right,
  y up), no rotation; frameSlice fits a box's face and refits on resize until the user zooms;
  a drag pans, the movement keys slide and zoom, Tab cannot leave it, and its pose is its own
  (state slice.axis, slice.center.*, slice.scale). mouseWheelAt zooms about the pointer, through
  the glide too; the attached interactor passes the event's position.
- The viewport widget: `mode: slice` with `axis:` a name (x | y | z, or xy / xz / zy) or
  `{ bind: <key> }`, read every frame, so one view follows a switch. A slice view frames on the
  volume_slice nodes on its axis and leaves out the other axes' (edge-on, each is a line).
- Picks: a slice view meets the plane of its slice exactly (no cell tolerance, overlays not in
  the way) and writes i, j, k and value beside x, y, z; past the volume's edge it still writes
  the plane's point with hit 0. An orbit view's pick on a volume_slice node names its voxel too.
- Tests: cvcgl_camera_slice (headless, 37 checks), cvcgl_ariadne_slice_view (offscreen: the bound
  axis, the edge-on slice left out, picks by SceneViews::pick and by the left button, the wheel
  about the pointer, an orbit view's voxel), pycvc_gl's camera test.
- Docs: ARIADNE.md §5.18, the roadmap's §6 items 2 and 3.
@transfix
transfix enabled auto-merge (squash) November 15, 2026 20:11
…olume-slice-node

# Conflicts:
#	bindings/pycvc/CMakeLists.txt
#	bindings/pycvc/pycvc.i
#	src/cvc/tests/port_tests.cmake
…olume-slice-node

# Conflicts:
#	docs/ARIADNE.md
#	inc/cvc/gl/ariadne/extensions.h
#	src/cvcGL/ariadne/extensions.cpp
Master now has #1249 as one squashed commit. Its tree equals #1249's last head (7c4c2bf) merged into the master before it (a5e83b1), so this merge's tree is #1251 merged with a5e83b1. The one conflict, in src/cvcGL/CMakeLists.txt, keeps both test blocks: #1251's cvcgl_ariadne_slice_view, then #1249's cvcgl_volume_slice.
@transfix
transfix merged commit ece9ddf into master Nov 17, 2026
29 checks passed
@transfix
transfix deleted the p7/slice-camera branch November 17, 2026 01:15
transfix added a commit that referenced this pull request Nov 17, 2026
One conflict, in ci.yml's SAN_CXX_TESTS: this branch added stream_test, net_ws_client_test and
ariadne_host_test to the sanitizer legs' list, and #1292 added gradient_vector_diffusion_test,
critical_points_test and seed_generators_test (reflowing the lines). Kept both.

ci.yml's line 1271 (the arigl-web path filter's files.h/files.cpp line) also goes back to master's
bytes: master stores ci.yml with CRLF but that one line LF-only, and an earlier merge here had
given it a CR, a whitespace-only change in this PR's diff.
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