From c4e5367b8a4bc27b40de2c4a57918b433229685d Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 5 Apr 2020 18:22:45 +0200 Subject: [PATCH] First setup. --- .../tools/view_25d/lay_plugin/D25View.ui | 59 +++++++++ .../tools/view_25d/lay_plugin/layD25Plugin.cc | 112 ++++++++++++++++ .../tools/view_25d/lay_plugin/layD25View.cc | 65 ++++++++++ .../tools/view_25d/lay_plugin/layD25View.h | 65 ++++++++++ .../view_25d/lay_plugin/layD25ViewWidget.cc | 41 ++++++ .../view_25d/lay_plugin/layD25ViewWidget.h | 44 +++++++ .../tools/view_25d/lay_plugin/layXORPlugin.cc | 122 ++++++++++++++++++ .../tools/view_25d/lay_plugin/lay_plugin.pro | 21 +++ src/plugins/tools/view_25d/view_25d.pro | 6 + 9 files changed, 535 insertions(+) create mode 100644 src/plugins/tools/view_25d/lay_plugin/D25View.ui create mode 100644 src/plugins/tools/view_25d/lay_plugin/layD25Plugin.cc create mode 100644 src/plugins/tools/view_25d/lay_plugin/layD25View.cc create mode 100644 src/plugins/tools/view_25d/lay_plugin/layD25View.h create mode 100644 src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc create mode 100644 src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.h create mode 100644 src/plugins/tools/view_25d/lay_plugin/layXORPlugin.cc create mode 100644 src/plugins/tools/view_25d/lay_plugin/lay_plugin.pro create mode 100644 src/plugins/tools/view_25d/view_25d.pro diff --git a/src/plugins/tools/view_25d/lay_plugin/D25View.ui b/src/plugins/tools/view_25d/lay_plugin/D25View.ui new file mode 100644 index 000000000..f28b5eddf --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/D25View.ui @@ -0,0 +1,59 @@ + + + D25View + + + + 0 + 0 + 576 + 649 + + + + 2.5d View + + + + 6 + + + 9 + + + 9 + + + 9 + + + 9 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + lay::D25View + QOpenGLWidget +
layD25View.h
+
+
+ + buttonBox + + + +
diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25Plugin.cc b/src/plugins/tools/view_25d/lay_plugin/layD25Plugin.cc new file mode 100644 index 000000000..1883bdf36 --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/layD25Plugin.cc @@ -0,0 +1,112 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2020 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + + +#include "layD25View.h" +#include "layDispatcher.h" + +#include "layPlugin.h" + +namespace lay +{ + +class D25Plugin + : public lay::Plugin +{ +public: + D25Plugin (Plugin *parent, lay::LayoutView *view) + : lay::Plugin (parent), mp_view (view) + { + mp_dialog = new lay::D25View (0); + } + + ~D25Plugin () + { + delete mp_dialog; + mp_dialog = 0; + } + + void menu_activated (const std::string &symbol) + { + if (symbol == "lay::d25_view") { + + if (mp_dialog->exec_dialog (mp_view)) { + + // ... implementation is in layD25ToolDialog.cc ... + + } + + } + } + +private: + lay::LayoutView *mp_view; + lay::D25ToolDialog *mp_dialog; +}; + +class D25PluginDeclaration + : public lay::PluginDeclaration +{ +public: + D25PluginDeclaration () + { + // .. nothing yet .. + } + + virtual void get_options (std::vector < std::pair > &options) const + { + // .. nothing yet .. + } + + virtual lay::ConfigPage *config_page (QWidget * /*parent*/, std::string & /*title*/) const + { + // .. nothing yet .. + return 0; + } + + virtual void get_menu_entries (std::vector &menu_entries) const + { + lay::PluginDeclaration::get_menu_entries (menu_entries); + menu_entries.push_back (lay::menu_item ("lay::d25_view", "d25_view:edit", "tools_menu.post_verification_group", tl::to_string (QObject::tr ("2.5d View")))); + } + + virtual bool configure (const std::string & /*name*/, const std::string & /*value*/) + { + return false; + } + + virtual void config_finalize () + { + // .. nothing yet .. + } + + lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const + { + return new D25Plugin (root, view); + } +}; + +static tl::RegisteredClass config_decl (new lay::D25PluginDeclaration (), 3000, "lay::D25Plugin"); + +} + diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25View.cc b/src/plugins/tools/view_25d/lay_plugin/layD25View.cc new file mode 100644 index 000000000..cd2c5518b --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/layD25View.cc @@ -0,0 +1,65 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2020 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + +#include "layD25View.h" + +#include "ui_D25View.h" + +#include + +namespace lay +{ + +D25View::D25View (QWidget *parent) + : QDialog (parent), mp_view (0) +{ + mp_ui = new Ui::D25View (); + mp_ui->setupUi (this); + + // @@@ +} + +D25View::~D25View () +{ + delete mp_ui; + mp_ui = 0; +} + +int +D25View::exec_dialog (lay::LayoutView *view) +{ + mp_view.reset (view); + + // @@@ + + return QDialog::exec (); +} + +void +D25View::accept () +{ + // @@@ +} + +} + diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25View.h b/src/plugins/tools/view_25d/lay_plugin/layD25View.h new file mode 100644 index 000000000..78526bd36 --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/layD25View.h @@ -0,0 +1,65 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2020 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#ifndef HDR_layD25View +#define HDR_layD25View + +#include + +#include "tlObject.h" + +namespace Ui +{ + class D25View; +} + +namespace lay +{ + class LayoutView; +} + +namespace lay +{ + +class D25View + : public QDialog +{ +Q_OBJECT + +public: + D25View (QWidget *parent); + ~D25View (); + + int exec_dialog (lay::LayoutView *view); + +protected: + void accept (); + +private: + Ui::D25View *mp_ui; + tl::weak_ptr mp_view; +}; + +} + +#endif + diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc new file mode 100644 index 000000000..2cfffbebb --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.cc @@ -0,0 +1,41 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2020 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + +#include "layD25ViewWidget.h" + +namespace lay +{ + +D25ViewWidget::D25ViewWidget (QWidget *parent) + : QOpenGLWidget (parent), mp_view (0) +{ + // @@@ +} + +D25View::~D25View () +{ + // @@@ +} + +} + diff --git a/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.h b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.h new file mode 100644 index 000000000..428f466f3 --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/layD25ViewWidget.h @@ -0,0 +1,44 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2020 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#ifndef HDR_layD25ViewWidget +#define HDR_layD25ViewWidget + +#include + +namespace lay +{ + +class D25ViewWidget + : public QOpenGLWidget +{ +Q_OBJECT + +public: + D25ViewWidget (QWidget *parent); + ~D25ViewWidget (); +}; + +} + +#endif + diff --git a/src/plugins/tools/view_25d/lay_plugin/layXORPlugin.cc b/src/plugins/tools/view_25d/lay_plugin/layXORPlugin.cc new file mode 100644 index 000000000..f5bd4895e --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/layXORPlugin.cc @@ -0,0 +1,122 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2020 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + + + +#include "layXORToolDialog.h" +#include "layDispatcher.h" + +#include "layPlugin.h" + +namespace lay +{ + +class XORPlugin + : public lay::Plugin +{ +public: + XORPlugin (Plugin *parent, lay::LayoutView *view) + : lay::Plugin (parent), mp_view (view) + { + mp_dialog = new lay::XORToolDialog (0); + } + + ~XORPlugin () + { + delete mp_dialog; + mp_dialog = 0; + } + + void menu_activated (const std::string &symbol) + { + if (symbol == "lay::xor_tool") { + + if (mp_dialog->exec_dialog (mp_view)) { + + // ... implementation is in layXORToolDialog.cc ... + + } + + } + } + +private: + lay::LayoutView *mp_view; + lay::XORToolDialog *mp_dialog; +}; + +class XORPluginDeclaration + : public lay::PluginDeclaration +{ +public: + XORPluginDeclaration () + { + // .. nothing yet .. + } + + virtual void get_options (std::vector < std::pair > &options) const + { + options.push_back (std::pair (cfg_xor_input_mode, "all")); + options.push_back (std::pair (cfg_xor_output_mode, "rdb")); + options.push_back (std::pair (cfg_xor_nworkers, "1")); + options.push_back (std::pair (cfg_xor_layer_offset, "")); + options.push_back (std::pair (cfg_xor_axorb, "true")); + options.push_back (std::pair (cfg_xor_anotb, "false")); + options.push_back (std::pair (cfg_xor_bnota, "false")); + options.push_back (std::pair (cfg_xor_summarize, "false")); + options.push_back (std::pair (cfg_xor_tolerances, "")); + options.push_back (std::pair (cfg_xor_tiling, "")); + options.push_back (std::pair (cfg_xor_region_mode, "all")); + } + + virtual lay::ConfigPage *config_page (QWidget * /*parent*/, std::string & /*title*/) const + { + // .. nothing yet .. + return 0; + } + + virtual void get_menu_entries (std::vector &menu_entries) const + { + lay::PluginDeclaration::get_menu_entries (menu_entries); + menu_entries.push_back (lay::menu_item ("lay::xor_tool", "xor_tool:edit", "tools_menu.post_verification_group", tl::to_string (QObject::tr ("XOR Tool")))); + } + + virtual bool configure (const std::string & /*name*/, const std::string & /*value*/) + { + return false; + } + + virtual void config_finalize () + { + // .. nothing yet .. + } + + lay::Plugin *create_plugin (db::Manager *, lay::Dispatcher *root, lay::LayoutView *view) const + { + return new XORPlugin (root, view); + } +}; + +static tl::RegisteredClass config_decl (new lay::XORPluginDeclaration (), 3000, "lay::XORPlugin"); + +} + diff --git a/src/plugins/tools/view_25d/lay_plugin/lay_plugin.pro b/src/plugins/tools/view_25d/lay_plugin/lay_plugin.pro new file mode 100644 index 000000000..5b3d29d47 --- /dev/null +++ b/src/plugins/tools/view_25d/lay_plugin/lay_plugin.pro @@ -0,0 +1,21 @@ + +TARGET = xor_ui +DESTDIR = $$OUT_PWD/../../../../lay_plugins + +include($$PWD/../../../lay_plugin.pri) + +INCLUDEPATH += $$RDB_INC $$ANT_INC +DEPENDPATH += $$RDB_INC $$ANT_INC +LIBS += -L$$DESTDIR/.. -lklayout_rdb -lklayout_ant + +HEADERS = \ + layD25View.h \ + layD25ViewWidget.h \ + +SOURCES = \ + layD25View.cc \ + layD25ViewWidget.cc \ + layD25Plugin.cc + +FORMS = \ + D25View.ui \ diff --git a/src/plugins/tools/view_25d/view_25d.pro b/src/plugins/tools/view_25d/view_25d.pro new file mode 100644 index 000000000..f1dd4434b --- /dev/null +++ b/src/plugins/tools/view_25d/view_25d.pro @@ -0,0 +1,6 @@ + +TEMPLATE = subdirs + +!equals(HAVE_QT, "0") { + SUBDIRS = lay_plugin +}