Skip to content
Open

Wip #2264

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
989f80e
Using floats for Polygon::smooth distance checks, so that precise mea…
Dec 22, 2025
c005995
Two small improvements
Dec 22, 2025
c3b6476
[consider merging] Bugfix: DRC collect_xyz is available now also for …
Jan 10, 2026
b409ed8
Include hidden classes in documentation to avoid confusion.
Jan 11, 2026
c6faa3e
'extent_refs' DRC function: enabling for edge pairs and edges, clarif…
Jan 11, 2026
160cceb
Pressing Ctrl key while drawing a box forces it into a square
Jan 11, 2026
c738cf7
WIP
Jan 12, 2026
0b9a0c3
WIP, e.g. avoiding sticky selection when aborting 'move' by chosing a…
Jan 12, 2026
67790c0
WIP
Jan 12, 2026
8add404
WIP
Jan 12, 2026
15a5f7f
WIP
Jan 13, 2026
18ef4a1
Allowing use of arrow keys for move
Jan 13, 2026
cabcde3
[consider merging] Fixing strange snapping behavior on partial move a…
Jan 13, 2026
ee622fc
WIP
Jan 13, 2026
c2aa597
WIP
Jan 13, 2026
e058c47
WIP
Jan 13, 2026
cca73a8
WIP, some refactoring and bug fixing. Move toolkit widget works
Jan 13, 2026
6666b2b
Implementing 'diagonal only' for rulers
Jan 14, 2026
ca9a319
WIP: some refactoring
Jan 14, 2026
2dd804a
[consider merging] Bugfix: selecting a recent configuration in the ed…
Jan 14, 2026
49f608c
Improving Qt binding solution for RBA::EditorOptionsPage
Jan 14, 2026
a0ca8fe
Fixed unit test
Jan 15, 2026
9fe2286
Enabling Qt-less builds
Jan 15, 2026
900ac4b
Refactoring, displaying move vector also in partial mode
Jan 15, 2026
6b5dbb1
Enabling toolbox widgets for box service. Plus add-on: pressing Shift…
Jan 16, 2026
c2c9410
Enabling toolkit widgets for rulers
Jan 17, 2026
18c2f5d
[consider merging] incremental value placeholders for rulers
Jan 18, 2026
ddee74a
Rulers: confine box/ellipse to square/circle with Ctrl, center box/el…
Jan 18, 2026
659feb4
Fixing a small glitch when notifications and toolbox widgets interact
Jan 18, 2026
280d79a
Bug fixing the other rulers
Jan 18, 2026
8300e2e
Added Enter to finish shape edits, added numerical entries for paths …
Jan 19, 2026
ccd9952
Providing numerical move entries also for partial (handle) image and …
Jan 22, 2026
de70025
Finish rulers by pressing the Enter key
Jan 24, 2026
86ddeb5
Updating documentation
Jan 24, 2026
11701a3
'Apply' buttons and persistency of values for Layout+Selection 'move …
Jan 24, 2026
2c65bf8
[consider merging] Bugfix: do not stop finder iterations when there a…
Jan 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/ant/ant/RulerConfigPage3.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>665</width>
<height>103</height>
<height>108</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -56,6 +56,13 @@
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="1">
<widget class="QRadioButton" name="ruler_diag_rb">
<property name="text">
<string>Diagonal</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="ruler_hor_rb">
<property name="text">
Expand All @@ -77,17 +84,17 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QRadioButton" name="ruler_diag_rb">
<item row="0" column="3">
<widget class="QRadioButton" name="ruler_vert_rb">
<property name="text">
<string>Diagonal</string>
<string>Vertical only</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QRadioButton" name="ruler_vert_rb">
<widget class="QRadioButton" name="ruler_diag_only_rb">
<property name="text">
<string>Vertical only</string>
<string>Diagonal only</string>
</property>
</widget>
</item>
Expand All @@ -102,7 +109,6 @@
<tabstop>ruler_ortho_rb</tabstop>
<tabstop>ruler_diag_rb</tabstop>
<tabstop>ruler_hor_rb</tabstop>
<tabstop>ruler_vert_rb</tabstop>
</tabstops>
<resources/>
<connections/>
Expand Down
5 changes: 5 additions & 0 deletions src/ant/ant/RulerConfigPage4.ui
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@
<string>Orthogonal</string>
</property>
</item>
<item>
<property name="text">
<string>Diagonal only</string>
</property>
</item>
<item>
<property name="text">
<string>Horizontal only</string>
Expand Down
2 changes: 2 additions & 0 deletions src/ant/ant/ant.pro
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SOURCES = \

