forked from 1b-agent/opencadstudio-upstream
feat: plot a model-space window to PDF
Pick a rectangular window in model space with the existing PLOTWINDOW command (now enabled in model space, previously paper-space only) and export it to a PDF at a chosen ISO paper size (A4-A0), orientation and scale (fit or ratio). The window is a hard clip boundary. Adds paper-size presets, a window-to-sheet transform, scale + clip support in the PDF exporter, and Page Setup controls (format/orientation/pick window).
This commit is contained in:
1 parent
ced42daff5
commit
363593b09f
13 files changed
+444
-24
No files matched your search
+14
-1
@@ -33,7 +33,7 @@ mod zoom_in;
|
||||
mod zoom_out;
|
||||
pub mod zoom_window;
|
||||
|
||||
use crate::modules::{CadModule, RibbonGroup, RibbonItem};
|
||||
use crate::modules::{CadModule, IconKind, ModuleEvent, RibbonGroup, RibbonItem, ToolDef};
|
||||
|
||||
pub struct ViewModule;
|
||||
|
||||
@@ -137,6 +137,19 @@ impl CadModule for ViewModule {
|
||||
RibbonItem::Tool(cascade::tool()),
|
||||
],
|
||||
},
|
||||
// ── Plot ──────────────────────────────────────────────────────────
|
||||
// Model space has no paper-space side toolbar, so Page Setup
|
||||
// (format/orientation/pick window for PLOTWINDOW) needs an
|
||||
// entry here too.
|
||||
RibbonGroup {
|
||||
title: "Plot",
|
||||
tools: vec![RibbonItem::Tool(ToolDef {
|
||||
id: "PAGESETUP",
|
||||
label: "Page Setup",
|
||||
icon: IconKind::Svg(include_bytes!("../../../assets/icons/pagesetup.svg")),
|
||||
event: ModuleEvent::Command("PAGESETUP".to_string()),
|
||||
})],
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// PLOTWINDOW command — pick two corners to define the plot window area.
|
||||
//
|
||||
// Works only in paper space layouts. After picking P1 and P2, writes the
|
||||
// window to the layout's PlotSettings (PlotType::Window).
|
||||
// In paper space it writes the layout's PlotSettings (PlotType::Window); in
|
||||
// model space the host stores the window for the plot dialog.
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
Reference in new issue
Block a user