pub struct ConstraintOverlay {Show 14 fields
pub id: String,
pub constraint_type: String,
pub icon: String,
pub status: String,
pub message: String,
pub kind: ConstraintOverlayKind,
pub anchors: Vec<[f64; 3]>,
pub groups: Vec<Vec<usize>>,
pub annotation: Option<FeatureDimAnnotation>,
pub value: Option<f64>,
pub unit: String,
pub draggable: bool,
pub input_params: Value,
pub elements: Vec<String>,
}Expand description
One constraint’s overlay record: identity + status for the label, the resolved world geometry, and (for the dimensional kinds) the annotation the shared leader renderer draws + the drag machinery grabs.
Fields§
§id: StringThe constraint id (DIST3, ANGL2, …) — the mutation-ABI key.
constraint_type: StringThe constraint type string (distance, coincident, …).
icon: StringThe type’s icon glyph (brep_kernel::ConstraintTypeDef::icon) — what
the viewport chip shows in place of the id. Empty for an unknown type,
in which case the chip falls back to the id.
status: StringThe solve status (satisfied / adjusted / error / …) — drives the
label color via status_color.
message: StringThe human status/solve message (label tooltip).
kind: ConstraintOverlayKindThe overlay family.
anchors: Vec<[f64; 3]>The resolved WORLD anchor points (one per selection; empty when the kernel could not resolve the selections — label-less, geometry-less row).
groups: Vec<Vec<usize>>The element ROLE groups a multi-element type inferred (groups on the
overlay row): index groups into anchors, role order — center’s
[width pair, tab]. Empty for the pairing types, whose two anchors ARE
the drawing.
annotation: Option<FeatureDimAnnotation>Distance/Angle: the dimension annotation (reusing the feature-dim shape so
leaders_buffers renders it verbatim). field_key is the inputParams
key the drag edits (distance / angle). None for Leader rows and
for dimensional rows whose anchors did not resolve.
value: Option<f64>The measured value the kernel evaluated (value in the overlay row), for
the label suffix. None for non-dimensional rows.
unit: StringThe value’s unit ("mm" / "deg"), empty when value is None.
draggable: boolWhether the dimensional handle may be DRAGGED: true only for Distance/Angle whose current param is numeric (or absent — a first-solve initialized target). A non-numeric expression string disables the drag.
input_params: ValueThe constraint’s inputParams (from the state list) — the drag commit
mutates a clone of this (so elements / flags ride along unchanged).
elements: Vec<String>The referenced element names (inputParams.elements) — label hover
highlights these through the existing emphasis machinery.
Implementations§
Source§impl ConstraintOverlay
impl ConstraintOverlay
Sourcepub fn field_key(&self) -> Option<&'static str>
pub fn field_key(&self) -> Option<&'static str>
The inputParams key a drag on this overlay edits (distance / angle).
Sourcepub fn label_anchor(&self, world_per_pixel: f64) -> Option<[f64; 3]>
pub fn label_anchor(&self, world_per_pixel: f64) -> Option<[f64; 3]>
The world-space label anchor: a dimensional annotation’s chip anchor (the
leader midpoint, or the angle arc’s mid-sweep at the screen-constant
radius — camera-dependent via world_per_pixel); a role-grouped row’s
first-group centroid (center: the width span’s midpoint, on the
mid-plane); a leader row’s anchor midpoint (or its single anchor).
None when nothing resolved.
Sourcepub fn label_text(&self) -> String
pub fn label_text(&self) -> String
The label chip text: the type’s icon, then {value}{unit} for
dimensional rows (⟺ 5.25 mm, ∠ 90°); the bare icon otherwise. The
id no longer rides in the chip — the app’s chip hover names it — so a
crowded assembly reads by picture, not by DIST3/COIN9 codes. A row
whose type has no icon keeps the id in the icon’s place.
Trait Implementations§
Source§impl Clone for ConstraintOverlay
impl Clone for ConstraintOverlay
Source§fn clone(&self) -> ConstraintOverlay
fn clone(&self) -> ConstraintOverlay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ConstraintOverlay
impl RefUnwindSafe for ConstraintOverlay
impl Send for ConstraintOverlay
impl Sync for ConstraintOverlay
impl Unpin for ConstraintOverlay
impl UnsafeUnpin for ConstraintOverlay
impl UnwindSafe for ConstraintOverlay
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<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