HEADERS += \
antConfig.h \
antEditorOptionsPages.h \
antObject.h \
antPlugin.h \
antService.h \
Expand All @@ -40,6 +41,7 @@ HEADERS += \

SOURCES += \
antConfig.cc \
antEditorOptionsPages.cc \
antObject.cc \
antPlugin.cc \
antService.cc \
Expand Down
41 changes: 0 additions & 41 deletions src/ant/ant/antConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,6 @@ namespace ant
// ------------------------------------------------------------
// Helper functions to get and set the configuration

std::string
ACConverter::to_string (const lay::angle_constraint_type &m)
{
if (m == lay::AC_Any) {
return "any";
} else if (m == lay::AC_Diagonal) {
return "diagonal";
} else if (m == lay::AC_Ortho) {
return "ortho";
} else if (m == lay::AC_Horizontal) {
return "horizontal";
} else if (m == lay::AC_Vertical) {
return "vertical";
} else if (m == lay::AC_Global) {
return "global";
} else {
return "";
}
}

void
ACConverter::from_string (const std::string &tt, lay::angle_constraint_type &m)
{
std::string t (tl::trim (tt));
if (t == "any") {
m = lay::AC_Any;
} else if (t == "diagonal") {
m = lay::AC_Diagonal;
} else if (t == "ortho") {
m = lay::AC_Ortho;
} else if (t == "horizontal") {
m = lay::AC_Horizontal;
} else if (t == "vertical") {
m = lay::AC_Vertical;
} else if (t == "global") {
m = lay::AC_Global;
} else {
m = lay::AC_Any;
}
}

