Skip to main content

AddSketch

Struct AddSketch 

Source
pub struct AddSketch;
Expand description

Adds a sketch on a plane to the part, named by the operation’s id: a planar face, a datum plane or a frame’s plane (see [EntityRef]). The plane is resolved when the sketch is added: a sketch on a face stays where the face was, whatever later operations do to the face.

Trait Implementations§

Source§

impl Clone for AddSketch

Source§

fn clone(&self) -> AddSketch

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 Copy for AddSketch

Source§

impl Debug for AddSketch

Source§

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

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

impl Default for AddSketch

Source§

fn default() -> AddSketch

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

impl<'de> Deserialize<'de> for AddSketch

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Operation for AddSketch

Source§

fn new_args<S: Scalar>(&self, _before: &Part<S>) -> AddSketchArgs

An empty sketch, on no plane yet: where to sketch is the first thing a new sketch asks for.

Source§

fn form<'a, S: Scalar>( &self, before: &'a Part<S>, args: &AddSketchArgs, s: &SketchSession, selection: &[String], ) -> Form<'a, S, AddSketchArgs, SketchSession>

The plane, picked, and the sketch drawn in it: see crate::editor.

Source§

type Args = AddSketchArgs

Everything a step needs, as plain, serializable design data.
Source§

type Session = SketchSession

The temporary state of editing a step beyond its arguments — () for every operation whose form says all there is to it. Starts afresh whenever an editor opens a step.
Source§

fn apply<S: Scalar>( &self, part: Part<S>, operation_id: &str, args: &AddSketchArgs, ) -> GeopResult<Part<S>>

Applies the operation as the program step operation_id, consuming part and returning the part it produces. Everything the operation creates is named after operation_id (see the crate docs), so the id has to be unique within a program. Read more
Source§

fn event<S: Scalar>( &self, before: &Part<S>, args: &mut AddSketchArgs, session: &mut SketchSession, selection: &mut Vec<String>, event: &CanvasEvent<S>, )

A pointer or key event the editor passed on (see [CanvasEvent]). Only an operation that draws in a canvas of its own, like a sketch, needs these.
§

fn set<S>( &self, before: &Part<S>, args: &mut Self::Args, session: &mut Self::Session, selection: &mut Vec<String>, key: &str, value: Value, )
where S: Scalar,

The field key of the form set to value: typed or chosen in the dialog, picked in the viewport, dragged as a handle — by the setter the form gave it (see [Form]).
Source§

impl PartialEq for AddSketch

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AddSketch

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AddSketch

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.