forked from 1b-agent/opencadstudio-upstream
feat(annotate): expose annotation panel tools
This commit is contained in:
1 parent
666b28ffe3
commit
768eaf5b2d
4 files changed
+216
-1
No files matched your search
@@ -42,7 +42,7 @@ impl CadModule for AnnotateModule {
|
||||
}
|
||||
|
||||
fn ribbon_groups(&self) -> &[RibbonGroup] {
|
||||
use crate::modules::draw::draw::{revcloud, wipeout};
|
||||
use crate::modules::draw::draw::{centerline, dimcenter, revcloud, wipeout};
|
||||
|
||||
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
||||
GROUPS.get_or_init(|| {
|
||||
@@ -148,6 +148,44 @@ impl CadModule for AnnotateModule {
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Centerlines ───────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Centerlines",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(dimcenter::tool()),
|
||||
RibbonItem::LargeTool(centerline::tool()),
|
||||
RibbonItem::Dropdown {
|
||||
id: "ANNOTATE_CENTER_ASSOCIATIVITY",
|
||||
icon: crate::modules::IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/line.svg"
|
||||
)),
|
||||
items: vec![
|
||||
(
|
||||
"CENTERREASSOCIATE",
|
||||
"Reassociate Center Object",
|
||||
crate::modules::IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/line.svg"
|
||||
)),
|
||||
),
|
||||
(
|
||||
"CENTERDISASSOCIATE",
|
||||
"Disassociate Center Object",
|
||||
crate::modules::IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/line.svg"
|
||||
)),
|
||||
),
|
||||
(
|
||||
"CENTERRESET",
|
||||
"Reset Center Object",
|
||||
crate::modules::IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/line.svg"
|
||||
)),
|
||||
),
|
||||
],
|
||||
default: "CENTERREASSOCIATE",
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Leaders ──────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Leaders",
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
//! Additional annotation tools reached from the Draw tab's Annotation panel title.
|
||||
|
||||
use super::draw_panel::Tool;
|
||||
|
||||
pub(super) const TOOLS: &[Tool] = &[
|
||||
Tool {
|
||||
command: "DDEDIT",
|
||||
label: "Edit Text",
|
||||
icon: include_bytes!("../../../assets/icons/ddedit.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "TOLERANCE",
|
||||
label: "Geometric Tolerance",
|
||||
icon: include_bytes!("../../../assets/icons/tolerance.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMALIGNED",
|
||||
label: "Aligned Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_aligned.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMARC",
|
||||
label: "Arc Length Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_angular.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMJOGGED",
|
||||
label: "Jogged Radius Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_jog.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMDIAMETER",
|
||||
label: "Diameter Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_diameter.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMORDINATE",
|
||||
label: "Ordinate Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_ordinate.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "QDIM",
|
||||
label: "Quick Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/qdim.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMCONTINUE",
|
||||
label: "Continue Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_continue.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMBASELINE",
|
||||
label: "Baseline Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_baseline.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMBREAK",
|
||||
label: "Dimension Break",
|
||||
icon: include_bytes!("../../../assets/icons/dim_break.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMEDIT",
|
||||
label: "Edit Dimension",
|
||||
icon: include_bytes!("../../../assets/icons/dim_edit.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMTEDIT",
|
||||
label: "Edit Dimension Text",
|
||||
icon: include_bytes!("../../../assets/icons/dim_tedit.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMSPACE",
|
||||
label: "Adjust Dimension Space",
|
||||
icon: include_bytes!("../../../assets/icons/dim_space.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "DIMJOGLINE",
|
||||
label: "Add or Remove Jog Line",
|
||||
icon: include_bytes!("../../../assets/icons/dim_jog.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "MLEADERADD",
|
||||
label: "Add Leader",
|
||||
icon: include_bytes!("../../../assets/icons/mleader_add.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "MLEADERREMOVE",
|
||||
label: "Remove Leader",
|
||||
icon: include_bytes!("../../../assets/icons/mleader_remove.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "MLEADERALIGN",
|
||||
label: "Align Leaders",
|
||||
icon: include_bytes!("../../../assets/icons/mleader_align.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "MLEADERCOLLECT",
|
||||
label: "Collect Leaders",
|
||||
icon: include_bytes!("../../../assets/icons/mleader_collect.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "WIPEOUT",
|
||||
label: "Wipeout",
|
||||
icon: include_bytes!("../../../assets/icons/wipeout.svg"),
|
||||
options: &[],
|
||||
},
|
||||
Tool {
|
||||
command: "TABLE",
|
||||
label: "Table and Data",
|
||||
icon: include_bytes!("../../../assets/icons/table.svg"),
|
||||
options: &[
|
||||
("TABLE", "Table"),
|
||||
("DATALINK", "Link Data"),
|
||||
("DATAEXTRACTION", "Extract Data"),
|
||||
],
|
||||
},
|
||||
Tool {
|
||||
command: "CENTERMARK",
|
||||
label: "Center Mark and Line",
|
||||
icon: include_bytes!("../../../assets/icons/line.svg"),
|
||||
options: &[
|
||||
("CENTERMARK", "Center Mark"),
|
||||
("CENTERLINE", "Center Line"),
|
||||
("CENTERREASSOCIATE", "Reassociate Center Object"),
|
||||
("CENTERDISASSOCIATE", "Disassociate Center Object"),
|
||||
("CENTERRESET", "Reset Center Object"),
|
||||
],
|
||||
},
|
||||
Tool {
|
||||
command: "REVCLOUD",
|
||||
label: "Revision Cloud",
|
||||
icon: include_bytes!("../../../assets/icons/revcloud.svg"),
|
||||
options: &[
|
||||
("REVCLOUD_RECTANGULAR", "Rectangular"),
|
||||
("REVCLOUD_POLYGONAL", "Polygonal"),
|
||||
("REVCLOUD_FREEHAND", "Freehand"),
|
||||
],
|
||||
},
|
||||
Tool {
|
||||
command: "OBJECTSCALE",
|
||||
label: "Annotation Scales",
|
||||
icon: include_bytes!("../../../assets/icons/add_scale.svg"),
|
||||
options: &[
|
||||
("OBJECTSCALE ADD", "Add Current Scale"),
|
||||
("OBJECTSCALE DELETE", "Delete Current Scale"),
|
||||
("OBJECTSCALE", "Add or Delete Scales"),
|
||||
("SCALELISTEDIT", "Edit Scale List"),
|
||||
("ANNORESET", "Sync Scale Positions"),
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -140,6 +140,12 @@ const PANELS: &[Panel] = &[
|
||||
title: "Modify",
|
||||
tools: super::modify_panel::TOOLS,
|
||||
},
|
||||
Panel {
|
||||
id: "annotation_extension",
|
||||
title_id: "annotation_extension_title",
|
||||
title: "Annotation",
|
||||
tools: super::annotation_panel::TOOLS,
|
||||
},
|
||||
];
|
||||
|
||||
fn panel_for_dropdown(id: &str) -> Option<Panel> {
|
||||
|
||||
@@ -21,6 +21,7 @@ use crate::plugin::all_ribbon_modules;
|
||||
use crate::ui::properties::{linetype_display_name, lw_options, LinetypeItem};
|
||||
|
||||
mod widgets;
|
||||
mod annotation_panel;
|
||||
mod draw_panel;
|
||||
mod modify_panel;
|
||||
use widgets::{StyleContext, *};
|
||||
|
||||
Reference in new issue
Block a user