First setup.

This commit is contained in:
Matthias Koefferlein 2020-04-05 18:22:45 +02:00
parent df11ff9b85
commit c4e5367b8a
9 changed files with 535 additions and 0 deletions

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>D25View</class>
<widget class="QDialog" name="D25View">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>576</width>
<height>649</height>
</rect>
</property>
<property name="windowTitle">
<string>2.5d View</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="lay::D25View" name="openGLWidget"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>lay::D25View</class>
<extends>QOpenGLWidget</extends>
<header>layD25View.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -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<std::string, std::string> > &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<lay::MenuEntry> &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<lay::PluginDeclaration> config_decl (new lay::D25PluginDeclaration (), 3000, "lay::D25Plugin");
}

View File

@ -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 <stdio.h>
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 ()
{
// @@@
}
}

View File

@ -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 <QDialog>
#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<lay::LayoutView> mp_view;
};
}
#endif

View File

@ -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 ()
{
// @@@
}
}

View File

@ -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 <QOpenGLWidget>
namespace lay
{
class D25ViewWidget
: public QOpenGLWidget
{
Q_OBJECT
public:
D25ViewWidget (QWidget *parent);
~D25ViewWidget ();
};
}
#endif

View File

@ -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<std::string, std::string> > &options) const
{
options.push_back (std::pair<std::string, std::string> (cfg_xor_input_mode, "all"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_output_mode, "rdb"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_nworkers, "1"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_layer_offset, ""));
options.push_back (std::pair<std::string, std::string> (cfg_xor_axorb, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_anotb, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_bnota, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_summarize, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_xor_tolerances, ""));
options.push_back (std::pair<std::string, std::string> (cfg_xor_tiling, ""));
options.push_back (std::pair<std::string, std::string> (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<lay::MenuEntry> &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<lay::PluginDeclaration> config_decl (new lay::XORPluginDeclaration (), 3000, "lay::XORPlugin");
}

View File

@ -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 \

View File

@ -0,0 +1,6 @@
TEMPLATE = subdirs
!equals(HAVE_QT, "0") {
SUBDIRS = lay_plugin
}