forked from 1b-agent/opencadstudio-upstream
feat: redesign Insert tab and fix all warnings
- Redesign Insert ribbon tab with 6 groups matching screenshot layout: Reference (Attach/Clip/Adjust large + Underlay Layers/Frames/Snap small), Point Cloud (Attach), Block (Multi-View Block/Insert large + Create/Edit/Base small), Attributes (Define/Edit large + Manage/Sync small), Import (Import/Land XML), Content (Content Browser/Design Center) - Remove Primitives group and dead box_prim/clear/cylinder/sphere modules - Fix all compiler warnings with #[allow(dead_code)] on unused-but-intentional items Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
e3bce16545
commit
ef988c20a3
38 files changed
+357
-18
No files matched your search
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/attdef.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "ATTDEF", label: "Define\nAttributes", icon: ICON, event: ModuleEvent::Command("ATTDEF".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/attedit.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "ATTEDIT", label: "Edit\nAttribute", icon: ICON, event: ModuleEvent::Command("ATTEDIT".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/attman.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "ATTMAN", label: "Manage", icon: ICON, event: ModuleEvent::Command("ATTMAN".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/attsync.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "ATTSYNC", label: "Synchronize", icon: ICON, event: ModuleEvent::Command("ATTSYNC".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/base_point.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "BASE", label: "Set Base\nPoint", icon: ICON, event: ModuleEvent::Command("BASE".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/content_browser.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "CONTENTBROWSER", label: "Content\nBrowser", icon: ICON, event: ModuleEvent::Command("CONTENTBROWSER".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/design_center.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "ADCENTER", label: "Design\nCenter", icon: ICON, event: ModuleEvent::Command("ADCENTER".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/edit_block.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "BEDIT", label: "Edit Block", icon: ICON, event: ModuleEvent::Command("BEDIT".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/landxml.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "LANDXMLIMPORT", label: "Land\nXML", icon: ICON, event: ModuleEvent::Command("LANDXMLIMPORT".to_string()) }
|
||||
}
|
||||
+74
-18
@@ -1,17 +1,29 @@
|
||||
// Insert module — file import, solid primitives, and blocks.
|
||||
// Insert module — references, point clouds, blocks, attributes, import, content.
|
||||
|
||||
mod box_prim;
|
||||
mod clear;
|
||||
mod attdef;
|
||||
mod attedit;
|
||||
mod attman;
|
||||
mod attsync;
|
||||
mod base_point;
|
||||
pub(crate) mod create_block;
|
||||
mod cylinder;
|
||||
mod content_browser;
|
||||
mod design_center;
|
||||
mod edit_block;
|
||||
pub(crate) mod insert_block;
|
||||
mod landxml;
|
||||
mod mview_block;
|
||||
mod open_obj;
|
||||
mod pc_attach;
|
||||
mod snap_underlays;
|
||||
pub(crate) mod solid3d_cmds;
|
||||
mod sphere;
|
||||
mod underlay_frames;
|
||||
mod underlay_layers;
|
||||
pub(crate) mod wblock;
|
||||
pub(crate) mod xattach;
|
||||
mod xadjust;
|
||||
mod xclip;
|
||||
|
||||
use crate::modules::{CadModule, RibbonGroup};
|
||||
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem};
|
||||
|
||||
pub struct InsertModule;
|
||||
|
||||
@@ -25,25 +37,69 @@ impl CadModule for InsertModule {
|
||||
|
||||
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
|
||||
vec![
|
||||
// ── Reference ────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Import",
|
||||
tools: vec![open_obj::tool().into(), clear::tool().into()],
|
||||
},
|
||||
RibbonGroup {
|
||||
title: "Primitives",
|
||||
title: "Reference",
|
||||
tools: vec![
|
||||
box_prim::tool().into(),
|
||||
sphere::tool().into(),
|
||||
cylinder::tool().into(),
|
||||
RibbonItem::LargeTool(xattach::tool()),
|
||||
RibbonItem::LargeTool(xclip::tool()),
|
||||
RibbonItem::LargeTool(xadjust::tool()),
|
||||
RibbonItem::Tool(underlay_layers::tool()),
|
||||
RibbonItem::Dropdown {
|
||||
id: "FRAMES_DROPDOWN",
|
||||
icon: IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg")),
|
||||
items: vec![
|
||||
("FRAMES0", "Frames Off", IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"))),
|
||||
("FRAMES1", "Frames On", IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"))),
|
||||
("FRAMES2", "Frames & Print",IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"))),
|
||||
],
|
||||
default: "FRAMES1",
|
||||
},
|
||||
RibbonItem::Tool(snap_underlays::tool()),
|
||||
],
|
||||
},
|
||||
// ── Point Cloud ───────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Point Cloud",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(pc_attach::tool()),
|
||||
],
|
||||
},
|
||||
// ── Block ─────────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Block",
|
||||
tools: vec![
|
||||
create_block::tool().into(),
|
||||
insert_block::tool().into(),
|
||||
wblock::tool().into(),
|
||||
xattach::tool().into(),
|
||||
RibbonItem::LargeTool(mview_block::tool()),
|
||||
RibbonItem::LargeTool(insert_block::tool()),
|
||||
RibbonItem::Tool(create_block::tool()),
|
||||
RibbonItem::Tool(edit_block::tool()),
|
||||
RibbonItem::Tool(base_point::tool()),
|
||||
],
|
||||
},
|
||||
// ── Attributes ────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Attributes",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(attdef::tool()),
|
||||
RibbonItem::LargeTool(attedit::tool()),
|
||||
RibbonItem::Tool(attman::tool()),
|
||||
RibbonItem::Tool(attsync::tool()),
|
||||
],
|
||||
},
|
||||
// ── Import ────────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Import",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(open_obj::tool()),
|
||||
RibbonItem::LargeTool(landxml::tool()),
|
||||
],
|
||||
},
|
||||
// ── Content ───────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Content",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(content_browser::tool()),
|
||||
RibbonItem::LargeTool(design_center::tool()),
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/mview_block.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "BLOCKPALETTE", label: "Multi-View\nBlock", icon: ICON, event: ModuleEvent::Command("BLOCKPALETTE".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/pc_attach.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "POINTCLOUDATTACH", label: "Attach", icon: ICON, event: ModuleEvent::Command("POINTCLOUDATTACH".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/recap.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "RECAP", label: "Autodesk\nReCap", icon: ICON, event: ModuleEvent::Command("RECAP".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/snap_underlays.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "UOSNAP", label: "Snap to\nUnderlays", icon: ICON, event: ModuleEvent::Command("UOSNAP".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
#[allow(dead_code)]
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"));
|
||||
#[allow(dead_code)]
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "FRAMES", label: "Frames", icon: ICON, event: ModuleEvent::Command("FRAMES".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/underlay_layers.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "UNDERLAYLAYERS", label: "Underlay\nLayers", icon: ICON, event: ModuleEvent::Command("UNDERLAYLAYERS".to_string()) }
|
||||
}
|
||||
@@ -8,6 +8,7 @@ use acadrust::{CadDocument, EntityType};
|
||||
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "WBLOCK",
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/xadjust.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "ADJUST", label: "Adjust", icon: ICON, event: ModuleEvent::Command("ADJUST".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/xclip.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "XCLIP", label: "Clip", icon: ICON, event: ModuleEvent::Command("XCLIP".to_string()) }
|
||||
}
|
||||
Reference in new issue
Block a user