Add plugin host architecture and Storm Sewer add-on package

Generic plugin runtime (src/plugin/, HostSession, per-tab plugin_state, command router). QGIS-style add-on layout with plugin.toml and single PluginRegistration. Storm Sewer refactored as reference consumer with dispatch.rs, catchments, LandXML, headless tests (43 passing). Core update.rs decoupled from storm_sewer via CadCommand object-pick hooks. Docs: plugin-architecture.md, plugin-template, PR and issue-78 reply drafts.
This commit is contained in:
Michael Flynn committed 2026-06-09 13:41:21 -04:00
1 parent 1199895f0e
commit e46701456f
66 files changed
+4538 -141

No files matched your search

+27 -8
View File
@@ -500,18 +500,37 @@ impl canvas::Program<Message> for SelectionCanvas {
// ── Snap marker ───────────────────────────────────────────────────
if let Some((sp, snap_type)) = self.snap {
let yellow = Color {
r: 1.0,
g: 0.9,
b: 0.1,
a: 1.0,
let (r, g, b) = if snap_type == SnapType::ObjectPick {
(0.95_f32, 0.50, 0.08) // C3D-style orange object snap
} else {
(1.0, 0.9, 0.1) // classic yellow OSNAP
};
let marker = Color { r, g, b, a: 1.0 };
let stroke = canvas::Stroke {
width: 1.5,
style: canvas::Style::Solid(yellow),
width: if snap_type == SnapType::ObjectPick { 2.0 } else { 1.5 },
style: canvas::Style::Solid(marker),
..Default::default()
};
match snap_type {
SnapType::ObjectPick => {
// Target box + center dot (Civil 3D acquisition glyph).
let h = 7.0_f32;
let rect = canvas::Path::rectangle(
Point::new(sp.x - h, sp.y - h),
Size::new(h * 2.0, h * 2.0),
);
frame.stroke(&rect, stroke.clone());
let r = 3.0_f32;
frame.fill(
&canvas::Path::circle(sp, r),
Color {
r: 0.95,
g: 0.50,
b: 0.08,
a: 0.85,
},
);
}
SnapType::Endpoint => {
let h = 5.0_f32;
let rect = canvas::Path::rectangle(
@@ -655,7 +674,7 @@ impl canvas::Program<Message> for SelectionCanvas {
let r = 1.4_f32;
for k in [-7.0_f32, 0.0, 7.0] {
let dot = canvas::Path::circle(Point::new(sp.x + k, sp.y), r);
frame.fill(&dot, yellow);
frame.fill(&dot, marker);
}
}
SnapType::Parallel => {
+2 -2
View File
@@ -13,8 +13,8 @@ use iced::widget::{button, column, container, mouse_area, row, scrollable, svg,
use iced::{Background, Border, Color, Element, Fill, Length, Padding, Theme};
use crate::app::Message;
use crate::modules::registry;
use crate::modules::{CadModule, IconKind, RibbonItem};
use crate::plugin::all_ribbon_modules;
use crate::ui::properties::{color_picker_dropdown, lw_options, LinetypeItem};
mod widgets;
@@ -67,7 +67,7 @@ pub struct LayerInfo {
impl Ribbon {
pub fn new() -> Self {
Self {
modules: registry::all_modules(),
modules: all_ribbon_modules(),
active: 0,
active_tool: None,
wireframe: false,