WIP: turning 2.5d view into a browser which is non-modal

This commit is contained in:
Matthias Koefferlein 2021-09-22 00:18:59 +02:00
parent 9531376b7a
commit 7acd5ba3e4
3 changed files with 15 additions and 45 deletions

View File

@ -71,14 +71,22 @@ D25View::~D25View ()
void
D25View::menu_activated (const std::string &symbol)
{
if (symbol == "lay::net_trace") {
if (symbol == "lay::d25_view") {
const lay::CellView &cv = view ()->cellview (view ()->active_cellview_index ());
if (cv.is_valid ()) {
show ();
activateWindow ();
raise ();
activate ();
try {
activate ();
} catch (...) {
deactivate ();
throw;
}
}
} else {
@ -164,43 +172,7 @@ D25View::vscale_factor_changed (double f)
mp_ui->vzoom_slider->blockSignals (false);
}
int
D25View::exec_dialog (lay::LayoutView *view)
{
int ret = 0;
try {
mp_view.reset (view);
bool any = mp_ui->d25_view->attach_view (view);
if (! any) {
mp_view.reset (0);
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.")));
}
mp_ui->d25_view->reset ();
mp_ui->d25_view->set_cam_azimuth (0.0);
mp_ui->d25_view->set_cam_elevation (-initial_elevation);
mp_ui->d25_view->fit ();
ret = QDialog::exec ();
mp_ui->d25_view->attach_view (0);
mp_view.reset (0);
} catch (...) {
mp_ui->d25_view->attach_view (0);
mp_view.reset (0);
}
return ret;
}
void
D25View::deactivated ()
{
mp_ui->d25_view->attach_view (0);
@ -211,7 +183,6 @@ 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.")));
}

View File

@ -938,6 +938,10 @@ D25ViewWidget::do_initialize_gl ()
void
D25ViewWidget::paintGL ()
{
if (! mp_view) {
return;
}
const qreal retina_scale = devicePixelRatio ();
glViewport (0, 0, width () * retina_scale, height () * retina_scale);

View File

@ -34,11 +34,6 @@ static std::string v2s (const QVector3D &v)
return tl::to_string (v.x ()) + "," + tl::to_string (v.y ()) + "," + tl::to_string (v.z ());
}
static std::string v2s_2d (const QVector3D &v)
{
return tl::to_string (v.x ()) + "," + tl::to_string (v.y ());
}
TEST(1_Transformations)
{
lay::D25Camera cam;