2026-03-22 14:56:27 +03:00
|
|
|
// 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;
|
Feat: ROADMAP Phase 1-5 batch — trim/extend, plot scale, viewport UX, mline caps, table alignment
- TRIM/EXTEND: Ray and XLine entities supported as cutting boundaries and trim targets;
trim results in Ray→Line/Ray, XLine→Ray/Ray or Line; hover preview added
- Plot scale override: Fit/1:1/1:2/1:5/1:10/1:20/1:50/1:100/2:1 buttons added to Page Setup
panel; PageSetupCommit applies scale to PlotSettings
- Viewport UX: locked viewport gets orange border; selected viewport gets white border
- Named view → viewport assignment: Choice dropdown in properties panel copies
view_target/direction/height to the viewport entity
- MLine caps: perpendicular start/end cap lines added for open (non-closed) MLines
- Wipeout polygon grips: boundary vertices become editable grips when clipping_enabled+Polygonal;
world→pixel back-projection on drag
- Table cell alignment: CellStyle.alignment (1-9) drives left/center/right + top/middle/bottom
text positioning; cxf::measure_text() helper added
- New commands/features: DIMCONTINUE (DCO), DIMBASELINE (DBA), TOLERANCE (TOL), TABLE,
ATTDEF, ATTEDIT, ATTDISP, BREAKATPOINT (BAP), PLOTWINDOW (PW), MLINE (ML);
DIMSTYLE/DIMCURRENT/CLAYER/LTSCALE/CELTSCALE/SCALETEXT/XDATA/UCSICON/REGEN/DRAWORDER extended
- PLINE arc mode: A/L/CLOSE text input, bulge computation, arc preview
- Warning cleanup: removed unused imports and unreachable patterns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 15:31:05 +03:00
|
|
|
pub mod plot_window;
|
2026-04-02 23:28:00 +03:00
|
|
|
pub mod zoom_window;
|
2026-03-22 14:56:27 +03:00
|
|
|
|
|
|
|
|
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(),
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|