pub struct SelectionFilter {
pub solid: bool,
pub sketch: bool,
pub face: bool,
pub edge: bool,
pub vertex: bool,
pub plane: bool,
pub component: bool,
}Expand description
Which entity KINDS a plain viewport click may select.
The default enables EVERY kind (SOLID + FACE + EDGE + VERTEX + PLANE), so
out of any special mode every entity under the cursor is pickable and the
highest-priority kind wins (vertices/edges/faces out-priority a construction
plane, which in turn out-priorities the owning solid, matching the picker’s
priority order VERTEX > EDGE > FACE > PLANE > SOLID > COMPONENT).
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§sketch: boolCommitted SKETCHES, as whole objects. A committed sketch is drawn as a
synthesized sheet SOLID (SolidDisplay::is_sketch), so it arrives from the
ray test as an ordinary pick::PickKind::Solid candidate — the two share
a PickKind and are told apart by that flag, not by the picker (see
EngineState::candidate_admitted). Splitting them into two lanes is what
lets a ["SKETCH"] reference field pick a sketch in the viewport while a
["SOLID"] one (a boolean target, a mirror body) does not — a sketch sheet
registers no KERNEL solid, so a sketch name in a SOLID field could never
resolve anyway.
It governs WHOLE-sketch picks only. A sketch’s planar face
({sketch}:FACE) and its drawn segments ({sketch}:G{gid}) stay ordinary
FACE and EDGE candidates under those lanes, deliberately: the profile
fields pick a sketch THROUGH its face (["SKETCH","FACE"], then
normalize_profile_alias) and the path fields pick its curves through
EDGE — path sweep’s path is ["EDGE"] alone and would lose sketch
curves entirely if this lane gated them.
face: bool§edge: bool§vertex: bool§plane: boolConstruction PLANES (a P feature’s frame, a D datum’s three base
planes). A real pickable kind: the drawn plane cards join the ordinary
candidate list (see EngineState::pick_candidates_at), ranked right
after faces, so a plane is reachable THROUGH other geometry via the pick
list. Unchecking it excludes planes exactly as unchecking Face excludes
faces. The reference field’s construction kinds (PLANE/DATUM) map here.
component: boolCOMPONENT promotion: a pick landing on assembly-component geometry
selects the WHOLE component (its member solids — the tree / component-
action selection shape) instead of the sub-entity. Not a pick_filtered
kind — it re-buckets the accepted hit. Default ON: in an assembly a
plain click grabs the component; uncheck it to reach faces/edges of
component geometry (constraint work). Non-component geometry never
promotes, so part documents are unaffected.
Implementations§
Source§impl SelectionFilter
impl SelectionFilter
Sourcepub fn enabled_kinds(&self) -> Vec<String>
pub fn enabled_kinds(&self) -> Vec<String>
The enabled kinds as pick-filter strings, highest pick-priority FIRST
(VERTEX > EDGE > FACE > PLANE > SOLID) — the shape
EngineState::pick_top_at / pick::pick_filtered consume.
EMPTY when nothing is enabled; the caller MUST treat an empty result as
“select nothing” (NOT the “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). COMPONENT counts: a component-only filter still picks component geometry.
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"/"PLANE", case-insensitive;
"DATUM" is an alias of "PLANE"); 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"]). EVERY kind now maps one-to-one to a
pickable lane: SOLID/SKETCH/FACE/EDGE/VERTEX to their own
(SKETCH and SOLID split the one PickKind::Solid between them — see
sketch), and the
CONSTRUCTION spellings PLANE/DATUM both to plane —
construction planes are ordinary pick candidates (see
EngineState::pick_candidates_at), no longer a datum_pick-only path.
The result stays RESTRICTIVE: ["PLANE","FACE"] (a sketch’s sketchPlane)
admits planes and faces and NOTHING else — never solids or edges — and
["PLANE"]/["DATUM"] admits only the plane cards. The all-enabled
fallback fires ONLY for a genuinely empty/unknown filter, so a field is
never left in 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