Skip to main content

Crate geop_core_editor

Crate geop_core_editor 

Source
Expand description

What editing is: the vocabulary a step’s editing is said in — dialogs, visuals, gizmos, events, picks (editing), number fields of numbers typed as formulas (geop_core_program::numeric, edit_form::EditForm::numeric) — what an operation shows and does with them (editable::Editable), what a part is drawn as and picked in (view), and what is made of a part rather than in it: files and answers (output); the interaction every step shares (step_editor) and the whole of editing a program (editor), over what a registry::Registry offers — operations, drawers, panels, tools (tools), a settler, examples — none of which it names; and the editor driven by an agent’s tools (agent), which every front end an agent talks to offers. A program runs without any of it (see geop_core_program).

Modules§

agent
An Editor driven by an agent’s tools: the one tool layer of every front end an agent talks to — the MCP server (geop mcp) and the web app’s hosted assistant alike.
edit_form
EditForm: a Form built together with what setting each of its fields does — for an operation with many fields, whose events are then answered by the setter of the field they set (see EditForm::set) rather than by matching their keys. Every setter gets the whole Edit: a field may set the step’s arguments or its session.
editable
Editable: what an Operation is to an editor — how it is offered, the arguments of a new step, the form a step is edited through and what the user’s events do to it — and Editors, the operations an editor offers, which also gives the program runner its registry.
editing
What an editor exchanges with an operation while a step is edited: the Presentation it shows, a Dialog of fields and the Visuals it draws, and the Events of what the user did. Fields say what a value means, never how it is edited, so a pick, a selection or a drag means the same in every operation.
editor
Editor: the whole of editing a program, as one state machine an editor drives with Commands and draws from the Updates it answers.
keys
The keys of what every front end offers besides the operations — the command palette, the key list, committing and cancelling a step, undoing, framing the view — named once, here, so that the web app and VS Code press the same keys for the same things (see docs/ux.md). An operation’s key is its own (crate::editable::OperationInfo::shortcut).
output
What is made of a part rather than in it: files written from what a program built (Exporter), and questions answered about it (Inspector). Neither is a step: exporting and inspecting change no program and are nothing to undo.
part_operation
PartOperation: an operation and how it is edited, in one trait — what a step is given, how it runs, and the one form it is edited through, whose fields each set what they show, so a field’s key is written once — and part_operation!, which makes it an Operation and an Editable, its editing state a FormState of its session.
registry
Registry: everything an editor offers, gathered in one builder that each operation crate adds to with its one register function — the operations a step can be, how what they build is drawn and listed (Drawer), the exporters and inspectors (crate::output), the panels (Panel), the tools (Tool), what settles the program’s state after every edit (Settle) and the examples (ExampleSet).
selectable
Selectable: what a reference field of a dialog holds — an element of a kind the user picks (SelectableElement), or one of several (one_of!) — and how a click on what the editor draws selects one, with selected, the values a reference field’s picks come to.
step_editor
StepEditor: editing one step — the interaction every operation shares, so a pick, a selection or a drag means the same whatever is edited — against a Scene: the part as drawn, which picks are made in.
tools
Tool: a mode in hand while no step is edited, which the events of the viewport go to — the drag tool of an assembly, the pick tool of an inspector (pick).
view
PartView: a part as the viewport draws it, and picking elements of it with a Pointer.

Macros§

one_of
Declares an enum of references, each variant one source of what an operation takes — a line from a straight edge, a datum axis or a sketch line — given -> Out, all resolving to the same value, Out (resolve). Saved by its variant’s name: {"edge": "extrude(e,end)"}. It is Selectable: a click selects the first variant that selects it. A value held is told from a click by its kind, so no variant may be of a kind drawn as itself that another variant selects from — a field of edges or chains would take a click on an edge for an edge held. The crate using it depends on serde.
part_operation
Makes each PartOperation named, Operation(Args), an Operation and an Editable, edited through its form — and its arguments the StepArgs of it. (Named, since what an operation’s Args stand for is not known to other crates’ impls.)