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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! The small, shared value types the frame pipeline is built from: the orbit
//! camera pose, the facet-overlay update payload, and the per-frame pick buffer.
//!
//! Moved verbatim from the desktop's `gui::solid_preview::preview_state::types`,
//! which re-exports them.
use Vec3;
use Arc;
/// The shared `yaw`/`pitch`/`distance` orbit camera.
///
/// See [`crate::raster`]'s module doc comment for why the solid view must use exactly
/// `indicatrix::optics::raytracer::Camera::new(yaw, pitch, distance, 42.0)`, the
/// same call the path tracer uses.
/// A facet-id-keyed highlight update.
///
/// Identifies one facet under the cursor, one facet a click resolved within
/// its tier, or lists every facet belonging to a multi-selected set of tiers.
///
/// Every field names facet ids directly rather than tier indices, so applying an
/// update never needs a `Design`/[`crate::facet_map::FacetMap`] -- the caller
/// already resolved the id(s) it wants highlighted (from a pick buffer, or from
/// `FacetMap::facets_of_tier` for each multi-selected tier). `Default` (every
/// field empty/`None`) clears every highlight.
/// The geometry of the mesh one frame was drawn from, in the frame's own pick
/// coordinates -- what the direct-manipulation handles are placed and projected with.
///
/// `corner_points` and `facet_centroids` are built once per mesh
/// ([`crate::mesh_cache::CachedMesh`]) and shared by `Arc`, never rebuilt per frame;
/// `camera` and `size` are exactly the pose and pixel size the raster used, so a
/// point projected with `Camera::new(yaw, pitch, distance, 42.0)` at `size` lands on
/// the same pixel the pick buffer holds.
/// A finished frame's per-pixel facet-picking buffer, alongside the size needed to
/// index it (`pick[y * width + x]`, mirroring
/// [`crate::raster::SolidRasterizer::pick_at`]).
///
/// Kept by a caller so hover/click can be resolved against the LAST rendered
/// frame without holding the rasterizer itself.