Expand description
What an editor exchanges with the operations while a step is edited.
An editor never edits a step’s arguments itself. It sends what the user
did — a StepEditEvent: a dialog field used, a click or a drag in the 3-D
viewport as a ray from the eye, a key — to a StepEditor, which
turns it into what the operation understands: a field set to a value, by
the dialog, by a pick in the viewport or by dragging a handle; the
selection changed; a visual dragged in the plane worked in — or, for an
operation with a tool in hand, the click itself (CanvasEvent). What
comes back is a Presentation: the operation’s Form — the
Dialog to show and the Visuals to draw — with what is picked,
selected and hovered lit. The editor reruns the program with the new
arguments, draws both, and the cycle repeats.
Operations say what their fields and visuals mean — entities that can
fill a crate::operation::Role, a length with a handle, a visual that
can be selected or dragged — and the editor decides how they are
edited, so a pick, a selection or a drag works the same in every
operation.
So an editor only ever renders generic primitives and forwards raw input,
and every decision — what a click means, what it snaps to, what a drag
changes — is made here, in Rust, where it can be tested: hit tests a
pointer against visuals, PartView against the part.
Re-exports§
Modules§
- hit
- Hit tests: which
VisualaPointeris over, shared by every operation so a click means the same thing whatever is being edited. - view
PartView: a part as the viewport draws it, and picking entities of it with aPointer.
Structs§
- Action
- Something to do or to choose, as an
Control::Actionsoffers it. - Choice
- One option of a
Control::Select. - Dialog
- The fields an operation shows for a step, in order: an ordered
dictionary from key to control, serialized as a list, so a UI renders it
with one
mapand keys each element by it. Keys are unique. - Edit
- What a setter edits: the step’s arguments, its session, and the keys of the visuals selected.
- Field
- A control, and the key the events it sends carry.
- Form
- What an operation shows for a step: its fields and what setting each
does, and what it draws.
Ais its arguments,Tits session; a form an editor reads (seeForm::erase) has neither. - List
Item - One entry of a
Control::List, with its own key: pressing it sendssuper::Value::Press, removing itRemove, editing its valueNumber. - Number
- A number field.
- Picked
- An entity a
Referenceholds, and what the editor found it to be. - Pointer
- Where the pointer is: the ray from the eye through it, and how far from that ray it reaches.
- Presentation
- What an editor shows for a step being edited: the operation’s
[
Form], and what the editor adds to it — what is picked, selected and hovered, what a click would pick, and the handles of number fields. - Reference
- Entities of the part a step builds on, picked in the viewport: any
entity that can fill one of
roles— and, with ascope, is part of it, like a line of one sketch. One entity, or —multiple— any number, a pick adding or taking out one. - Step
Editor - A step being edited: the step with its arguments as they now are, and the state of the edit — the operation’s session, and the editor’s own: what is selected, which reference field waits for a click and what a click would pick for it, where the pointer is, what is being dragged.
- Track
- Where a number is dragged in the viewport: a handle at
at, sliding alongdirection— moving it bydirectionadds one to the number. - Visual
- Something an operation draws in the viewport, under a key the hit tests
report (see
super::hit::hit_visuals) — and what the user can do with it, which the editor handles alike for every operation (seesuper::StepEditor).
Enums§
- Button
- Which mouse button.
- Canvas
Event - A pointer or key event the editor passes on to an operation, having
taken what is its own: picks, selecting, dragging handles (see
super::StepEditor). - Control
- A dialog primitive.
- Reach
- How far from its ray a
Pointerreaches: what counts as under it, at any distance along the ray. Everything a viewer draws at a constant size on screen — a handle, a label, a frame datum — is laid out in reaches, so it is hit where it is drawn however far away or zoomed in the view is. - Shape
- What a visual is.
- Step
Edit Event - One thing the user did while editing a step.
- Style
- What a visual means, which decides how it is drawn.
- Tone
- How a text reads: plain, a hint, a problem, or good news.
- Unit
- What a number measures, which decides how it reads and steps.
- Value
- What a field was set to — or that it was pressed: in the dialog, by a pick in the viewport, or by dragging a handle.
Constants§
- DRAG_
SNAP - Dragged values snap to this: a drag is for rough shaping, a dialog for exact values.