73 lines
2.5 KiB
Rust
73 lines
2.5 KiB
Rust
|
|
// Annotate module — dimension and text annotation tools.
|
||
|
|
|
||
|
|
pub mod angular_dim;
|
||
|
|
pub mod leader_cmd;
|
||
|
|
pub mod linear_dim;
|
||
|
|
pub mod mleader_cmd;
|
||
|
|
pub mod mtext;
|
||
|
|
pub mod radius_dim;
|
||
|
|
pub mod text;
|
||
|
|
|
||
|
|
use crate::modules::{CadModule, RibbonGroup, RibbonItem};
|
||
|
|
|
||
|
|
pub struct AnnotateModule;
|
||
|
|
|
||
|
|
impl CadModule for AnnotateModule {
|
||
|
|
fn id(&self) -> &'static str {
|
||
|
|
"annotate"
|
||
|
|
}
|
||
|
|
fn title(&self) -> &'static str {
|
||
|
|
"Annotate"
|
||
|
|
}
|
||
|
|
|
||
|
|
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
|
||
|
|
vec![
|
||
|
|
RibbonGroup {
|
||
|
|
title: "Text",
|
||
|
|
tools: vec![
|
||
|
|
RibbonItem::LargeDropdown {
|
||
|
|
id: "ANNOTATE_TEXT",
|
||
|
|
label: "Text",
|
||
|
|
icon: text::ICON,
|
||
|
|
items: vec![
|
||
|
|
(text::tool().id, text::tool().label, text::tool().icon),
|
||
|
|
(mtext::tool().id, mtext::tool().label, mtext::tool().icon),
|
||
|
|
],
|
||
|
|
default: "TEXT",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
RibbonGroup {
|
||
|
|
title: "Dimensions",
|
||
|
|
tools: vec![
|
||
|
|
RibbonItem::LargeDropdown {
|
||
|
|
id: "ANNOTATE_DIM",
|
||
|
|
label: "Dimensions",
|
||
|
|
icon: linear_dim::ICON,
|
||
|
|
items: vec![
|
||
|
|
(linear_dim::tool().id, linear_dim::tool().label, linear_dim::tool().icon),
|
||
|
|
(radius_dim::tool().id, radius_dim::tool().label, radius_dim::tool().icon),
|
||
|
|
(angular_dim::tool().id, angular_dim::tool().label, angular_dim::tool().icon),
|
||
|
|
],
|
||
|
|
default: "DIMLINEAR",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
RibbonGroup {
|
||
|
|
title: "Leaders",
|
||
|
|
tools: vec![
|
||
|
|
RibbonItem::LargeDropdown {
|
||
|
|
id: "ANNOTATE_LEADER",
|
||
|
|
label: "Leader",
|
||
|
|
icon: leader_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",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|