Skip to main content

Form

Struct Form 

Source
pub struct Form {
    pub dialog: Dialog,
    pub layout: Layout,
    pub visuals: Vec<Visual>,
    pub focus: Option<CoordinateSystem>,
    pub sheet: Option<Extent>,
    pub tool: InHand,
    pub selection: Vec<String>,
    pub select_box: bool,
    pub pulls: Vec<Pull>,
    pub prompt: Option<Prompt>,
    pub gizmo: Option<Gizmo>,
    pub hidden: Vec<String>,
}
Expand description

What an operation shows for a step: the fields of its dialog and what it draws, and what the editor needs to know to edit it the same way as every other step — what is selected, what the operation has in hand, what it drags. Plain data: what a field does when it is set is the operation’s to say when it is sent the Event.

Fields§

§dialog: Dialog§layout: Layout

Where the dialog is shown: beside the viewport, or as a popup over it (see Layout).

§visuals: Vec<Visual>§focus: Option<CoordinateSystem>

A plane to work in, its u/v plane: the viewer faces it head on, stops orbiting, and draws a grid on it. Draggable visuals are dragged in it.

§sheet: Option<Extent>

A sheet of its own the step is edited on — a drawing’s paper, laid in focus — and how far it reaches: the viewer shows the step’s visuals alone, without the part, framed to it.

§tool: InHand

What the operation has in hand: clicks — and, for a tool that strokes, drags — go to it rather than select.

§selection: Vec<String>

The keys of the visuals selected. A click on a selectable visual changes it, and the operation is sent the new selection (Event::Select) to keep.

§select_box: bool

Whether a drag from nothing, with nothing in hand, draws a box that selects: the operation is sent it (CanvasEvent::SelectBox) and decides what lies in it, from what its visuals stand for.

§pulls: Vec<Pull>

What the step pulls the state towards: the editor solves the program with them.

§prompt: Option<Prompt>

A value asked for in place, in the viewport.

§gizmo: Option<Gizmo>

A gizmo to move, turn or scale something by: its drags are sent as CanvasEvent::Gizmo.

§hidden: Vec<String>

Solids and faces of the part, by name, not to draw while the step is edited: what the step builds, when its visuals show it better — a control cage shown alone.

Trait Implementations§

Source§

impl Clone for Form

Source§

fn clone(&self) -> Form

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Form

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Form

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Form

Source§

fn eq(&self, other: &Form) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Form

Auto Trait Implementations§

§

impl Freeze for Form

§

impl RefUnwindSafe for Form

§

impl Send for Form

§

impl Sync for Form

§

impl Unpin for Form

§

impl UnsafeUnpin for Form

§

impl UnwindSafe for Form

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.