1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! The visual before/after comparison: a separate OS window
//! (`ui/compare_window.slint`'s `CompareWindow`), or the pane embedded in the
//! Retarget dialog (`ui/components/compare_view.slint`'s `CompareView`, backed by the
//! main window's own `CompareModel` instance), showing the design before and after
//! a Retarget proposal, an Optimize result, or against the held design snapshot --
//! side by side, under a draggable split divider (window only), or as a difference
//! overlay on the "after" side (removed material red, added green, outlines). Both
//! sides are turned by ONE shared orbit camera, in the flat solid view (instant) or
//! the CPU path tracer (a modest fixed quality, started only after the pose has
//! settled and the mouse button is released). Only one session is live at a time,
//! on one of those two surfaces.
//!
//! # Keep/Discard never reimplement Apply
//!
//! "Keep after" invokes the originating feature's own Apply handler
//! (`RetargetModel.apply()` -> `callbacks::retarget_actions::apply::
//! setup_retarget_apply_callback`, `EditorModel.optimize_apply()` ->
//! `callbacks::solve_actions::optimize_outcome::setup_optimize_apply_callback`), after
//! [`origins::guard_still_matches`] confirms that handler would commit exactly what
//! was compared -- so undo, dirty and generation bookkeeping are the Apply button's
//! own. "Discard" closes the window and switches that feature's viewport ghost
//! preview off; "Close" just closes. A snapshot comparison offers only Close.
//!
//! # Module layout
//!
//! [`session`] (Slint-free: the two solved sides, the shared pose and its
//! arithmetic, the status line, the stale-frame book), [`render`] (the solid and
//! traced workers and their pure render functions), [`origins`] (gathering each
//! origin's sides and the Keep guard), [`host`] (the two surfaces, the live session
//! and frame delivery), and [`wiring`] (which surface a request opens on, and every
//! Slint callback). `tests` covers the first two without Slint.
use ;
use crate::;
use ComponentHandle;
use ;
pub use close_compare_window;
/// Wires the compare window's three entry points (`MainWindow`'s own
/// `CompareModel.open_retarget`/`open_optimize`/`open_snapshot`) and the Retarget
/// dialog's embedded pane (`open_retarget_embedded`/`close_embedded`). The window
/// itself is created lazily on the first open.
pub