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
Auto Trait Implementations§
impl Forget for ConstraintOverlay
impl Freeze for ConstraintOverlaywhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<[f64; 3]>: Freeze,
PhantomData<Vec<usize>>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<String>: Freeze,
impl Move for ConstraintOverlay
impl RefUnwindSafe for ConstraintOverlay
impl Send for ConstraintOverlay
impl Sync for ConstraintOverlay
impl Unpin for ConstraintOverlay
impl UnsafeUnpin for ConstraintOverlaywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<[f64; 3]>: UnsafeUnpin,
PhantomData<Vec<usize>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.