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§
impl Copy for AddSketch
Source§impl<'de> Deserialize<'de> for AddSketch
impl<'de> Deserialize<'de> for AddSketch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
impl Operation for AddSketch
Source§fn new_args<S: Scalar>(&self, _before: &Part<S>) -> AddSketchArgs
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>
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
type Args = AddSketchArgs
Everything a step needs, as plain, serializable design data.
Source§type Session = SketchSession
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>>
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 moreSource§fn event<S: Scalar>(
&self,
before: &Part<S>,
args: &mut AddSketchArgs,
session: &mut SketchSession,
selection: &mut Vec<String>,
event: &CanvasEvent<S>,
)
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,
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]).impl StructuralPartialEq for AddSketch
Auto Trait Implementations§
impl Freeze for AddSketch
impl RefUnwindSafe for AddSketch
impl Send for AddSketch
impl Sync for AddSketch
impl Unpin for AddSketch
impl UnsafeUnpin for AddSketch
impl UnwindSafe for AddSketch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more