From 747807224b3dce9360118d1bf72a461615a84b5c Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 6 Oct 2021 23:17:45 +0200 Subject: [PATCH] 2.5d view enhancements * Fine-tuned 2.5d view's key events * better error message in case of z-stack/layers mismatch * Don't confine bounding box to actual layout - that can be confusing --- src/plugins/tools/view_25d/lay_plugin/layD25View.cc | 2 +- .../tools/view_25d/lay_plugin/layD25ViewWidget.cc | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25View.cc b/src/plugins/tools/view_25d/lay_plugin/layD25View.cc index 0055a43cf..603136699 100644 --- a/src/plugins/tools/view_25d/lay_plugin/layD25View.cc +++ b/src/plugins/tools/view_25d/lay_plugin/layD25View.cc @@ -203,7 +203,7 @@ D25View::activated () bool any = mp_ui->d25_view->attach_view (view ()); if (! any) { mp_ui->d25_view->attach_view (0); - throw tl::Exception (tl::to_string (tr ("No z data configured for the layers in the view.\nUse \"Tools/Manage Technologies\" to set up a z stack."))); + throw tl::Exception (tl::to_string (tr ("No z data configured for the layers in this view.\nUse \"Tools/Manage Technologies\" to set up a z stack or check if it applies to the layers here."))); } mp_ui->d25_view->reset (); diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc index f83b57214..3eb97dfee 100644 --- a/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc +++ b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc @@ -311,13 +311,13 @@ D25ViewWidget::keyPressEvent (QKeyEvent *event) // Move "into" or "out" - double d = (event->key () == Qt::Key_Up ? 0.1 : -0.1); + double d = (event->key () == Qt::Key_Up ? 0.05 : -0.05); QMatrix4x4 t; t.rotate (cam_azimuth (), 0.0, 1.0, 0.0); QVector3D cd = t.inverted ().map (QVector3D (0, 0, cam_dist ())); - set_displacement (displacement () + d * cd); + set_displacement (displacement () + d * cd / m_scale_factor); } @@ -327,7 +327,7 @@ D25ViewWidget::keyPressEvent (QKeyEvent *event) // Ctrl + left/right changes azimuths - double d = (event->key () == Qt::Key_Right ? 2 : -2); + double d = (event->key () == Qt::Key_Right ? 1 : -1); double a = cam_azimuth () + d; if (a < -180.0) { @@ -348,7 +348,7 @@ D25ViewWidget::keyPressEvent (QKeyEvent *event) t.rotate (cam_azimuth (), 0.0, 1.0, 0.0); QVector3D cd = t.inverted ().map (QVector3D (cam_dist (), 0, 0)); - set_displacement (displacement () + d * cd); + set_displacement (displacement () + d * cd / m_scale_factor); } @@ -634,11 +634,6 @@ D25ViewWidget::prepare_view () } - m_bbox &= cell_bbox; - if (m_bbox.empty ()) { - return false; - } - bool any = false; tl::AbsoluteProgress progress (tl::to_string (tr ("Rendering ...")));