Skip to main content

Module hit

Module hit 

Source
Expand description

Hit tests: which Visual a Pointer is over, shared by every operation so a click means the same thing whatever is being edited.

What counts as over something is measured in the pointer’s reach (see super::Reach), so “near” means near on screen however far away or zoomed in the view is. The geometry itself — how near a ray passes to a point, a segment, a triangle — is geop_core_math::primitives::Ray’s.

Structs§

Cycle
Which of the candidates under the pointer is lit: the at-th of of, front to back, counted from 0 — what a front end says while its user steps through them (see Pointer::cycle).
ElementHit
An element of the part a pointer is over, as drawn: where, and how far along its ray (see Scene::pick).
VisualHit
A visual the pointer is over.
Window
The window a drag from one pointer to another sweeps over the view: the rectangle between the two on the plane facing the eye, for selecting everything within it. Its sides run along the world’s axes as the view shows them — the two least along the line of sight — which are the screen’s own in a view along an axis. Seen in perspective it is the frustum through that rectangle.

Constants§

HANDLE
A handle’s radius, in reaches; its arrows reach three times as far along its direction.
LABEL
How near a label’s center a click has to land, in reaches.

Traits§

Scene
The part as an editor draws it, which picks are made in: what an editor needs to know of it beyond a step’s own visuals, and what an operation is given to find what the pointer is over (see crate::editable::Context::scene).

Functions§

cycled
The one of candidates a pointer’s Pointer::cycle cycle names: counted from the first, wrapping round. None of none.
hit_visuals
The visual among those accept takes that the pointer is over: of those visuals_under it, the one its Pointer::cycle names.
nearer
Orders two distances for picking the nearest. Which of two overlapping enclosures is “nearer” is no geometric claim, only which of two things under the pointer to prefer, so their midpoints decide.
no_instances
For hit_visuals where no placed part is drawn: none is hit.
visuals_under
The visuals among those accept takes that the pointer is over: first the one a click takes — handles and labels first, then points, curves and areas; within each, the one nearest the pointer on screen, and of those as near, the one nearest the eye: of two areas the pointer is over, the one in front — then the rest front to back along the ray. Placed parts are hit where instance says (see no_instances).