forked from 1b-agent/opencadstudio-upstream
first commit
This commit is contained in:
1 parent
d52c6440ff
commit
d2fdac7f1e
274 files changed
+89330
No files matched your search
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "HIDDENLINE",
|
||||
label: "Hidden",
|
||||
icon: IconKind::Glyph("◫"),
|
||||
event: ModuleEvent::Command("HIDDENLINE".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// View module — navigation, visual styles, and viewport presets.
|
||||
|
||||
mod hidden;
|
||||
mod orbit;
|
||||
mod ortho;
|
||||
mod pan;
|
||||
mod persp;
|
||||
mod solid;
|
||||
mod view_front;
|
||||
mod view_iso;
|
||||
mod view_right;
|
||||
mod view_top;
|
||||
mod wireframe;
|
||||
mod xray;
|
||||
mod zoom_ext;
|
||||
mod zoom_in;
|
||||
mod zoom_out;
|
||||
|
||||
use crate::modules::{CadModule, RibbonGroup};
|
||||
|
||||
pub struct ViewModule;
|
||||
|
||||
impl CadModule for ViewModule {
|
||||
fn id(&self) -> &'static str {
|
||||
"view"
|
||||
}
|
||||
fn title(&self) -> &'static str {
|
||||
"View"
|
||||
}
|
||||
|
||||
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
|
||||
vec![
|
||||
RibbonGroup {
|
||||
title: "Navigate",
|
||||
tools: vec![
|
||||
zoom_ext::tool().into(),
|
||||
zoom_in::tool().into(),
|
||||
zoom_out::tool().into(),
|
||||
pan::tool().into(),
|
||||
orbit::tool().into(),
|
||||
],
|
||||
},
|
||||
RibbonGroup {
|
||||
// WIREFRAME and SOLID ids are special-cased in ribbon.rs
|
||||
// for toggle-state highlighting based on Ribbon::wireframe.
|
||||
title: "Visual Style",
|
||||
tools: vec![
|
||||
wireframe::tool().into(),
|
||||
solid::tool().into(),
|
||||
hidden::tool().into(),
|
||||
xray::tool().into(),
|
||||
],
|
||||
},
|
||||
RibbonGroup {
|
||||
// ORTHO and PERSP ids are special-cased in ribbon.rs
|
||||
// for toggle-state highlighting based on Camera::projection.
|
||||
title: "Projection",
|
||||
tools: vec![ortho::tool().into(), persp::tool().into()],
|
||||
},
|
||||
RibbonGroup {
|
||||
title: "Preset",
|
||||
tools: vec![
|
||||
view_top::tool().into(),
|
||||
view_front::tool().into(),
|
||||
view_right::tool().into(),
|
||||
view_iso::tool().into(),
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "3DORBIT",
|
||||
label: "3D Orbit",
|
||||
icon: IconKind::Glyph("⟳"),
|
||||
event: ModuleEvent::Command("3DORBIT".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "ORTHO",
|
||||
label: "Ortho",
|
||||
icon: IconKind::Glyph("⊡"),
|
||||
event: ModuleEvent::Command("ORTHO".into()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "PAN",
|
||||
label: "Pan",
|
||||
icon: IconKind::Glyph("✥"),
|
||||
event: ModuleEvent::Command("PAN".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "PERSP",
|
||||
label: "Persp",
|
||||
icon: IconKind::Glyph("⟁"),
|
||||
event: ModuleEvent::Command("PERSP".into()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Solid (Shaded) visual style toggle.
|
||||
// id "SOLID" is special-cased in ribbon.rs for active-state highlighting.
|
||||
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "SOLID",
|
||||
label: "Solid",
|
||||
icon: IconKind::Glyph("■"),
|
||||
event: ModuleEvent::SetWireframe(false),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "VIEW_FRONT",
|
||||
label: "Front",
|
||||
icon: IconKind::Glyph("⊥"),
|
||||
event: ModuleEvent::Command("VIEW FRONT".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "VIEW_ISO",
|
||||
label: "Iso",
|
||||
icon: IconKind::Glyph("◈"),
|
||||
event: ModuleEvent::Command("VIEW ISO".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "VIEW_RIGHT",
|
||||
label: "Right",
|
||||
icon: IconKind::Glyph("⊣"),
|
||||
event: ModuleEvent::Command("VIEW RIGHT".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "VIEW_TOP",
|
||||
label: "Top",
|
||||
icon: IconKind::Glyph("⊤"),
|
||||
event: ModuleEvent::Command("VIEW TOP".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Wireframe visual style toggle.
|
||||
// id "WIREFRAME" is special-cased in ribbon.rs for active-state highlighting.
|
||||
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "WIREFRAME",
|
||||
label: "Wireframe",
|
||||
icon: IconKind::Glyph("□"),
|
||||
event: ModuleEvent::SetWireframe(true),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "XRAY",
|
||||
label: "X-Ray",
|
||||
icon: IconKind::Glyph("◈"),
|
||||
event: ModuleEvent::Command("XRAY".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "ZOOM_EXT",
|
||||
label: "Zoom Ext",
|
||||
icon: IconKind::Glyph("⊡"),
|
||||
event: ModuleEvent::Command("ZOOM EXTENTS".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "ZOOM_IN",
|
||||
label: "Zoom In",
|
||||
icon: IconKind::Glyph("🔍"),
|
||||
event: ModuleEvent::Command("ZOOM IN".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "ZOOM_OUT",
|
||||
label: "Zoom Out",
|
||||
icon: IconKind::Glyph("🔎"),
|
||||
event: ModuleEvent::Command("ZOOM OUT".to_string()),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user