fix(dimension): complete angular workflow

This commit is contained in:
Hakan Seven committed 2026-08-25 18:55:25 +03:00
commit 649dfae337
35 files changed
+2084 -264

No files matched your search

+48 -3
View File
@@ -169,6 +169,38 @@ pub struct SelectionEntity {
pub surface_area: Option<f64>,
}
/// Association source with an optional sub-entity marker.
#[derive(Clone, Copy, Debug)]
pub struct DimensionAssociationSource {
pub handle: Handle,
pub marker: Option<i32>,
pub parameter: f64,
}
impl DimensionAssociationSource {
pub const fn inferred(handle: Handle) -> Self {
Self {
handle,
marker: None,
parameter: 0.0,
}
}
pub const fn explicit(handle: Handle, marker: i32, parameter: f64) -> Self {
Self {
handle,
marker: Some(marker),
parameter,
}
}
}
#[derive(Clone, Debug)]
pub enum DimensionAssociationInput {
Infer(Option<Handle>),
Explicit(Vec<Option<DimensionAssociationSource>>),
}
#[derive(Clone)]
pub enum AreaPreviewSource {
Handles(Vec<Handle>),
@@ -1212,11 +1244,10 @@ pub enum CmdResult {
CommitEntitiesAndExit(Vec<EntityType>),
/// Commit an acadrust entity to the document and end the command.
CommitAndExit(EntityType),
/// Commit a linear/aligned dimension using the drawing's association mode.
/// Object-selection workflows may retain their source.
/// Commit a dimension using the drawing's association mode.
CommitDimension {
entity: EntityType,
source: Option<Handle>,
association: DimensionAssociationInput,
},
/// Commit a Model-tab 3D solid: the acadrust entity (for selection /
/// persistence) plus its B-rep (cached for boolean ops + shaded
@@ -1397,6 +1428,12 @@ pub enum CmdResult {
initial: String,
height: f64,
},
/// Collect rich text without creating an MText entity.
SuspendForMTextInput {
pos: DVec3,
initial: String,
height: f64,
},
/// Open the in-place single-line TEXT editor (a plain text-entry box, no
/// formatting toolbar). `handle` is `Some` when editing an existing Text,
/// `None` when creating a new one at `pos`.
@@ -1778,6 +1815,11 @@ pub trait CadCommand: Send {
false
}
/// Accept typed coordinates while object picking.
fn entity_pick_accepts_points(&self) -> bool {
false
}
/// Include filled hatch / DXF SOLID regions in the entity hit-test.
///
/// Most entity-pick commands operate on curve geometry and intentionally
@@ -1806,6 +1848,9 @@ pub trait CadCommand: Send {
CmdResult::Cancel
}
/// Resume the command with collected rich text.
fn on_editor_text(&mut self, _value: String) {}
/// Called when the user clicks and `needs_entity_pick()` is true.
/// `handle` is the nearest wire's entity handle (Handle::NULL if nothing found).
fn on_entity_pick(&mut self, _handle: Handle, _pt: DVec3) -> CmdResult {