pub trait Scene {
// Required methods
fn under(&self, pointer: &Pointer, accepts: &[String]) -> Vec<ElementHit>;
fn hit_instance(&self, name: &str, pointer: &Pointer) -> Option<Scalar>;
// Provided method
fn pick(&self, pointer: &Pointer, accepts: &[String]) -> Option<ElementHit> { ... }
}Expand description
The part as an editor draws it, which picks are made in: what an editor
needs to know of it beyond a step’s own visuals, and what an operation
is given to find what the pointer is over (see
crate::editable::Context::scene).
Required Methods§
Sourcefn under(&self, pointer: &Pointer, accepts: &[String]) -> Vec<ElementHit>
fn under(&self, pointer: &Pointer, accepts: &[String]) -> Vec<ElementHit>
Every element of the kinds accepts under pointer, each once: the
one a click picks first — the smallest, in front, nearest the eye
(see crate::view::PartView::under) — then the rest front to back
along the ray, those hidden behind the first included. Its
Pointer::cycle is not looked at.
Sourcefn hit_instance(&self, name: &str, pointer: &Pointer) -> Option<Scalar>
fn hit_instance(&self, name: &str, pointer: &Pointer) -> Option<Scalar>
How far along pointer’s ray the placed part name is hit, if it
is (see Shape::Instance).
Provided Methods§
Sourcefn pick(&self, pointer: &Pointer, accepts: &[String]) -> Option<ElementHit>
fn pick(&self, pointer: &Pointer, accepts: &[String]) -> Option<ElementHit>
What a click with pointer picks: of what lies Scene::under
it, the one its Pointer::cycle names, and where it is hit.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".