pub struct SelectionFilter {
pub solid: bool,
pub face: bool,
pub edge: bool,
pub vertex: bool,
}Expand description
Which entity KINDS a plain viewport click may select.
The default enables ALL FOUR kinds (SOLID + FACE + EDGE + VERTEX), so out
of any special mode every entity under the cursor is pickable and the
highest-priority kind wins (vertices/edges/faces out-priority the owning solid,
matching the picker’s priority order). Reference-selection mode narrows this to
exactly the kinds the active field permits (see from_ref_filter +
EngineState::begin_ref_select); finishing / cancelling restores this
all-enabled default.
Fields§
§solid: bool§face: bool§edge: bool§vertex: boolImplementations§
Source§impl SelectionFilter
impl SelectionFilter
Sourcepub fn enabled_kinds(&self) -> Vec<String>
pub fn enabled_kinds(&self) -> Vec<String>
The enabled kinds as pick_filtered strings, highest pick-priority FIRST
(VERTEX > EDGE > FACE > SOLID) — the shape pick::pick_filtered consumes.
EMPTY when nothing is enabled; the caller MUST treat an empty result as
“select nothing” (NOT the pick_filtered “empty filter = any kind” case).
Sourcepub fn any_enabled(&self) -> bool
pub fn any_enabled(&self) -> bool
Whether ANY kind is enabled (else a click can select nothing).
Sourcepub fn get(&self, kind: &str) -> bool
pub fn get(&self, kind: &str) -> bool
Read one kind’s pickability by name ("SOLID"/"FACE"/"EDGE"/"VERTEX",
case-insensitive); unknown kinds read false.
Sourcepub fn set(&mut self, kind: &str, on: bool)
pub fn set(&mut self, kind: &str, on: bool)
Set one kind’s pickability by name (unknown kinds are ignored).
Sourcepub fn from_ref_filter(filter: &[String]) -> Self
pub fn from_ref_filter(filter: &[String]) -> Self
Build a selection filter from a reference field’s allowed-type strings
(its schema selectionFilter, e.g. ["SOLID"], ["FACE","EDGE"],
["PLANE","FACE"], ["DATUM"]). SOLID/FACE/EDGE/VERTEX map
one-to-one to the pickable kinds; the CONSTRUCTION kinds PLANE/DATUM
have no pickable-kind equivalent (construction planes/datums are picked
through the independent datum_pick widget path, NOT pick_filtered) and
are dropped by set’s unknown-kind arm.
A field that maps to NO pickable kind — an ABSENT/empty filter, or one that
lists ONLY construction kinds — falls back to ALL kinds enabled (the
default), never the unusable “select nothing” state.
Reference-selection mode installs the result as the live selection_filter
so BOTH hover-highlighting and click-picking follow the field’s allowed
kinds.
Trait Implementations§
Source§impl Clone for SelectionFilter
impl Clone for SelectionFilter
Source§fn clone(&self) -> SelectionFilter
fn clone(&self) -> SelectionFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SelectionFilter
Source§impl Debug for SelectionFilter
impl Debug for SelectionFilter
Source§impl Default for SelectionFilter
impl Default for SelectionFilter
impl Eq for SelectionFilter
Source§impl PartialEq for SelectionFilter
impl PartialEq for SelectionFilter
impl StructuralPartialEq for SelectionFilter
Auto Trait Implementations§
impl Freeze for SelectionFilter
impl RefUnwindSafe for SelectionFilter
impl Send for SelectionFilter
impl Sync for SelectionFilter
impl Unpin for SelectionFilter
impl UnsafeUnpin for SelectionFilter
impl UnwindSafe for SelectionFilter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more