std::string
StyleConverter::to_string (ant::Object::style_type s)
{
Expand Down
6 changes: 0 additions & 6 deletions src/ant/ant/antConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ extern ANT_PUBLIC const std::string cfg_current_ruler_template;
// ------------------------------------------------------------
// Helper functions to get and set the configuration

struct ACConverter
{
std::string to_string (const lay::angle_constraint_type &m);
void from_string (const std::string &s, lay::angle_constraint_type &m);
};

struct StyleConverter
{
std::string to_string (ant::Object::style_type s);
Expand Down
8 changes: 6 additions & 2 deletions src/ant/ant/antConfigPage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ ConfigPage3::setup (lay::Dispatcher *root)
{
// snap mode
lay::angle_constraint_type rm = lay::AC_Any;
root->config_get (cfg_ruler_snap_mode, rm, ACConverter ());
root->config_get (cfg_ruler_snap_mode, rm, lay::ACConverter ());
mp_ui->ruler_any_angle_rb->setChecked (rm == lay::AC_Any);
mp_ui->ruler_ortho_rb->setChecked (rm == lay::AC_Ortho);
mp_ui->ruler_diag_rb->setChecked (rm == lay::AC_Diagonal);
mp_ui->ruler_diag_only_rb->setChecked (rm == lay::AC_DiagonalOnly);
mp_ui->ruler_hor_rb->setChecked (rm == lay::AC_Horizontal);
mp_ui->ruler_vert_rb->setChecked (rm == lay::AC_Vertical);
}
Expand All @@ -180,13 +181,16 @@ ConfigPage3::commit (lay::Dispatcher *root)
if (mp_ui->ruler_diag_rb->isChecked ()) {
rm = lay::AC_Diagonal;
}
if (mp_ui->ruler_diag_only_rb->isChecked ()) {
rm = lay::AC_DiagonalOnly;
}
if (mp_ui->ruler_hor_rb->isChecked ()) {
rm = lay::AC_Horizontal;
}
if (mp_ui->ruler_vert_rb->isChecked ()) {
rm = lay::AC_Vertical;
}
root->config_set (cfg_ruler_snap_mode, rm, ACConverter ());
root->config_set (cfg_ruler_snap_mode, rm, lay::ACConverter ());
}

// ------------------------------------------------------------
Expand Down
155 changes: 155 additions & 0 deletions src/ant/ant/antEditorOptionsPages.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@

/*

KLayout Layout Viewer
Copyright (C) 2006-2025 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

*/

#if defined(HAVE_QT)

#include "antService.h"
#include "antEditorOptionsPages.h"

#include "layWidgets.h"
#include "layDispatcher.h"
#include "tlInternational.h"

#include <QHBoxLayout>

namespace ant
{

// ------------------------------------------------------------------
// Annotations Toolbox widget

ToolkitWidget::ToolkitWidget (lay::LayoutViewBase *view, lay::Dispatcher *dispatcher)
: lay::EditorOptionsPageWidget (view, dispatcher)
{
mp_layout = new QHBoxLayout (this);

mp_x_le = new lay::DecoratedLineEdit (this);
mp_x_le->set_label ("dx:");
mp_layout->addWidget (mp_x_le);

mp_y_le = new lay::DecoratedLineEdit (this);
mp_y_le->set_label ("dy:");
mp_layout->addWidget (mp_y_le);

mp_d_le = new lay::DecoratedLineEdit (this);
mp_d_le->set_label ("d:");
mp_layout->addWidget (mp_d_le);

mp_layout->addStretch (1);

hide ();

set_toolbox_widget (true);
set_transparent (true);
}

ToolkitWidget::~ToolkitWidget ()
{
// .. nothing yet ..
}

std::string
ToolkitWidget::title () const
{
return "Box Options";
}

const char *
ToolkitWidget::name () const
{
return ant::Service::editor_options_name ();
}

void
ToolkitWidget::deactivated ()
{
hide ();
}

void
ToolkitWidget::commit (lay::Dispatcher *dispatcher)
{
try {

if (mp_d_le->hasFocus ()) {

double d = 0.0;

tl::from_string (tl::to_string (mp_d_le->text ()), d);

dispatcher->call_function (ant::Service::d_function_name (), tl::to_string (d));

} else {

double dx = 0.0, dy = 0.0;

tl::from_string (tl::to_string (mp_x_le->text ()), dx);
tl::from_string (tl::to_string (mp_y_le->text ()), dy);

dispatcher->call_function (ant::Service::xy_function_name (), db::DVector (dx, dy).to_string ());

}

} catch (...) {
}
}

void
ToolkitWidget::configure (const std::string &name, const std::string &value)
{
if (name == ant::Service::xy_configure_name () && ! mp_x_le->hasFocus () && ! mp_y_le->hasFocus ()) {

try {

db::DVector mv;
tl::from_string (value, mv);

mp_x_le->setText (tl::to_qstring (tl::micron_to_string (mv.x ())));
mp_y_le->setText (tl::to_qstring (tl::micron_to_string (mv.y ())));

} catch (...) {
}

} else if (name == ant::Service::d_configure_name () && ! mp_x_le->hasFocus () && ! mp_y_le->hasFocus ()) {

try {

double d;
tl::from_string (value, d);

mp_d_le->setText (tl::to_qstring (tl::micron_to_string (d)));

} catch (...) {
}

}
}

// ------------------------------------------------------------------
// Registrations

// toolkit widgets
static tl::RegisteredClass<lay::EditorOptionsPageFactoryBase> s_tookit_widget_factory (new lay::EditorOptionsPageFactory<ToolkitWidget> ("ant::Plugin"), 0);

}

#endif
68 changes: 68 additions & 0 deletions src/ant/ant/antEditorOptionsPages.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

/*

KLayout Layout Viewer
Copyright (C) 2006-2025 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

*/

#if defined(HAVE_QT)

#ifndef HDR_antEditorOptionsPages
#define HDR_antEditorOptionsPages

#include "layEditorOptionsPageWidget.h"

class QHBoxLayout;

namespace lay
{
class DecoratedLineEdit;
}

namespace ant
{

/**
* @brief The toolbox widget for annotations
*/
class ToolkitWidget
: public lay::EditorOptionsPageWidget
{
Q_OBJECT

public:
ToolkitWidget (lay::LayoutViewBase *view, lay::Dispatcher *dispatcher);
~ToolkitWidget ();

virtual std::string title () const;
virtual const char *name () const;
virtual int order () const { return 0; }
virtual void configure (const std::string &name, const std::string &value);
virtual void commit (lay::Dispatcher *root);
virtual void deactivated ();

private:
QHBoxLayout *mp_layout;
lay::DecoratedLineEdit *mp_x_le, *mp_y_le, *mp_d_le;
};

}

#endif

#endif
Loading
Loading