Skip to main content

PickTool

Struct PickTool 

Source
pub struct PickTool { /* private fields */ }
Expand description

An inspector that picks, in hand: what the pointer is over, what is picked, and the inspector’s answer about it.

Implementations§

Source§

impl PickTool

Source

pub const PREFIX: &'static str = "pick:"

What the key of an inspector’s pick tool starts with: pick:measure.

Source

pub fn new(info: &'static InspectorInfo) -> GeopResult<Self>

The tool of the inspector info. Fails for one that is asked of the whole part.

Source

pub fn kind(&self) -> &'static str

Its inspector’s kind.

Source

pub fn picked(&self) -> &[PickedElement]

What is picked, the oldest first.

Trait Implementations§

Source§

impl Tool for PickTool

Source§

fn handle( &mut self, ctx: &mut EditorContext<'_>, event: &StepEditEvent, ) -> GeopResult<Changed>

An event in the viewport, picking in what is drawn: a hover finds what a click would pick; a click picks it — joining the picks, or replacing the oldest once there are as many as the inspector takes; a click on one picked takes it out, a click on nothing clears them; Escape clears them too. A change of the picks asks again.

Source§

fn presentation(&self) -> Presentation

What it shows: the picks and what a click would pick lit, and what the answer draws.

Source§

fn inspection( &mut self, ctx: &mut EditorContext<'_>, ) -> GeopResult<Option<Inspection>>

The inspector’s answer about the picks, asked again only if they or the part changed since.

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> 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, 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.