三维未激活采样显示灰点,二维增加深度叠箭头。

分析对话框默认使用传感器对话框保存的标定,关闭按钮改为保存。框选曲线时数值卡片仍显示光标读数。相关单测通过。
This commit is contained in:
ykcheungab
2026-10-08 17:04:30 +08:00
parent 3d2fb0c4eb
commit 091d0fda35
18 changed files with 507 additions and 202 deletions
+15 -2
View File
@@ -36,12 +36,22 @@ def test_a_live_frame_offers_the_derived_modes_and_needs_no_note():
plan = backend.plan_image(
backend.ImageFrame(_image(), flow=_flow(), depth=np.ones((12, 16)))
)
assert plan.available_modes == ("arrows_pure", "arrows_stitched", "depth")
assert plan.available_modes == ("arrows_pure", "arrows_stitched", "depth", "depth_arrows")
assert plan.default_mode == "arrows_pure"
assert plan.missing == ()
assert plan.note_key == ""
def test_depth_arrows_draws_the_flow_on_the_depth_picture():
depth = np.linspace(0.0, 1.0, 12 * 16, dtype=np.float32).reshape(12, 16)
frame = backend.ImageFrame(_image(), flow=_flow(), depth=depth)
plain = backend.render_image(frame, mode="depth", draw_style="finger")
over = backend.render_image(frame, mode="depth_arrows", draw_style="finger")
assert plain is not None and over is not None
assert over.shape == plain.shape
assert not np.array_equal(over, plain)
def test_a_recorded_frame_is_raw_and_says_so():
"""No flow and no depth: the frame *is* the picture, and the note explains it."""
plan = backend.plan_image(backend.ImageFrame(_image(), source=backend.SOURCE_REPLAY))
@@ -723,9 +733,12 @@ def test_hiding_the_idle_dots_leaves_the_3d_figure_where_it_was():
f"{int(active.sum())} active of {samples.rows.size} candidates"
)
assert overlay_on is not None and overlay_off is not None
assert overlay_on.origins.shape[0] == int(active.sum()), (
assert int(np.count_nonzero(overlay_on.lengths > 0.0)) == int(active.sum()), (
"the 3D overlay is not drawing the active samples the 2D canvas draws"
)
assert int(np.count_nonzero(overlay_on.lengths < 0.0)) > 0, (
"inactive samples are not drawn as grey points"
)
assert np.array_equal(overlay_on.origins, overlay_off.origins)
assert np.array_equal(overlay_on.directions, overlay_off.directions)
assert not np.array_equal(dots_on, dots_off), "the switch changed nothing to hide"