feat(view): -VIEW orthographic UCS, sEttings and Window like the reference

An orthographic preset sets its orthographic UCS while UCSORTHO is on
(*FRONT*, *RIGHT*, …; TOP returns to the world UCS); presets no longer
flip to the opposite view when repeated. -VIEW runs as its own command:
Window asks for the name and corners, sEttings loops over Background,
Categorize, Layer snapshot, live Section, Ucs and Visual style with the
reference prompts and messages, Save keeps the UCS with the view while
UCSVIEW is on and Restore brings it back. UCSORTHO and UCSVIEW are
profile variables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-09 09:07:05 +03:00
1 parent 62ff1daade
commit cfe64ae6a4
10 files changed
+945 -127

No files matched your search

+4
View File
@@ -681,6 +681,8 @@ impl OpenCADStudio {
attdef_on_screen: crate::modules::draw::draw::attdef::session().on_screen,
field_display: crate::entities::field::display(),
surface_associativity: crate::scene::model::sweep_model::surface_associativity(),
ucs_ortho: crate::modules::view::view_cmd::ucs_ortho(),
ucs_view: crate::modules::view::view_cmd::ucs_view(),
ncopy_bind: self.ncopy_bind,
cursor_type: self.cursor_type,
crosshair_color: self.crosshair_color,
@@ -793,6 +795,8 @@ impl OpenCADStudio {
crate::modules::draw::draw::attdef::session().on_screen = s.attdef_on_screen;
crate::entities::field::set_display(s.field_display);
crate::scene::model::sweep_model::set_surface_associativity(s.surface_associativity);
crate::modules::view::view_cmd::set_ucs_ortho(s.ucs_ortho);
crate::modules::view::view_cmd::set_ucs_view(s.ucs_view);
self.ncopy_bind = s.ncopy_bind;
self.cursor_type = s.cursor_type;
self.crosshair_color = s.crosshair_color;
+17 -5
View File
@@ -5912,15 +5912,25 @@ properties={:.1}ms picked={}",
}
fn snap_view_region(&mut self, region: CubeRegion, r_ucs: glam::Mat4) -> Task<Message> {
self.snap_view_region_as(region, r_ucs, true)
}
/// A standard view preset (-VIEW): the world view itself, kept when it
/// is shown already, with no cube message.
pub(in crate::app) fn snap_view_preset(&mut self, region: CubeRegion) -> Task<Message> {
self.snap_view_region_as(region, glam::Mat4::IDENTITY, false)
}
fn snap_view_region_as(&mut self, region: CubeRegion, r_ucs: glam::Mat4, cube: bool) -> Task<Message> {
let i = self.active_tab;
self.clear_navigation_hover(i);
self.tabs[i].scene.remember_current_view();
let mut region = region;
// "Already there → flip to opposite" check: compare the
// current gaze direction with the region's target gaze.
// "Already there → flip to opposite" check for a cube click: compare
// the current gaze direction with the region's target gaze.
let target_dir = r_ucs.transform_vector3(region.snap_direction());
let cur_dir = self.tabs[i].scene.active_gaze_dir();
if cur_dir.dot(target_dir) > 0.9999 {
if cube && cur_dir.dot(target_dir) > 0.9999 {
region = region.opposite();
}
let eye_dir = r_ucs.transform_vector3(region.snap_direction());
@@ -5950,8 +5960,10 @@ properties={:.1}ms picked={}",
}
}
self.tabs[i].scene.camera_generation += 1;
self.command_line
.push_output(crate::tf!("View: {}", crate::t!(region.label())).as_ref());
if cube {
self.command_line
.push_output(crate::tf!("View: {}", crate::t!(region.label())).as_ref());
}
Task::none()
}