mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-06 23:31:19 +00:00
Open the Design tab on a front-right isometric view
This commit is contained in:
@@ -303,7 +303,8 @@ The tab is a page of Orca's main window and answers to the same settings as Prep
|
||||
not need it either, since the committed object is placed on an empty spot of the current
|
||||
plate. What the canvas does read from the plate is moved onto its bed: the exclude areas, the
|
||||
plate box the camera orbits about when nothing is picked (`GLCanvas3D::_current_plate_box`),
|
||||
and the first view, which starts as a copy of Prepare's camera.
|
||||
and the first view, which starts from Prepare's camera turned to the tab's iso view: the CAD
|
||||
isometric from the front-right corner that Home returns to, not Prepare's front-left one.
|
||||
- **Viewport text.** The status line and the active tool's values are drawn by the canvas in
|
||||
its ImGui pass, so they go with the canvas: a top-level window over GL does not follow its
|
||||
frame and was left floating over other applications.
|
||||
|
||||
@@ -59,6 +59,16 @@ extern wxPopupWindow* wxCurrentPopupWindow;
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
// The Design tab's iso view is the CAD one: a true isometric from the front-right corner, which
|
||||
// shows the navigator's Front, Right and Top faces. Camera's own "iso" looks from the front-left
|
||||
// at 45 degrees and stays Prepare's and the thumbnails'.
|
||||
static void select_iso_view(Camera& camera)
|
||||
{
|
||||
const Vec3d target = camera.get_target();
|
||||
camera.look_at(target + camera.get_distance() * Vec3d(1., -1., 1.).normalized(), target, Vec3d::UnitZ());
|
||||
camera.auto_type(Camera::EType::Perspective);
|
||||
}
|
||||
|
||||
DesignCanvas::DesignCanvas(wxWindow* parent)
|
||||
: wxPanel()
|
||||
{
|
||||
@@ -192,10 +202,12 @@ DesignCanvas::DesignCanvas(wxWindow* parent)
|
||||
|
||||
// The view this canvas opens on. Built lazily, on the way into the Design tab, so this
|
||||
// is the view the user is looking at right now — moved off the current plate onto the
|
||||
// Design bed, which stays at the printer bed's home whichever plate is current.
|
||||
// Design bed, which stays at the printer bed's home whichever plate is current — turned to
|
||||
// the iso view Home returns to, keeping its target and zoom.
|
||||
m_parked_camera = wxGetApp().plater()->get_camera();
|
||||
if (PartPlate* plate = wxGetApp().plater()->get_partplate_list().get_curr_plate())
|
||||
m_parked_camera.translate_world(-plate->get_origin());
|
||||
select_iso_view(m_parked_camera);
|
||||
|
||||
// Before any of this class's own Binds below: wx calls dynamically bound handlers in
|
||||
// reverse order of binding, and GLCanvas3D swallows several events without skipping them —
|
||||
@@ -470,7 +482,10 @@ bool DesignCanvas::zoom_to_box(BoundingBoxf3 box)
|
||||
void DesignCanvas::set_view(const std::string& view_name)
|
||||
{
|
||||
if (m_canvas) {
|
||||
m_canvas->select_view(view_name);
|
||||
if (view_name == "iso")
|
||||
select_iso_view(wxGetApp().plater()->get_camera()); // the Design camera while the tab is shown
|
||||
else
|
||||
m_canvas->select_view(view_name);
|
||||
m_canvas->zoom_to_volumes();
|
||||
m_canvas->set_as_dirty();
|
||||
if (m_canvas_widget)
|
||||
|
||||
Reference in New Issue
Block a user