feat: redesign Annotate ribbon tab with proper groups and SVG icons
Added 15 SVG icons for all annotation tools (dimensions, leaders,
table, wipeout, revision cloud, tolerance, ddedit).
Annotate ribbon now has 6 groups matching standard CAD layout:
- Text: MText (large dropdown) + Text + Edit Text
- Dimensions: Linear (large dropdown with 6 types) + Continue + Baseline + Tolerance
- Leaders: Multileader (large dropdown) + Leader
- Tables: Table (large)
- Markup: Wipeout + Rev Cloud
- Annotation Scaling: Scale List, Add Scale, Scale Edit, Sync Scales
Added pub tool() + ICON to all annotate tools that were missing them
(aligned_dim, diameter_dim, dim_continue, dim_baseline, table_cmd,
tolerance_cmd, ddedit), and to home/draw/wipeout and revcloud.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 03:03:08 +03:00
|
|
|
// Annotate module — dimension, text, leader, table, and markup tools.
|
2026-03-22 14:56:27 +03:00
|
|
|
|
2026-04-03 09:29:11 +03:00
|
|
|
pub mod aligned_dim;
|
2026-08-26 15:32:37 +03:00
|
|
|
pub mod arc_length_dim;
|
2026-05-12 10:36:15 +03:00
|
|
|
pub mod angular_dim;
|
feat: redesign View tab and fix Annotate/tab order
- Redesign View ribbon tab with 8 groups matching AutoCAD layout:
Viewport Tools (UCS Icon, ViewCube, Navigation Bar),
Navigate, Model Viewports (Viewport Configuration, Named, Join, Restore),
Visual Style (dropdown), Projection, Preset,
Palettes (Tool Palettes, Properties, Sheet Set Manager),
Interface (File Tabs, Layout Tabs, Tile Horiz/Vert, Cascade)
- Add Extract Data and Link Data tools to Annotate → Tables group
- Fix tab order to Home → Insert → Annotate → View → Manage via build.rs PRIORITY list
- Add 17 new SVG icons for all new commands
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 12:25:15 +03:00
|
|
|
pub mod data_extract;
|
|
|
|
|
pub mod data_link;
|
2026-04-07 11:05:24 +03:00
|
|
|
pub mod ddedit;
|
2026-04-03 09:29:11 +03:00
|
|
|
pub mod diameter_dim;
|
Feat: ROADMAP Phase 1-5 batch — trim/extend, plot scale, viewport UX, mline caps, table alignment
- TRIM/EXTEND: Ray and XLine entities supported as cutting boundaries and trim targets;
trim results in Ray→Line/Ray, XLine→Ray/Ray or Line; hover preview added
- Plot scale override: Fit/1:1/1:2/1:5/1:10/1:20/1:50/1:100/2:1 buttons added to Page Setup
panel; PageSetupCommit applies scale to PlotSettings
- Viewport UX: locked viewport gets orange border; selected viewport gets white border
- Named view → viewport assignment: Choice dropdown in properties panel copies
view_target/direction/height to the viewport entity
- MLine caps: perpendicular start/end cap lines added for open (non-closed) MLines
- Wipeout polygon grips: boundary vertices become editable grips when clipping_enabled+Polygonal;
world→pixel back-projection on drag
- Table cell alignment: CellStyle.alignment (1-9) drives left/center/right + top/middle/bottom
text positioning; cxf::measure_text() helper added
- New commands/features: DIMCONTINUE (DCO), DIMBASELINE (DBA), TOLERANCE (TOL), TABLE,
ATTDEF, ATTEDIT, ATTDISP, BREAKATPOINT (BAP), PLOTWINDOW (PW), MLINE (ML);
DIMSTYLE/DIMCURRENT/CLAYER/LTSCALE/CELTSCALE/SCALETEXT/XDATA/UCSICON/REGEN/DRAWORDER extended
- PLINE arc mode: A/L/CLOSE text input, bulge computation, arc preview
- Warning cleanup: removed unused imports and unreachable patterns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:31:05 +03:00
|
|
|
pub mod dim_baseline;
|
|
|
|
|
pub mod dim_continue;
|
feat: add missing Annotate tab commands and icons
New dimension commands: QDIM, DIMEDIT, DIMTEDIT, DIMBREAK, DIMSPACE,
DIMJOGLINE with full command workflows and SVG icons.
New multileader commands: MLEADERADD, MLEADERREMOVE, MLEADERALIGN,
MLEADERCOLLECT with entity injection pattern for in-place editing.
Updated annotate ribbon: all tools exposed across Text, Dimensions,
Leaders, Tables, Markup, and Annotation Scaling groups. Added STYLE,
FIND, DIMSTYLE shortcut buttons.
Added `inject_picked_entity` to the CadCommand trait for commands that
need a cloned copy of the picked entity to modify (DIMTEDIT, MLEADERADD,
MLEADERREMOVE). Sentinel-based dispatch in cmd_result.rs handles
DIMBREAK, DIMSPACE, DIMJOGLINE, MLEADERALIGN, and MLEADERCOLLECT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 03:26:47 +03:00
|
|
|
pub mod dimbreak;
|
|
|
|
|
pub mod dimedit;
|
|
|
|
|
pub mod dimjogline;
|
|
|
|
|
pub mod dimspace;
|
|
|
|
|
pub mod dimtedit;
|
2026-03-22 14:56:27 +03:00
|
|
|
pub mod leader_cmd;
|
|
|
|
|
pub mod linear_dim;
|
|
|
|
|
pub mod mleader_cmd;
|
feat: add missing Annotate tab commands and icons
New dimension commands: QDIM, DIMEDIT, DIMTEDIT, DIMBREAK, DIMSPACE,
DIMJOGLINE with full command workflows and SVG icons.
New multileader commands: MLEADERADD, MLEADERREMOVE, MLEADERALIGN,
MLEADERCOLLECT with entity injection pattern for in-place editing.
Updated annotate ribbon: all tools exposed across Text, Dimensions,
Leaders, Tables, Markup, and Annotation Scaling groups. Added STYLE,
FIND, DIMSTYLE shortcut buttons.
Added `inject_picked_entity` to the CadCommand trait for commands that
need a cloned copy of the picked entity to modify (DIMTEDIT, MLEADERADD,
MLEADERREMOVE). Sentinel-based dispatch in cmd_result.rs handles
DIMBREAK, DIMSPACE, DIMJOGLINE, MLEADERALIGN, and MLEADERCOLLECT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 03:26:47 +03:00
|
|
|
pub mod mleader_edit;
|
2026-03-22 14:56:27 +03:00
|
|
|
pub mod mtext;
|
feat: add missing Annotate tab commands and icons
New dimension commands: QDIM, DIMEDIT, DIMTEDIT, DIMBREAK, DIMSPACE,
DIMJOGLINE with full command workflows and SVG icons.
New multileader commands: MLEADERADD, MLEADERREMOVE, MLEADERALIGN,
MLEADERCOLLECT with entity injection pattern for in-place editing.
Updated annotate ribbon: all tools exposed across Text, Dimensions,
Leaders, Tables, Markup, and Annotation Scaling groups. Added STYLE,
FIND, DIMSTYLE shortcut buttons.
Added `inject_picked_entity` to the CadCommand trait for commands that
need a cloned copy of the picked entity to modify (DIMTEDIT, MLEADERADD,
MLEADERREMOVE). Sentinel-based dispatch in cmd_result.rs handles
DIMBREAK, DIMSPACE, DIMJOGLINE, MLEADERALIGN, and MLEADERCOLLECT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 03:26:47 +03:00
|
|
|
pub mod ordinate_dim;
|
|
|
|
|
pub mod qdim;
|
2026-03-22 14:56:27 +03:00
|
|
|
pub mod radius_dim;
|
Feat: ROADMAP Phase 1-5 batch — trim/extend, plot scale, viewport UX, mline caps, table alignment
- TRIM/EXTEND: Ray and XLine entities supported as cutting boundaries and trim targets;
trim results in Ray→Line/Ray, XLine→Ray/Ray or Line; hover preview added
- Plot scale override: Fit/1:1/1:2/1:5/1:10/1:20/1:50/1:100/2:1 buttons added to Page Setup
panel; PageSetupCommit applies scale to PlotSettings
- Viewport UX: locked viewport gets orange border; selected viewport gets white border
- Named view → viewport assignment: Choice dropdown in properties panel copies
view_target/direction/height to the viewport entity
- MLine caps: perpendicular start/end cap lines added for open (non-closed) MLines
- Wipeout polygon grips: boundary vertices become editable grips when clipping_enabled+Polygonal;
world→pixel back-projection on drag
- Table cell alignment: CellStyle.alignment (1-9) drives left/center/right + top/middle/bottom
text positioning; cxf::measure_text() helper added
- New commands/features: DIMCONTINUE (DCO), DIMBASELINE (DBA), TOLERANCE (TOL), TABLE,
ATTDEF, ATTEDIT, ATTDISP, BREAKATPOINT (BAP), PLOTWINDOW (PW), MLINE (ML);
DIMSTYLE/DIMCURRENT/CLAYER/LTSCALE/CELTSCALE/SCALETEXT/XDATA/UCSICON/REGEN/DRAWORDER extended
- PLINE arc mode: A/L/CLOSE text input, bulge computation, arc preview
- Warning cleanup: removed unused imports and unreachable patterns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:31:05 +03:00
|
|
|
pub mod table_cmd;
|
2026-03-22 14:56:27 +03:00
|
|
|
pub mod text;
|
2026-06-18 14:55:08 +01:00
|
|
|
pub mod textedit;
|
Feat: ROADMAP Phase 1-5 batch — trim/extend, plot scale, viewport UX, mline caps, table alignment
- TRIM/EXTEND: Ray and XLine entities supported as cutting boundaries and trim targets;
trim results in Ray→Line/Ray, XLine→Ray/Ray or Line; hover preview added
- Plot scale override: Fit/1:1/1:2/1:5/1:10/1:20/1:50/1:100/2:1 buttons added to Page Setup
panel; PageSetupCommit applies scale to PlotSettings
- Viewport UX: locked viewport gets orange border; selected viewport gets white border
- Named view → viewport assignment: Choice dropdown in properties panel copies
view_target/direction/height to the viewport entity
- MLine caps: perpendicular start/end cap lines added for open (non-closed) MLines
- Wipeout polygon grips: boundary vertices become editable grips when clipping_enabled+Polygonal;
world→pixel back-projection on drag
- Table cell alignment: CellStyle.alignment (1-9) drives left/center/right + top/middle/bottom
text positioning; cxf::measure_text() helper added
- New commands/features: DIMCONTINUE (DCO), DIMBASELINE (DBA), TOLERANCE (TOL), TABLE,
ATTDEF, ATTEDIT, ATTDISP, BREAKATPOINT (BAP), PLOTWINDOW (PW), MLINE (ML);
DIMSTYLE/DIMCURRENT/CLAYER/LTSCALE/CELTSCALE/SCALETEXT/XDATA/UCSICON/REGEN/DRAWORDER extended
- PLINE arc mode: A/L/CLOSE text input, bulge computation, arc preview
- Warning cleanup: removed unused imports and unreachable patterns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:31:05 +03:00
|
|
|
pub mod tolerance_cmd;
|
2026-03-22 14:56:27 +03:00
|
|
|
|
2026-04-09 03:38:23 +03:00
|
|
|
use crate::modules::{CadModule, RibbonGroup, RibbonItem, StyleKey};
|
2026-03-22 14:56:27 +03:00
|
|
|
|
|
|
|
|
pub struct AnnotateModule;
|
|
|
|
|
|
|
|
|
|
impl CadModule for AnnotateModule {
|
|
|
|
|
fn id(&self) -> &'static str {
|
|
|
|
|
"annotate"
|
|
|
|
|
}
|
|
|
|
|
fn title(&self) -> &'static str {
|
|
|
|
|
"Annotate"
|
|
|
|
|
}
|
|
|
|
|
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
fn ribbon_groups(&self) -> &[RibbonGroup] {
|
2026-06-16 11:49:14 +03:00
|
|
|
use crate::modules::draw::draw::{revcloud, wipeout};
|
feat: redesign Annotate ribbon tab with proper groups and SVG icons
Added 15 SVG icons for all annotation tools (dimensions, leaders,
table, wipeout, revision cloud, tolerance, ddedit).
Annotate ribbon now has 6 groups matching standard CAD layout:
- Text: MText (large dropdown) + Text + Edit Text
- Dimensions: Linear (large dropdown with 6 types) + Continue + Baseline + Tolerance
- Leaders: Multileader (large dropdown) + Leader
- Tables: Table (large)
- Markup: Wipeout + Rev Cloud
- Annotation Scaling: Scale List, Add Scale, Scale Edit, Sync Scales
Added pub tool() + ICON to all annotate tools that were missing them
(aligned_dim, diameter_dim, dim_continue, dim_baseline, table_cmd,
tolerance_cmd, ddedit), and to home/draw/wipeout and revcloud.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 03:03:08 +03:00
|
|
|
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
|
|
|
|
GROUPS.get_or_init(|| {
|
|
|
|
|
vec![
|
|
|
|
|
// ── Text ─────────────────────────────────────────────────────
|
|
|
|
|
RibbonGroup {
|
|
|
|
|
title: "Text",
|
|
|
|
|
tools: vec![
|
|
|
|
|
RibbonItem::LargeDropdown {
|
|
|
|
|
id: "ANNOTATE_TEXT",
|
|
|
|
|
label: "Multiline\nText",
|
|
|
|
|
icon: mtext::ICON,
|
|
|
|
|
items: vec![
|
|
|
|
|
(mtext::tool().id, mtext::tool().label, mtext::tool().icon),
|
|
|
|
|
(text::tool().id, text::tool().label, text::tool().icon),
|
|
|
|
|
(ddedit::tool().id, ddedit::tool().label, ddedit::tool().icon),
|
|
|
|
|
],
|
|
|
|
|
default: "MTEXT",
|
|
|
|
|
},
|
|
|
|
|
RibbonItem::StyleComboGroup {
|
|
|
|
|
style_key: StyleKey::TextStyle,
|
|
|
|
|
combo_id: "TEXT_STYLE_COMBO",
|
|
|
|
|
manager_cmd: Some("STYLE"),
|
|
|
|
|
rows: vec![vec![crate::modules::ToolDef {
|
|
|
|
|
id: "FIND",
|
|
|
|
|
label: "Find",
|
|
|
|
|
icon: crate::modules::IconKind::Svg(include_bytes!(
|
|
|
|
|
"../../../assets/icons/find.svg"
|
|
|
|
|
)),
|
|
|
|
|
event: crate::modules::ModuleEvent::Command("FIND".to_string()),
|
|
|
|
|
}]],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// ── Dimensions ───────────────────────────────────────────────
|
|
|
|
|
RibbonGroup {
|
|
|
|
|
title: "Dimensions",
|
|
|
|
|
tools: vec![
|
|
|
|
|
RibbonItem::LargeDropdown {
|
|
|
|
|
id: "ANNOTATE_DIM",
|
|
|
|
|
label: "Dimension",
|
|
|
|
|
icon: linear_dim::ICON,
|
|
|
|
|
items: vec![
|
|
|
|
|
(
|
|
|
|
|
linear_dim::tool().id,
|
|
|
|
|
linear_dim::tool().label,
|
|
|
|
|
linear_dim::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
(
|
|
|
|
|
aligned_dim::tool().id,
|
|
|
|
|
aligned_dim::tool().label,
|
|
|
|
|
aligned_dim::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
(
|
|
|
|
|
angular_dim::tool().id,
|
|
|
|
|
angular_dim::tool().label,
|
|
|
|
|
angular_dim::tool().icon,
|
|
|
|
|
),
|
2026-08-26 15:32:37 +03:00
|
|
|
(
|
|
|
|
|
arc_length_dim::tool().id,
|
|
|
|
|
arc_length_dim::tool().label,
|
|
|
|
|
arc_length_dim::tool().icon,
|
|
|
|
|
),
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
(
|
|
|
|
|
radius_dim::tool().id,
|
|
|
|
|
radius_dim::tool().label,
|
|
|
|
|
radius_dim::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
(
|
|
|
|
|
diameter_dim::tool().id,
|
|
|
|
|
diameter_dim::tool().label,
|
|
|
|
|
diameter_dim::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
(
|
|
|
|
|
ordinate_dim::tool().id,
|
|
|
|
|
ordinate_dim::tool().label,
|
|
|
|
|
ordinate_dim::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
(qdim::tool().id, qdim::tool().label, qdim::tool().icon),
|
|
|
|
|
],
|
|
|
|
|
default: "DIMLINEAR",
|
|
|
|
|
},
|
|
|
|
|
RibbonItem::StyleComboGroup {
|
|
|
|
|
style_key: StyleKey::DimStyle,
|
|
|
|
|
combo_id: "DIM_STYLE_COMBO",
|
|
|
|
|
manager_cmd: Some("DIMSTYLE"),
|
|
|
|
|
rows: vec![
|
|
|
|
|
vec![qdim::tool(), dim_continue::tool(), dim_baseline::tool()],
|
|
|
|
|
vec![
|
|
|
|
|
tolerance_cmd::tool(),
|
|
|
|
|
dimedit::tool(),
|
|
|
|
|
dimtedit::tool(),
|
|
|
|
|
dimbreak::tool(),
|
|
|
|
|
dimspace::tool(),
|
|
|
|
|
dimjogline::tool(),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// ── Leaders ──────────────────────────────────────────────────
|
|
|
|
|
RibbonGroup {
|
|
|
|
|
title: "Leaders",
|
|
|
|
|
tools: vec![
|
|
|
|
|
RibbonItem::LargeDropdown {
|
|
|
|
|
id: "ANNOTATE_LEADER",
|
|
|
|
|
label: "Multileader",
|
|
|
|
|
icon: mleader_cmd::ICON,
|
|
|
|
|
items: vec![
|
|
|
|
|
(
|
|
|
|
|
mleader_cmd::tool().id,
|
|
|
|
|
mleader_cmd::tool().label,
|
|
|
|
|
mleader_cmd::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
(
|
|
|
|
|
leader_cmd::tool().id,
|
|
|
|
|
leader_cmd::tool().label,
|
|
|
|
|
leader_cmd::tool().icon,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
default: "MLEADER",
|
|
|
|
|
},
|
|
|
|
|
RibbonItem::StyleComboGroup {
|
|
|
|
|
style_key: StyleKey::MLeaderStyle,
|
|
|
|
|
combo_id: "MLEADER_STYLE_COMBO",
|
|
|
|
|
manager_cmd: Some("MLEADERSTYLE"),
|
|
|
|
|
rows: vec![
|
|
|
|
|
vec![mleader_edit::tool_add(), mleader_edit::tool_remove()],
|
|
|
|
|
vec![mleader_edit::tool_align(), mleader_edit::tool_collect()],
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// ── Tables ───────────────────────────────────────────────────
|
|
|
|
|
RibbonGroup {
|
|
|
|
|
title: "Tables",
|
|
|
|
|
tools: vec![
|
|
|
|
|
RibbonItem::LargeTool(table_cmd::tool()),
|
|
|
|
|
RibbonItem::StyleComboGroup {
|
|
|
|
|
style_key: StyleKey::TableStyle,
|
|
|
|
|
combo_id: "TABLE_STYLE_COMBO",
|
|
|
|
|
manager_cmd: Some("TABLESTYLE"),
|
|
|
|
|
rows: vec![vec![data_extract::tool(), data_link::tool()]],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// ── Markup ───────────────────────────────────────────────────
|
|
|
|
|
RibbonGroup {
|
|
|
|
|
title: "Markup",
|
|
|
|
|
tools: vec![
|
|
|
|
|
RibbonItem::LargeTool(wipeout::tool()),
|
|
|
|
|
RibbonItem::LargeTool(revcloud::tool()),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
// ── Annotation Scaling ───────────────────────────────────────
|
|
|
|
|
RibbonGroup {
|
|
|
|
|
title: "Annotation Scaling",
|
|
|
|
|
tools: vec![
|
|
|
|
|
RibbonItem::Tool(crate::modules::ToolDef {
|
|
|
|
|
id: "ANNOSCALE",
|
|
|
|
|
label: "Scale List",
|
2026-05-12 10:36:15 +03:00
|
|
|
icon: crate::modules::IconKind::Svg(include_bytes!(
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
"../../../assets/icons/scale_list.svg"
|
2026-05-12 10:36:15 +03:00
|
|
|
)),
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
event: crate::modules::ModuleEvent::Command("ANNOSCALE".to_string()),
|
|
|
|
|
}),
|
|
|
|
|
RibbonItem::Tool(crate::modules::ToolDef {
|
|
|
|
|
id: "OBJECTSCALE",
|
|
|
|
|
label: "Add Scale",
|
|
|
|
|
icon: crate::modules::IconKind::Svg(include_bytes!(
|
|
|
|
|
"../../../assets/icons/add_scale.svg"
|
|
|
|
|
)),
|
2026-07-16 13:14:37 +03:00
|
|
|
// The quick "mark annotative at the current scale"
|
|
|
|
|
// action; bare OBJECTSCALE opens the manage dialog.
|
|
|
|
|
event: crate::modules::ModuleEvent::Command(
|
|
|
|
|
"OBJECTSCALE ADD".to_string(),
|
|
|
|
|
),
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
}),
|
|
|
|
|
RibbonItem::Tool(crate::modules::ToolDef {
|
|
|
|
|
id: "SCALELISTEDIT",
|
|
|
|
|
label: "Scale Edit",
|
|
|
|
|
icon: crate::modules::IconKind::Svg(include_bytes!(
|
|
|
|
|
"../../../assets/icons/scale_list.svg"
|
|
|
|
|
)),
|
|
|
|
|
event: crate::modules::ModuleEvent::Command(
|
|
|
|
|
"SCALELISTEDIT".to_string(),
|
2026-05-12 10:36:15 +03:00
|
|
|
),
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
}),
|
|
|
|
|
RibbonItem::Tool(crate::modules::ToolDef {
|
|
|
|
|
id: "SYNCPVIEWPORTS",
|
|
|
|
|
label: "Sync Scales",
|
|
|
|
|
icon: crate::modules::IconKind::Svg(include_bytes!(
|
|
|
|
|
"../../../assets/icons/sync.svg"
|
|
|
|
|
)),
|
|
|
|
|
event: crate::modules::ModuleEvent::Command(
|
|
|
|
|
"SYNCPVIEWPORTS".to_string(),
|
2026-05-12 10:36:15 +03:00
|
|
|
),
|
perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).
- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
Safe because each is a unit struct with exactly one instance per process
(plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
(&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
the &RibbonItem pattern change.
2026-07-02 20:58:48 +01:00
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
})
|
2026-03-22 14:56:27 +03:00
|
|
|
}
|
|
|
|
|
}
|