pub struct ConstraintOverlay {
pub id: String,
pub constraint_type: String,
pub status: String,
pub message: String,
pub kind: ConstraintOverlayKind,
pub anchors: Vec<[f64; 3]>,
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, …).
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).
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 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: {id} {value}{unit} for dimensional rows
(DIST3 5.25 mm, ANGL2 90°), bare {id} otherwise.
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