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
This commit is contained in:
Matthias Koefferlein 2021-10-06 23:17:45 +02:00
parent 8b12788084
commit 747807224b
2 changed files with 5 additions and 10 deletions

View File

@ -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 ();

View File

@ -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 ...")));