mirror of https://github.com/KLayout/klayout.git
WIP: turning 2.5d view into a browser which is non-modal
This commit is contained in:
parent
9531376b7a
commit
7acd5ba3e4
|
|
@ -71,14 +71,22 @@ D25View::~D25View ()
|
||||||
void
|
void
|
||||||
D25View::menu_activated (const std::string &symbol)
|
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 ());
|
const lay::CellView &cv = view ()->cellview (view ()->active_cellview_index ());
|
||||||
if (cv.is_valid ()) {
|
if (cv.is_valid ()) {
|
||||||
|
|
||||||
show ();
|
show ();
|
||||||
activateWindow ();
|
activateWindow ();
|
||||||
raise ();
|
raise ();
|
||||||
activate ();
|
|
||||||
|
try {
|
||||||
|
activate ();
|
||||||
|
} catch (...) {
|
||||||
|
deactivate ();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -164,43 +172,7 @@ D25View::vscale_factor_changed (double f)
|
||||||
mp_ui->vzoom_slider->blockSignals (false);
|
mp_ui->vzoom_slider->blockSignals (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
void
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
D25View::deactivated ()
|
D25View::deactivated ()
|
||||||
{
|
{
|
||||||
mp_ui->d25_view->attach_view (0);
|
mp_ui->d25_view->attach_view (0);
|
||||||
|
|
@ -211,7 +183,6 @@ D25View::activated ()
|
||||||
{
|
{
|
||||||
bool any = mp_ui->d25_view->attach_view (view ());
|
bool any = mp_ui->d25_view->attach_view (view ());
|
||||||
if (! any) {
|
if (! any) {
|
||||||
// @@@
|
|
||||||
mp_ui->d25_view->attach_view (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.")));
|
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.")));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -938,6 +938,10 @@ D25ViewWidget::do_initialize_gl ()
|
||||||
void
|
void
|
||||||
D25ViewWidget::paintGL ()
|
D25ViewWidget::paintGL ()
|
||||||
{
|
{
|
||||||
|
if (! mp_view) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const qreal retina_scale = devicePixelRatio ();
|
const qreal retina_scale = devicePixelRatio ();
|
||||||
glViewport (0, 0, width () * retina_scale, height () * retina_scale);
|
glViewport (0, 0, width () * retina_scale, height () * retina_scale);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 ());
|
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)
|
TEST(1_Transformations)
|
||||||
{
|
{
|
||||||
lay::D25Camera cam;
|
lay::D25Camera cam;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue