mirror of https://github.com/KLayout/klayout.git
Merge branch 'master' into wip2
This commit is contained in:
commit
8241e8347d
|
|
@ -52,7 +52,7 @@ jobs:
|
|||
HOST_CCACHE_DIR="$(ccache -k cache_dir)"
|
||||
mkdir -p $HOST_CCACHE_DIR
|
||||
- name: Build wheels # check https://cibuildwheel.readthedocs.io/en/stable/setup/#github-actions
|
||||
uses: pypa/cibuildwheel@v2.13.1
|
||||
uses: pypa/cibuildwheel@v2.14.1
|
||||
# to supply options, put them in 'env', like:
|
||||
# env:
|
||||
# CIBW_SOME_OPTION: value
|
||||
|
|
@ -97,7 +97,7 @@ jobs:
|
|||
name: artifact
|
||||
path: dist
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@v1.8.7
|
||||
- uses: pypa/gh-action-pypi-publish@v1.8.8
|
||||
continue-on-error: true # might fail if we don't bump the version
|
||||
with:
|
||||
user: __token__
|
||||
|
|
@ -114,7 +114,7 @@ jobs:
|
|||
name: artifact
|
||||
path: dist
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@v1.8.7
|
||||
- uses: pypa/gh-action-pypi-publish@v1.8.8
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.pypi_password }}
|
||||
|
|
|
|||
|
|
@ -579,8 +579,8 @@ Path round_path_corners (const Path &path, int rad, int n)
|
|||
return Path (round_path_corners (db::DPath (path), double (rad), n, 0.5));
|
||||
}
|
||||
|
||||
template class path<Coord>;
|
||||
template class path<DCoord>;
|
||||
template class DB_PUBLIC path<Coord>;
|
||||
template class DB_PUBLIC path<DCoord>;
|
||||
|
||||
// explicit instantiations
|
||||
template DB_PUBLIC void path<Coord>::create_shifted_points (Coord, Coord, Coord, bool, path<Coord>::pointlist_type::iterator, path<Coord>::pointlist_type::iterator, int, box_inserter<path<Coord>::box_type>) const;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,61 @@
|
|||
namespace db
|
||||
{
|
||||
|
||||
static char halign2code (db::HAlign ha)
|
||||
{
|
||||
if (ha == db::HAlignCenter) {
|
||||
return 'c';
|
||||
} else if (ha == db::HAlignLeft) {
|
||||
return 'l';
|
||||
} else if (ha == db::HAlignRight) {
|
||||
return 'r';
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static db::HAlign extract_halign (tl::Extractor &ex)
|
||||
{
|
||||
if (ex.test ("c")) {
|
||||
return db::HAlignCenter;
|
||||
} else if (ex.test ("l")) {
|
||||
return db::HAlignLeft;
|
||||
} else if (ex.test ("r")) {
|
||||
return db::HAlignRight;
|
||||
} else {
|
||||
return db::NoHAlign;
|
||||
}
|
||||
}
|
||||
|
||||
static char valign2code (db::VAlign va)
|
||||
{
|
||||
if (va == db::VAlignCenter) {
|
||||
return 'c';
|
||||
} else if (va == db::VAlignBottom) {
|
||||
return 'b';
|
||||
} else if (va == db::VAlignTop) {
|
||||
return 't';
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static db::VAlign extract_valign (tl::Extractor &ex)
|
||||
{
|
||||
if (ex.test ("c")) {
|
||||
return db::VAlignCenter;
|
||||
} else if (ex.test ("t")) {
|
||||
return db::VAlignTop;
|
||||
} else if (ex.test ("b")) {
|
||||
return db::VAlignBottom;
|
||||
} else {
|
||||
return db::NoVAlign;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// StringRef implementation
|
||||
|
||||
StringRef::~StringRef ()
|
||||
{
|
||||
if (mp_rep) {
|
||||
|
|
@ -33,19 +88,55 @@ StringRef::~StringRef ()
|
|||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// text implementation
|
||||
|
||||
template <class C>
|
||||
std::string text<C>::to_string (double dbu) const
|
||||
{
|
||||
std::string s = std::string ("(") + tl::to_quoted_string (string ()) + "," + m_trans.to_string (dbu) + ")";
|
||||
|
||||
if (size () > 0) {
|
||||
s += " s=";
|
||||
s += tl::to_string (size ());
|
||||
}
|
||||
|
||||
if (font () >= 0) {
|
||||
s += " f=";
|
||||
s += tl::to_string (int (font ()));
|
||||
}
|
||||
|
||||
char c;
|
||||
c = halign2code (halign ());
|
||||
if (c) {
|
||||
s += " ha=";
|
||||
s += c;
|
||||
}
|
||||
c = valign2code (valign ());
|
||||
if (c) {
|
||||
s += " va=";
|
||||
s += c;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
template class DB_PUBLIC text<Coord>;
|
||||
template class DB_PUBLIC text<DCoord>;
|
||||
|
||||
}
|
||||
|
||||
namespace tl
|
||||
{
|
||||
|
||||
template<> void extractor_impl (tl::Extractor &ex, db::Text &p)
|
||||
template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::Text &p)
|
||||
{
|
||||
if (! test_extractor_impl (ex, p)) {
|
||||
ex.error (tl::to_string (tr ("Expected a text specification")));
|
||||
}
|
||||
}
|
||||
|
||||
template<> void extractor_impl (tl::Extractor &ex, db::DText &p)
|
||||
template<> DB_PUBLIC void extractor_impl (tl::Extractor &ex, db::DText &p)
|
||||
{
|
||||
if (! test_extractor_impl (ex, p)) {
|
||||
ex.error (tl::to_string (tr ("Expected a text specification")));
|
||||
|
|
@ -69,6 +160,28 @@ template<class C> bool _test_extractor_impl (tl::Extractor &ex, db::text<C> &t)
|
|||
|
||||
ex.expect (")");
|
||||
|
||||
if (ex.test ("s=")) {
|
||||
C size = 0;
|
||||
ex.read (size);
|
||||
t.size (size);
|
||||
}
|
||||
|
||||
if (ex.test ("f=")) {
|
||||
int font = -1;
|
||||
ex.read (font);
|
||||
t.font (db::Font (font));
|
||||
}
|
||||
|
||||
if (ex.test ("ha=")) {
|
||||
db::HAlign ha = db::extract_halign (ex);
|
||||
t.halign (ha);
|
||||
}
|
||||
|
||||
if (ex.test ("va=")) {
|
||||
db::VAlign va = db::extract_valign (ex);
|
||||
t.valign (va);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
|
@ -76,12 +189,12 @@ template<class C> bool _test_extractor_impl (tl::Extractor &ex, db::text<C> &t)
|
|||
}
|
||||
}
|
||||
|
||||
template<> bool test_extractor_impl (tl::Extractor &ex, db::Text &p)
|
||||
template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::Text &p)
|
||||
{
|
||||
return _test_extractor_impl (ex, p);
|
||||
}
|
||||
|
||||
template<> bool test_extractor_impl (tl::Extractor &ex, db::DText &p)
|
||||
template<> DB_PUBLIC bool test_extractor_impl (tl::Extractor &ex, db::DText &p)
|
||||
{
|
||||
return _test_extractor_impl (ex, p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ inline void mem_stat (MemStatistics *stat, MemStatistics::purpose_t purpose, int
|
|||
*/
|
||||
|
||||
template <class C>
|
||||
class DB_PUBLIC_TEMPLATE text
|
||||
class DB_PUBLIC text
|
||||
{
|
||||
public:
|
||||
typedef C coord_type;
|
||||
|
|
@ -757,10 +757,7 @@ public:
|
|||
/**
|
||||
* @brief String conversion
|
||||
*/
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return std::string ("(") + tl::to_quoted_string (string ()) + "," + m_trans.to_string (dbu) + ")";
|
||||
}
|
||||
std::string to_string (double dbu = 0.0) const;
|
||||
|
||||
/**
|
||||
* @brief Reduce the text
|
||||
|
|
|
|||
|
|
@ -1167,7 +1167,7 @@ TEST(5)
|
|||
EXPECT_EQ (r.text (),
|
||||
"layout_diff: texts differ for layer 17/0 in cell c2x\n"
|
||||
"Not in b but in a:\n"
|
||||
" ('X',r90 2,3)\n"
|
||||
" ('X',r90 2,3) s=17\n"
|
||||
"Not in a but in b:\n"
|
||||
);
|
||||
|
||||
|
|
@ -1198,10 +1198,10 @@ TEST(5)
|
|||
"layout_diff: texts differ for layer 17/0 in cell c2x\n"
|
||||
"Not in b but in a:\n"
|
||||
"Not in a but in b:\n"
|
||||
" ('X',r90 2,3)\n"
|
||||
" ('Y',r90 2,3)\n"
|
||||
" ('X',r90 3,4)\n"
|
||||
" ('X',r180 2,3)\n"
|
||||
" ('X',r90 2,3) s=18\n"
|
||||
" ('Y',r90 2,3) s=17\n"
|
||||
" ('X',r90 3,4) s=17\n"
|
||||
" ('X',r180 2,3) s=17\n"
|
||||
);
|
||||
|
||||
// two more to match more of h:
|
||||
|
|
@ -1216,8 +1216,8 @@ TEST(5)
|
|||
"layout_diff: texts differ for layer 17/0 in cell c2x\n"
|
||||
"Not in b but in a:\n"
|
||||
"Not in a but in b:\n"
|
||||
" ('Y',r90 2,3)\n"
|
||||
" ('X',r180 2,3)\n"
|
||||
" ('Y',r90 2,3) s=17\n"
|
||||
" ('X',r180 2,3) s=17\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,4 +133,68 @@ TEST(3)
|
|||
EXPECT_EQ (std::string (s2b.text_string ()), "U");
|
||||
}
|
||||
|
||||
std::string string_trip (const db::Text &t)
|
||||
{
|
||||
std::string s = t.to_string ();
|
||||
tl::Extractor ex (s.c_str ());
|
||||
|
||||
db::Text t2;
|
||||
ex.read (t2);
|
||||
|
||||
return t2.to_string ();
|
||||
}
|
||||
|
||||
TEST(4)
|
||||
{
|
||||
db::Text t ("abc", db::Trans (db::Trans::r90));
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0)");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.size (150);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) s=150");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.size (0);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0)");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.halign (db::HAlignCenter);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) ha=c");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.halign (db::HAlignLeft);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) ha=l");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.halign (db::HAlignRight);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) ha=r");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.valign (db::VAlignCenter);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) ha=r va=c");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.valign (db::VAlignTop);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) ha=r va=t");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.valign (db::VAlignBottom);
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) ha=r va=b");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
|
||||
t.halign (db::NoHAlign);
|
||||
t.valign (db::NoVAlign);
|
||||
t.font (db::Font (17));
|
||||
|
||||
EXPECT_EQ (t.to_string (), "('abc',r90 0,0) f=17");
|
||||
EXPECT_EQ (string_trip (t), t.to_string ());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -861,7 +861,7 @@ PartialShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, co
|
|||
|
||||
db::Point tp (shape->text_trans () * db::Point ());
|
||||
|
||||
if (text_info ()) {
|
||||
if (text_info () && ! text_info ()->point_mode ()) {
|
||||
|
||||
db::CplxTrans t_dbu = db::CplxTrans (layout ().dbu ()) * t;
|
||||
db::Text text;
|
||||
|
|
@ -1023,7 +1023,7 @@ PartialShapeFinder::visit_cell (const db::Cell &cell, const db::Box &hit_box, co
|
|||
|
||||
db::Point tp (shape->text_trans () * db::Point ());
|
||||
|
||||
if (text_info ()) {
|
||||
if (text_info () && ! text_info ()->point_mode ()) {
|
||||
|
||||
db::CplxTrans t_dbu = db::CplxTrans (layout ().dbu ()) * t;
|
||||
db::Text text;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SearchReplaceConfigPage</class>
|
||||
<widget class="QFrame" name="SearchReplaceConfigPage" >
|
||||
<property name="geometry" >
|
||||
<widget class="QFrame" name="SearchReplaceConfigPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
|
|
@ -9,94 +10,34 @@
|
|||
<height>158</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Search Result Browser Configuration</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Search Result Browser Configuration</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="4" >
|
||||
<widget class="QLabel" name="textLabel2" >
|
||||
<property name="text" >
|
||||
<string>µm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" >
|
||||
<widget class="QLineEdit" name="le_window" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string>Maximum number of items to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_2" >
|
||||
<property name="text" >
|
||||
<string>Window </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QComboBox" name="cbx_window" >
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Don't change</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Fit context cell</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Fit marker with margin ..</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Center marker</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<string>Center marker with size ..</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<item row="0" column="2">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>21</height>
|
||||
|
|
@ -104,18 +45,71 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QLineEdit" name="le_max_items" />
|
||||
<item row="1" column="3">
|
||||
<widget class="QLineEdit" name="le_max_items"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cbx_window">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Don't change</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Fit context cell</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Fit marker with margin ..</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Center marker</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Center marker with size ..</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel1_2">
|
||||
<property name="text">
|
||||
<string>Window </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="lay::MarginWidget" name="mrg_window" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Maximum number of items to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lay::MarginWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>layWidgets.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>cbx_window</tabstop>
|
||||
<tabstop>le_window</tabstop>
|
||||
<tabstop>le_max_items</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ SearchReplaceConfigPage::setup (lay::Dispatcher *root)
|
|||
cbx_window->setCurrentIndex (int (wmode));
|
||||
|
||||
// window dimension
|
||||
double wdim = 1.0;
|
||||
root->config_get (cfg_sr_window_dim, wdim);
|
||||
le_window->setText (tl::to_qstring (tl::to_string (wdim)));
|
||||
std::string wdim_str;
|
||||
root->config_get (cfg_sr_window_dim, wdim_str);
|
||||
mrg_window->set_margin (lay::Margin::from_string (wdim_str));
|
||||
|
||||
// max. instance count
|
||||
unsigned int max_item_count = 1000;
|
||||
|
|
@ -103,20 +103,19 @@ SearchReplaceConfigPage::setup (lay::Dispatcher *root)
|
|||
void
|
||||
SearchReplaceConfigPage::window_changed (int m)
|
||||
{
|
||||
le_window->setEnabled (m == int (SearchReplaceDialog::FitMarker) || m == int (SearchReplaceDialog::CenterSize));
|
||||
mrg_window->setEnabled (m == int (SearchReplaceDialog::FitMarker) || m == int (SearchReplaceDialog::CenterSize));
|
||||
}
|
||||
|
||||
void
|
||||
SearchReplaceConfigPage::commit (lay::Dispatcher *root)
|
||||
{
|
||||
double dim = 1.0;
|
||||
tl::from_string_ext (tl::to_string (le_window->text ()), dim);
|
||||
lay::Margin dim = mrg_window->get_margin ();
|
||||
|
||||
unsigned int max_item_count = 1000;
|
||||
tl::from_string_ext (tl::to_string (le_max_items->text ()), max_item_count);
|
||||
|
||||
root->config_set (cfg_sr_window_mode, SearchReplaceDialog::window_type (cbx_window->currentIndex ()), SearchReplaceWindowModeConverter ());
|
||||
root->config_set (cfg_sr_window_dim, dim);
|
||||
root->config_set (cfg_sr_window_dim, dim.to_string ());
|
||||
root->config_set (cfg_sr_max_item_count, max_item_count);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1125,9 +1125,8 @@ SearchReplaceDialog::configure (const std::string &name, const std::string &valu
|
|||
|
||||
} else if (name == cfg_sr_window_dim) {
|
||||
|
||||
double wdim = m_window_dim;
|
||||
tl::from_string (value, wdim);
|
||||
if (fabs (wdim - m_window_dim) > 1e-6) {
|
||||
lay::Margin wdim = lay::Margin::from_string (value);
|
||||
if (wdim != m_window_dim) {
|
||||
m_window_dim = wdim;
|
||||
need_update = true;
|
||||
}
|
||||
|
|
@ -1754,15 +1753,17 @@ SearchReplaceDialog::result_selection_changed ()
|
|||
|
||||
if (! dbox.empty ()) {
|
||||
|
||||
double window_dim = m_window_dim.get (dbox);
|
||||
|
||||
if (m_window == FitCell) {
|
||||
view ()->zoom_fit ();
|
||||
} else if (m_window == FitMarker) {
|
||||
view ()->zoom_box (dbox.enlarged (db::DVector (m_window_dim, m_window_dim)));
|
||||
view ()->zoom_box (dbox.enlarged (db::DVector (window_dim, window_dim)));
|
||||
} else if (m_window == Center) {
|
||||
view ()->pan_center (dbox.p1 () + (dbox.p2 () - dbox.p1 ()) * 0.5);
|
||||
} else if (m_window == CenterSize) {
|
||||
double w = std::max (dbox.width (), m_window_dim);
|
||||
double h = std::max (dbox.height (), m_window_dim);
|
||||
double w = std::max (dbox.width (), window_dim);
|
||||
double h = std::max (dbox.height (), window_dim);
|
||||
db::DPoint center (dbox.p1 () + (dbox.p2 () - dbox.p1 ()) * 0.5);
|
||||
db::DVector d (w * 0.5, h * 0.5);
|
||||
view ()->zoom_box (db::DBox (center - d, center + d));
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "ui_SearchReplaceDialog.h"
|
||||
|
||||
#include "layBrowser.h"
|
||||
#include "layMargin.h"
|
||||
#include "rdb.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbShape.h"
|
||||
|
|
@ -180,7 +181,7 @@ private:
|
|||
int m_current_mode;
|
||||
|
||||
window_type m_window;
|
||||
double m_window_dim;
|
||||
lay::Margin m_window_dim;
|
||||
unsigned int m_max_item_count;
|
||||
std::vector<lay::MarkerBase *> mp_markers;
|
||||
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ ShapeFinder::find_internal (lay::LayoutViewBase *view, unsigned int cv_index, co
|
|||
|
||||
try {
|
||||
|
||||
if ((m_flags & db::ShapeIterator::Texts) != 0 && mp_text_info) {
|
||||
if ((m_flags & db::ShapeIterator::Texts) != 0 && mp_text_info && ! mp_text_info->point_mode ()) {
|
||||
|
||||
m_flags = db::ShapeIterator::Texts;
|
||||
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ LayoutViewBase::init (db::Manager *mgr)
|
|||
m_show_properties = false;
|
||||
m_apply_text_trans = true;
|
||||
m_default_text_size = 0.1;
|
||||
m_text_point_mode = false;
|
||||
m_text_font = 0;
|
||||
m_show_markers = true;
|
||||
m_no_stipples = false;
|
||||
|
|
@ -984,6 +985,13 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
|
|||
default_text_size (sz);
|
||||
return true;
|
||||
|
||||
} else if (name == cfg_text_point_mode) {
|
||||
|
||||
bool flag;
|
||||
tl::from_string (value, flag);
|
||||
text_point_mode (flag);
|
||||
return true;
|
||||
|
||||
} else if (name == cfg_text_font) {
|
||||
|
||||
int n;
|
||||
|
|
@ -5174,7 +5182,16 @@ LayoutViewBase::default_text_size (double fs)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
LayoutViewBase::text_point_mode (bool pm)
|
||||
{
|
||||
if (m_text_point_mode != pm) {
|
||||
m_text_point_mode = pm;
|
||||
redraw ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LayoutViewBase::clear_ruler_new_cell (bool f)
|
||||
{
|
||||
m_clear_ruler_new_cell = f;
|
||||
|
|
|
|||
|
|
@ -1195,6 +1195,22 @@ public:
|
|||
return m_default_text_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets text point mode
|
||||
*
|
||||
* In point mode, the text is treated like a point.
|
||||
* Selection happens at the texts' origin.
|
||||
*/
|
||||
void text_point_mode (bool pm);
|
||||
|
||||
/**
|
||||
* @brief Gets text point mode
|
||||
*/
|
||||
bool text_point_mode () const
|
||||
{
|
||||
return m_text_point_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Show or hide markers
|
||||
*/
|
||||
|
|
@ -2811,6 +2827,7 @@ private:
|
|||
tl::Color m_text_color;
|
||||
bool m_apply_text_trans;
|
||||
double m_default_text_size;
|
||||
bool m_text_point_mode;
|
||||
unsigned int m_text_font;
|
||||
bool m_show_markers;
|
||||
bool m_no_stipples;
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public:
|
|||
options.push_back (std::pair<std::string, std::string> (cfg_apply_text_trans, "true"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_global_trans, "r0"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_default_text_size, "0.1"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_text_point_mode, "false"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_text_font, "0"));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_sel_color, cc.to_string (tl::Color ())));
|
||||
options.push_back (std::pair<std::string, std::string> (cfg_sel_line_width, "1"));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,114 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2023 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 "layMargin.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
static const double delta = 1e-10;
|
||||
|
||||
Margin::Margin (double value, bool relative)
|
||||
: m_relative_value (0.0), m_absolute_value (0.0), m_relative_mode (relative)
|
||||
{
|
||||
if (relative) {
|
||||
m_relative_value = value;
|
||||
} else {
|
||||
m_absolute_value = value;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Margin::operator== (const lay::Margin &other) const
|
||||
{
|
||||
return m_relative_mode == other.m_relative_mode &&
|
||||
fabs (m_absolute_value - other.m_absolute_value) < delta &&
|
||||
fabs (m_relative_value - other.m_relative_value) < delta;
|
||||
}
|
||||
|
||||
std::string
|
||||
Margin::to_string () const
|
||||
{
|
||||
std::string res;
|
||||
if (m_relative_mode) {
|
||||
res = std::string ("*") + tl::to_string (m_relative_value);
|
||||
if (fabs (m_absolute_value) > delta) {
|
||||
res += " ";
|
||||
res += tl::to_string (m_absolute_value);
|
||||
}
|
||||
} else {
|
||||
res = tl::to_string (m_absolute_value);
|
||||
if (fabs (m_relative_value) > delta) {
|
||||
res += " *";
|
||||
res += tl::to_string (m_relative_value);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Margin
|
||||
Margin::from_string (const std::string &s)
|
||||
{
|
||||
Margin res;
|
||||
|
||||
tl::Extractor ex (s.c_str ());
|
||||
if (ex.test ("*")) {
|
||||
double v = 0.0;
|
||||
ex.read (v);
|
||||
res.set_relative_mode (true);
|
||||
res.set_relative_value (v);
|
||||
if (! ex.at_end ()) {
|
||||
ex.read (v);
|
||||
res.set_absolute_value (v);
|
||||
}
|
||||
} else {
|
||||
double v = 0.0;
|
||||
ex.read (v);
|
||||
res.set_relative_mode (false);
|
||||
res.set_absolute_value (v);
|
||||
if (ex.test ("*")) {
|
||||
ex.read (v);
|
||||
res.set_relative_value (v);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
double
|
||||
Margin::get (double dim) const
|
||||
{
|
||||
return m_relative_mode ? dim * m_relative_value : m_absolute_value;
|
||||
}
|
||||
|
||||
double
|
||||
Margin::get (const db::DBox &box) const
|
||||
{
|
||||
return get (std::max (box.width (), box.height ()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,140 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2023 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_layMargin
|
||||
#define HDR_layMargin
|
||||
|
||||
#include "laybasicCommon.h"
|
||||
|
||||
#include "dbBox.h"
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A class represeting a margin on size
|
||||
*
|
||||
* Margin or size can be specified absolutely (in micron units) or relative
|
||||
* to some object (given by a size or a box).
|
||||
*
|
||||
* The object keeps relative and absolute values so it can be easily
|
||||
* switched.
|
||||
*/
|
||||
|
||||
class LAYBASIC_PUBLIC Margin
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief The constructor
|
||||
*/
|
||||
Margin (double value = 0.0, bool relative = false);
|
||||
|
||||
/**
|
||||
* @brief Equality
|
||||
*/
|
||||
bool operator== (const lay::Margin &other) const;
|
||||
|
||||
/**
|
||||
* @brief Inequality
|
||||
*/
|
||||
bool operator!= (const lay::Margin &other) const
|
||||
{
|
||||
return ! operator== (other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the relative value
|
||||
*/
|
||||
double relative_value () const
|
||||
{
|
||||
return m_relative_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the relative value
|
||||
*/
|
||||
void set_relative_value (double v)
|
||||
{
|
||||
m_relative_value = v;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the absolute value
|
||||
*/
|
||||
double absolute_value () const
|
||||
{
|
||||
return m_absolute_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the absolute value
|
||||
*/
|
||||
void set_absolute_value (double v)
|
||||
{
|
||||
m_absolute_value = v;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets a value indicating whether the relative value shall be used
|
||||
*/
|
||||
bool relative_mode () const
|
||||
{
|
||||
return m_relative_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets a value indicating whether the relative value shall be used
|
||||
*/
|
||||
void set_relative_mode (bool mode)
|
||||
{
|
||||
m_relative_mode = mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Converts the object to a string
|
||||
*/
|
||||
std::string to_string () const;
|
||||
|
||||
/**
|
||||
* @brief Creates the object from a string
|
||||
*/
|
||||
static Margin from_string (const std::string &s);
|
||||
|
||||
/**
|
||||
* @brief Gets the resulting value for a given object dimension
|
||||
*/
|
||||
double get (double dim) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the resulting value for a given box
|
||||
*/
|
||||
double get (const db::DBox &box) const;
|
||||
|
||||
private:
|
||||
double m_relative_value, m_absolute_value;
|
||||
bool m_relative_mode;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -640,7 +640,9 @@ ShapeMarker::render (const Viewport &vp, ViewObjectCanvas &canvas)
|
|||
db::Text t;
|
||||
m_shape.text (t);
|
||||
db::DBox box = ti.bbox (trans () * t, vp_trans).enlarged (text_box_enlargement (vp_trans));
|
||||
r.draw (box, vp_trans, 0, text, 0, 0);
|
||||
if (! box.is_point ()) {
|
||||
r.draw (box, vp_trans, 0, text, 0, 0);
|
||||
}
|
||||
}
|
||||
r.draw (m_shape, t, fill, contour, vertex, text);
|
||||
r.draw_propstring (m_shape, &ly->properties_repository (), text, t);
|
||||
|
|
@ -653,7 +655,9 @@ ShapeMarker::render (const Viewport &vp, ViewObjectCanvas &canvas)
|
|||
db::Text t;
|
||||
m_shape.text (t);
|
||||
db::DBox box = ti.bbox (trans () * t, vp.trans ()).enlarged (text_box_enlargement (vp.trans ()));
|
||||
r.draw (box, vp.trans (), 0, text, 0, 0);
|
||||
if (! box.is_point ()) {
|
||||
r.draw (box, vp.trans (), 0, text, 0, 0);
|
||||
}
|
||||
}
|
||||
r.draw (m_shape, t, fill, contour, vertex, text);
|
||||
r.draw_propstring (m_shape, &ly->properties_repository (), text, t);
|
||||
|
|
@ -1114,7 +1118,9 @@ Marker::draw (lay::Renderer &r, const db::CplxTrans &t, lay::CanvasPlane *fill,
|
|||
lay::TextInfo ti (view ());
|
||||
db::DCplxTrans dt (t);
|
||||
db::DBox box = ti.bbox (*m_object.dtext, dt).enlarged (text_box_enlargement (dt));
|
||||
r.draw (box, dt, 0, text, 0, 0);
|
||||
if (! box.is_point ()) {
|
||||
r.draw (box, dt, 0, text, 0, 0);
|
||||
}
|
||||
}
|
||||
r.draw (*m_object.dtext, db::DCplxTrans (t), fill, contour, vertex, text);
|
||||
} else if (m_type == Edge) {
|
||||
|
|
@ -1316,7 +1322,9 @@ DMarker::render (const Viewport &vp, ViewObjectCanvas &canvas)
|
|||
// draw a frame around the text
|
||||
lay::TextInfo ti (view ());
|
||||
db::DBox box = ti.bbox (*m_object.text, t).enlarged (text_box_enlargement (t));
|
||||
r.draw (box, t, 0, text, 0, 0);
|
||||
if (! box.is_point ()) {
|
||||
r.draw (box, t, 0, text, 0, 0);
|
||||
}
|
||||
}
|
||||
r.draw (*m_object.text, t, fill, contour, vertex, text);
|
||||
} else if (m_type == Edge) {
|
||||
|
|
|
|||
|
|
@ -33,16 +33,8 @@ TextInfo::TextInfo (const LayoutViewBase *view)
|
|||
: m_default_text_size (view->default_text_size ()),
|
||||
m_default_font (db::Font (view->text_font ())),
|
||||
m_apply_text_trans (view->apply_text_trans ()),
|
||||
m_resolution (view->canvas ()->resolution ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
TextInfo::TextInfo (double default_text_size, const db::Font &default_font, bool apply_text_trans, double resolution)
|
||||
: m_default_text_size (default_text_size),
|
||||
m_default_font (default_font),
|
||||
m_apply_text_trans (apply_text_trans),
|
||||
m_resolution (resolution)
|
||||
m_resolution (view->canvas ()->resolution ()),
|
||||
m_point_mode (view->text_point_mode ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
|
@ -50,6 +42,10 @@ TextInfo::TextInfo (double default_text_size, const db::Font &default_font, bool
|
|||
db::DBox
|
||||
TextInfo::bbox (const db::DText &text, const db::DCplxTrans &vp_trans) const
|
||||
{
|
||||
if (m_point_mode) {
|
||||
return text.box ();
|
||||
}
|
||||
|
||||
// offset in pixels (space between origin and text)
|
||||
const double offset = 2.0 / vp_trans.mag ();
|
||||
|
||||
|
|
|
|||
|
|
@ -49,17 +49,6 @@ public:
|
|||
*/
|
||||
TextInfo (const LayoutViewBase *view);
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param default_text_size The default text size in micron
|
||||
* @param default_font The default font
|
||||
* @param apply_text_trans True if text transformations are to be applied
|
||||
* @param resolution The resolution value (logical pixel size per physical unit pixel)
|
||||
* @param vp_trans The effective micron-to-pixel transformation
|
||||
*/
|
||||
TextInfo (double default_text_size, const db::Font &default_font, bool apply_text_trans, double resolution);
|
||||
|
||||
/**
|
||||
* @brief Gets the visual bounding box of the given DText object
|
||||
*
|
||||
|
|
@ -71,12 +60,23 @@ public:
|
|||
* @param vp_trans The effective micron-to-pixel transformation
|
||||
*/
|
||||
db::DBox bbox (const db::DText &text, const db::DCplxTrans &vp_trans) const;
|
||||
|
||||
/**
|
||||
* @brief Gets a value indicating whether the text info uses point mode
|
||||
*
|
||||
* In point mode, a text is considered a point-like object.
|
||||
*/
|
||||
bool point_mode () const
|
||||
{
|
||||
return m_point_mode;
|
||||
}
|
||||
|
||||
private:
|
||||
double m_default_text_size;
|
||||
db::Font m_default_font;
|
||||
bool m_apply_text_trans;
|
||||
double m_resolution;
|
||||
bool m_point_mode;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ SOURCES += \
|
|||
gsiDeclLayRdbAdded.cc \
|
||||
layAbstractMenu.cc \
|
||||
layLayoutViewConfig.cc \
|
||||
layMargin.cc \
|
||||
laybasicForceLink.cc \
|
||||
layAnnotationShapes.cc \
|
||||
layBitmap.cc \
|
||||
|
|
@ -86,6 +87,7 @@ SOURCES += \
|
|||
layUtils.cc \
|
||||
|
||||
HEADERS += \
|
||||
layMargin.h \
|
||||
laybasicConfig.h \
|
||||
laybasicForceLink.h \
|
||||
layAbstractMenu.h \
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ static const std::string cfg_global_trans ("global-trans");
|
|||
static const std::string cfg_no_stipple ("no-stipple");
|
||||
static const std::string cfg_stipple_offset ("stipple-offset");
|
||||
static const std::string cfg_default_text_size ("default-text-size");
|
||||
static const std::string cfg_text_point_mode ("text-point-mode");
|
||||
static const std::string cfg_text_font ("text-font");
|
||||
static const std::string cfg_full_hier_new_cell ("full-hierarchy-new-cell");
|
||||
static const std::string cfg_initial_hier_depth ("initial-hier-depth");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2023 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 "layMargin.h"
|
||||
|
||||
#include "tlUnitTest.h"
|
||||
|
||||
TEST(1)
|
||||
{
|
||||
lay::Margin m;
|
||||
|
||||
EXPECT_EQ (m.relative_mode (), false);
|
||||
EXPECT_EQ (m.to_string (), "0");
|
||||
EXPECT_EQ (m.get (1.0), 0.0);
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
|
||||
m.set_relative_mode (true);
|
||||
EXPECT_EQ (m.get (1.0), 0.0);
|
||||
EXPECT_EQ (m.relative_mode (), true);
|
||||
EXPECT_EQ (m.to_string (), "*0");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
|
||||
m = lay::Margin (1.0);
|
||||
EXPECT_EQ (m.get (2.0), 1.0);
|
||||
EXPECT_EQ (m.relative_mode (), false);
|
||||
EXPECT_EQ (m.absolute_value (), 1.0);
|
||||
EXPECT_EQ (m.to_string (), "1");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
|
||||
m.set_absolute_value (2.0);
|
||||
EXPECT_EQ (m.get (1.0), 2.0);
|
||||
EXPECT_EQ (m.absolute_value (), 2.0);
|
||||
EXPECT_EQ (m.to_string (), "2");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
|
||||
m = lay::Margin (1.5, true);
|
||||
EXPECT_EQ (m.get (1.0), 1.5);
|
||||
EXPECT_EQ (m.get (db::DBox (0.0, 0.0, 1.0, 0.5)), 1.5);
|
||||
EXPECT_EQ (m.get (db::DBox (0.0, 0.0, 1.0, 2.0)), 3.0);
|
||||
EXPECT_EQ (m.relative_mode (), true);
|
||||
EXPECT_EQ (m.relative_value (), 1.5);
|
||||
EXPECT_EQ (m.to_string (), "*1.5");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
|
||||
m.set_absolute_value (2.5);
|
||||
EXPECT_EQ (m.get (1.0), 1.5);
|
||||
EXPECT_EQ (m.to_string (), "*1.5 2.5");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
EXPECT_EQ (m.absolute_value (), 2.5);
|
||||
|
||||
m.set_relative_value (2.0);
|
||||
EXPECT_EQ (m.get (1.0), 2.0);
|
||||
EXPECT_EQ (m.to_string (), "*2 2.5");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
EXPECT_EQ (m.relative_value (), 2.0);
|
||||
|
||||
m.set_relative_mode (false);
|
||||
EXPECT_EQ (m.get (1.0), 2.5);
|
||||
EXPECT_EQ (m.absolute_value (), 2.5);
|
||||
EXPECT_EQ (m.to_string (), "2.5 *2");
|
||||
EXPECT_EQ (lay::Margin::from_string (m.to_string ()).to_string (), m.to_string ());
|
||||
EXPECT_EQ (m.relative_value (), 2.0);
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ SOURCES = \
|
|||
layBitmap.cc \
|
||||
layBitmapsToImage.cc \
|
||||
layLayerProperties.cc \
|
||||
layMarginTests.cc \
|
||||
layParsedLayerSource.cc \
|
||||
layRenderer.cc \
|
||||
layAbstractMenuTests.cc \
|
||||
|
|
|
|||
|
|
@ -1,53 +1,52 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BrowseInstancesConfigPage</class>
|
||||
<widget class="QFrame" name="BrowseInstancesConfigPage" >
|
||||
<property name="geometry" >
|
||||
<widget class="QFrame" name="BrowseInstancesConfigPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>499</width>
|
||||
<height>148</height>
|
||||
<height>151</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Browse Cell Instances</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Instance Browser Setup</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="2" >
|
||||
<item row="0" column="2">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>27</height>
|
||||
|
|
@ -55,62 +54,62 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3" colspan="2" >
|
||||
<widget class="QLineEdit" name="le_cell_name" >
|
||||
<property name="enabled" >
|
||||
<item row="0" column="3" colspan="2">
|
||||
<widget class="QLineEdit" name="le_cell_name">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Maximum number of instances to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QComboBox" name="cbx_context" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cbx_context">
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show in context of cell ..</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show in context of any top cell</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show in parent cell</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="textLabel1" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel1">
|
||||
<property name="text">
|
||||
<string>Context </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_2" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="textLabel1_2">
|
||||
<property name="text">
|
||||
<string>Window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<item row="1" column="2">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>25</height>
|
||||
|
|
@ -118,58 +117,55 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QComboBox" name="cbx_window" >
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cbx_window">
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Don't change</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Fit whole context cell</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Fit marker with margin ..</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Center marker</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Center marker with size ..</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QLineEdit" name="le_window" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="1" column="3" colspan="2">
|
||||
<widget class="lay::MarginWidget" name="mrg_window" native="true"/>
|
||||
</item>
|
||||
<item row="2" column="3" >
|
||||
<widget class="QLineEdit" name="le_max_count" />
|
||||
</item>
|
||||
<item row="1" column="4" >
|
||||
<widget class="QLabel" name="textLabel2" >
|
||||
<property name="text" >
|
||||
<string>µm</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="2" column="3" colspan="2">
|
||||
<widget class="QLineEdit" name="le_max_count"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lay::MarginWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>layWidgets.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BrowseShapesConfigPage</class>
|
||||
<widget class="QFrame" name="BrowseShapesConfigPage" >
|
||||
<property name="geometry" >
|
||||
<widget class="QFrame" name="BrowseShapesConfigPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
|
|
@ -9,61 +10,44 @@
|
|||
<height>194</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Browse Shapes</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Shape Browser Setup</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="4" >
|
||||
<widget class="QLabel" name="textLabel2" >
|
||||
<property name="text" >
|
||||
<string>µm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QLineEdit" name="le_window" >
|
||||
<property name="enabled" >
|
||||
<item row="0" column="3" colspan="2">
|
||||
<widget class="QLineEdit" name="le_cell_name">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3" colspan="2" >
|
||||
<widget class="QLineEdit" name="le_cell_name" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3" >
|
||||
<widget class="QLineEdit" name="le_max_shapes" />
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<item row="0" column="2">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>21</height>
|
||||
|
|
@ -71,15 +55,15 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2" >
|
||||
<item row="1" column="2">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
|
|
@ -87,91 +71,105 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QComboBox" name="cbx_context" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cbx_context">
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show in context of cell ..</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show in context of any top cell</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Show in context of local cell</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" >
|
||||
<widget class="QLineEdit" name="le_max_inst" />
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Maximum number of shapes to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLabel" name="textLabel1" >
|
||||
<property name="text" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel1">
|
||||
<property name="text">
|
||||
<string>Context </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QComboBox" name="cbx_window" >
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cbx_window">
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Don't change</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Fit context cell</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Fit marker with margin ..</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Center marker</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>Center marker with size ..</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="label_2" >
|
||||
<property name="text" >
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Maximum number of instances to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QLabel" name="textLabel1_2" >
|
||||
<property name="text" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="textLabel1_2">
|
||||
<property name="text">
|
||||
<string>Window </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" colspan="2">
|
||||
<widget class="lay::MarginWidget" name="mrg_window" native="true"/>
|
||||
</item>
|
||||
<item row="2" column="3" colspan="2">
|
||||
<widget class="QLineEdit" name="le_max_shapes"/>
|
||||
</item>
|
||||
<item row="3" column="3" colspan="2">
|
||||
<widget class="QLineEdit" name="le_max_inst"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lay::MarginWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>layWidgets.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
|
|
@ -183,6 +183,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="text_point_mode_cb">
|
||||
<property name="text">
|
||||
<string>Texts are points (active area is origin)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="sel_inside_pcells_cb">
|
||||
<property name="text">
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<property name="margin" stdset="0">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
|
|
@ -26,14 +26,15 @@
|
|||
<string>Marker Browser</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLineEdit" name="le_max_markers"/>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Maximum number of markers to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer>
|
||||
|
|
@ -87,7 +88,7 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="4">
|
||||
<item row="0" column="1" colspan="5">
|
||||
<widget class="QComboBox" name="cbx_context">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
|
@ -116,20 +117,6 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLineEdit" name="le_window">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Maximum number of markers to show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="textLabel1_3">
|
||||
<property name="text">
|
||||
|
|
@ -137,12 +124,11 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QLabel" name="textLabel2">
|
||||
<property name="text">
|
||||
<string>µm</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="2" column="3" colspan="3">
|
||||
<widget class="QLineEdit" name="le_max_markers"/>
|
||||
</item>
|
||||
<item row="1" column="3" colspan="3">
|
||||
<widget class="lay::MarginWidget" name="mgn_window" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
@ -150,6 +136,14 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>lay::MarginWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>layWidgets.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
|||
|
|
@ -200,9 +200,9 @@ BrowseInstancesConfigPage::setup (lay::Dispatcher *root)
|
|||
cbx_window->setCurrentIndex (int (wmode));
|
||||
|
||||
// window dimension
|
||||
double wdim = 1.0;
|
||||
root->config_get (cfg_cib_window_dim, wdim);
|
||||
le_window->setText (tl::to_qstring (tl::to_string (wdim)));
|
||||
std::string wdim_str;
|
||||
root->config_get (cfg_cib_window_dim, wdim_str);
|
||||
mrg_window->set_margin (lay::Margin::from_string (wdim_str));
|
||||
|
||||
// max. instance count
|
||||
unsigned int max_inst_count = 1000;
|
||||
|
|
@ -223,22 +223,19 @@ BrowseInstancesConfigPage::context_changed (int m)
|
|||
void
|
||||
BrowseInstancesConfigPage::window_changed (int m)
|
||||
{
|
||||
le_window->setEnabled (m == int (BrowseInstancesForm::FitMarker) || m == int (BrowseInstancesForm::CenterSize));
|
||||
mrg_window->setEnabled (m == int (BrowseInstancesForm::FitMarker) || m == int (BrowseInstancesForm::CenterSize));
|
||||
}
|
||||
|
||||
void
|
||||
BrowseInstancesConfigPage::commit (lay::Dispatcher *root)
|
||||
{
|
||||
double dim = 1.0;
|
||||
tl::from_string_ext (tl::to_string (le_window->text ()), dim);
|
||||
|
||||
unsigned int max_inst_count = 1000;
|
||||
tl::from_string_ext (tl::to_string (le_max_count->text ()), max_inst_count);
|
||||
|
||||
root->config_set (cfg_cib_context_cell, tl::to_string (le_cell_name->text ()));
|
||||
root->config_set (cfg_cib_context_mode, BrowseInstancesForm::mode_type (cbx_context->currentIndex ()), BrowseInstancesContextModeConverter ());
|
||||
root->config_set (cfg_cib_window_mode, BrowseInstancesForm::window_type (cbx_window->currentIndex ()), BrowseInstancesWindowModeConverter ());
|
||||
root->config_set (cfg_cib_window_dim, dim);
|
||||
root->config_set (cfg_cib_window_dim, mrg_window->get_margin ().to_string ());
|
||||
root->config_set (cfg_cib_max_inst_count, max_inst_count);
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +303,7 @@ BrowseInstancesForm::BrowseInstancesForm (lay::Dispatcher *root, LayoutViewBase
|
|||
m_ef_enabled (true),
|
||||
m_mode (AnyTop),
|
||||
m_window (FitMarker),
|
||||
m_window_dim (0.0),
|
||||
m_window_dim (),
|
||||
m_max_inst_count (0),
|
||||
m_current_count (0)
|
||||
{
|
||||
|
|
@ -390,9 +387,8 @@ BrowseInstancesForm::configure (const std::string &name, const std::string &valu
|
|||
|
||||
} else if (name == cfg_cib_window_dim) {
|
||||
|
||||
double wdim = m_window_dim;
|
||||
tl::from_string (value, wdim);
|
||||
if (fabs (wdim - m_window_dim) > 1e-6) {
|
||||
lay::Margin wdim = lay::Margin::from_string (value);
|
||||
if (wdim != m_window_dim) {
|
||||
m_window_dim = wdim;
|
||||
need_update = true;
|
||||
}
|
||||
|
|
@ -787,16 +783,18 @@ BrowseInstancesForm::highlight_current ()
|
|||
|
||||
if (index_set) {
|
||||
|
||||
double window_dim = m_window_dim.get (dbox);
|
||||
|
||||
view ()->select_cell (index, m_cv_index);
|
||||
if (m_window == FitCell) {
|
||||
view ()->zoom_fit ();
|
||||
} else if (m_window == FitMarker) {
|
||||
view ()->zoom_box (dbox.enlarged (db::DVector (m_window_dim, m_window_dim)));
|
||||
view ()->zoom_box (dbox.enlarged (db::DVector (window_dim, window_dim)));
|
||||
} else if (m_window == Center) {
|
||||
view ()->pan_center (dbox.p1 () + (dbox.p2 () - dbox.p1 ()) * 0.5);
|
||||
} else if (m_window == CenterSize) {
|
||||
double w = std::max (dbox.width (), m_window_dim);
|
||||
double h = std::max (dbox.height (), m_window_dim);
|
||||
double w = std::max (dbox.width (), window_dim);
|
||||
double h = std::max (dbox.height (), window_dim);
|
||||
db::DPoint center (dbox.p1 () + (dbox.p2 () - dbox.p1 ()) * 0.5);
|
||||
db::DVector d (w * 0.5, h * 0.5);
|
||||
view ()->zoom_box (db::DBox (center - d, center + d));
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "ui_BrowseInstancesConfigPage.h"
|
||||
|
||||
#include "layLayoutViewBase.h"
|
||||
#include "layMargin.h"
|
||||
#include "layPluginConfigPage.h"
|
||||
#include "layBrowser.h"
|
||||
#include "layMarker.h"
|
||||
|
|
@ -98,7 +99,7 @@ private:
|
|||
mode_type m_mode;
|
||||
window_type m_window;
|
||||
|
||||
double m_window_dim;
|
||||
lay::Margin m_window_dim;
|
||||
std::string m_context_cell;
|
||||
|
||||
unsigned int m_max_inst_count;
|
||||
|
|
|
|||
|
|
@ -202,9 +202,9 @@ BrowseShapesConfigPage::setup (lay::Dispatcher *root)
|
|||
cbx_window->setCurrentIndex (int (wmode));
|
||||
|
||||
// window dimension
|
||||
double wdim = 1.0;
|
||||
root->config_get (cfg_shb_window_dim, wdim);
|
||||
le_window->setText (tl::to_qstring (tl::to_string (wdim)));
|
||||
std::string wdim_str;
|
||||
root->config_get (cfg_shb_window_dim, wdim_str);
|
||||
mrg_window->set_margin (lay::Margin::from_string (wdim_str));
|
||||
|
||||
// max. instance count
|
||||
unsigned int max_inst_count = 1000;
|
||||
|
|
@ -230,15 +230,12 @@ BrowseShapesConfigPage::context_changed (int m)
|
|||
void
|
||||
BrowseShapesConfigPage::window_changed (int m)
|
||||
{
|
||||
le_window->setEnabled (m == int (BrowseShapesForm::FitMarker) || m == int (BrowseShapesForm::CenterSize));
|
||||
mrg_window->setEnabled (m == int (BrowseShapesForm::FitMarker) || m == int (BrowseShapesForm::CenterSize));
|
||||
}
|
||||
|
||||
void
|
||||
BrowseShapesConfigPage::commit (lay::Dispatcher *root)
|
||||
{
|
||||
double dim = 1.0;
|
||||
tl::from_string_ext (tl::to_string (le_window->text ()), dim);
|
||||
|
||||
unsigned int max_inst_count = 1000;
|
||||
tl::from_string_ext (tl::to_string (le_max_inst->text ()), max_inst_count);
|
||||
|
||||
|
|
@ -248,7 +245,7 @@ BrowseShapesConfigPage::commit (lay::Dispatcher *root)
|
|||
root->config_set (cfg_shb_context_cell, tl::to_string (le_cell_name->text ()));
|
||||
root->config_set (cfg_shb_context_mode, BrowseShapesForm::mode_type (cbx_context->currentIndex ()), BrowseShapesContextModeConverter ());
|
||||
root->config_set (cfg_shb_window_mode, BrowseShapesForm::window_type (cbx_window->currentIndex ()), BrowseShapesWindowModeConverter ());
|
||||
root->config_set (cfg_shb_window_dim, dim);
|
||||
root->config_set (cfg_shb_window_dim, mrg_window->get_margin ().to_string ());
|
||||
root->config_set (cfg_shb_max_inst_count, max_inst_count);
|
||||
root->config_set (cfg_shb_max_shape_count, max_shape_count);
|
||||
}
|
||||
|
|
@ -409,7 +406,7 @@ BrowseShapesForm::BrowseShapesForm (lay::Dispatcher *root, LayoutViewBase *vw)
|
|||
m_ef_enabled (true),
|
||||
m_mode (AnyTop),
|
||||
m_window (FitMarker),
|
||||
m_window_dim (0.0),
|
||||
m_window_dim (),
|
||||
m_max_inst_count (0),
|
||||
m_max_shape_count (0)
|
||||
{
|
||||
|
|
@ -496,9 +493,8 @@ BrowseShapesForm::configure (const std::string &name, const std::string &value)
|
|||
|
||||
} else if (name == cfg_shb_window_dim) {
|
||||
|
||||
double wdim = m_window_dim;
|
||||
tl::from_string (value, wdim);
|
||||
if (fabs (wdim - m_window_dim) > 1e-6) {
|
||||
lay::Margin wdim = lay::Margin::from_string (value);
|
||||
if (wdim != m_window_dim) {
|
||||
m_window_dim = wdim;
|
||||
need_update = true;
|
||||
}
|
||||
|
|
@ -961,16 +957,18 @@ BrowseShapesForm::highlight_current ()
|
|||
|
||||
if (! dbox.empty ()) {
|
||||
|
||||
double window_dim = m_window_dim.get (dbox);
|
||||
|
||||
view ()->select_cell (cell_index, m_cv_index);
|
||||
if (m_window == FitCell) {
|
||||
view ()->zoom_fit ();
|
||||
} else if (m_window == FitMarker) {
|
||||
view ()->zoom_box (dbox.enlarged (db::DVector (m_window_dim, m_window_dim)));
|
||||
view ()->zoom_box (dbox.enlarged (db::DVector (window_dim, window_dim)));
|
||||
} else if (m_window == Center) {
|
||||
view ()->pan_center (dbox.p1 () + (dbox.p2 () - dbox.p1 ()) * 0.5);
|
||||
} else if (m_window == CenterSize) {
|
||||
double w = std::max (dbox.width (), m_window_dim);
|
||||
double h = std::max (dbox.height (), m_window_dim);
|
||||
double w = std::max (dbox.width (), window_dim);
|
||||
double h = std::max (dbox.height (), window_dim);
|
||||
db::DPoint center (dbox.p1 () + (dbox.p2 () - dbox.p1 ()) * 0.5);
|
||||
db::DVector d (w * 0.5, h * 0.5);
|
||||
view ()->zoom_box (db::DBox (center - d, center + d));
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "ui_BrowseShapesConfigPage.h"
|
||||
|
||||
#include "layLayoutViewBase.h"
|
||||
#include "layMargin.h"
|
||||
#include "layPluginConfigPage.h"
|
||||
#include "layBrowser.h"
|
||||
#include "layMarker.h"
|
||||
|
|
@ -99,7 +100,7 @@ private:
|
|||
mode_type m_mode;
|
||||
window_type m_window;
|
||||
|
||||
double m_window_dim;
|
||||
lay::Margin m_window_dim;
|
||||
std::string m_context_cell;
|
||||
|
||||
unsigned int m_max_inst_count;
|
||||
|
|
|
|||
|
|
@ -372,6 +372,10 @@ LayoutViewConfigPage2c::setup (lay::Dispatcher *root)
|
|||
root->config_get (cfg_sel_inside_pcells_mode, ipm);
|
||||
mp_ui->sel_inside_pcells_cb->setChecked (ipm);
|
||||
|
||||
bool tpm = 0;
|
||||
root->config_get (cfg_text_point_mode, tpm);
|
||||
mp_ui->text_point_mode_cb->setChecked (tpm);
|
||||
|
||||
unsigned int sr = 0;
|
||||
root->config_get (cfg_search_range, sr);
|
||||
mp_ui->search_range_spinbx->setValue (sr);
|
||||
|
|
@ -392,6 +396,7 @@ LayoutViewConfigPage2c::commit (lay::Dispatcher *root)
|
|||
root->config_set (cfg_sel_halo, mp_ui->halo_cb->isChecked ());
|
||||
root->config_set (cfg_sel_transient_mode, mp_ui->transient_mode_cb->isChecked ());
|
||||
root->config_set (cfg_sel_inside_pcells_mode, mp_ui->sel_inside_pcells_cb->isChecked ());
|
||||
root->config_set (cfg_text_point_mode, mp_ui->text_point_mode_cb->isChecked ());
|
||||
root->config_set (cfg_search_range, (unsigned int) mp_ui->search_range_spinbx->value ());
|
||||
root->config_set (cfg_search_range_box, (unsigned int) mp_ui->search_range_box_spinbx->value ());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1077,6 +1077,85 @@ ColorButton::browse_selected ()
|
|||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// MarginWidget implementation
|
||||
|
||||
MarginWidget::MarginWidget (QWidget *parent, const char *name)
|
||||
: QFrame (parent), m_margin ()
|
||||
{
|
||||
if (name) {
|
||||
setObjectName (name);
|
||||
}
|
||||
|
||||
setFrameStyle (QFrame::NoFrame);
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout (this);
|
||||
layout->setContentsMargins (0, 0, 0, 0);
|
||||
|
||||
QLineEdit *le = new QLineEdit (this);
|
||||
mp_abs_edit = le;
|
||||
le->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
layout->addWidget (le);
|
||||
|
||||
le = new QLineEdit (this);
|
||||
mp_rel_edit = le;
|
||||
le->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred));
|
||||
layout->addWidget (le);
|
||||
|
||||
QComboBox *mode = new QComboBox (this);
|
||||
mode->addItem (tl::to_qstring ("µm"));
|
||||
mode->addItem (tl::to_qstring ("%"));
|
||||
mp_mode_cb = mode;
|
||||
layout->addWidget (mode);
|
||||
|
||||
connect (mode, SIGNAL (currentIndexChanged (int)), this, SLOT (mode_selection_changed ()));
|
||||
|
||||
set_margin (lay::Margin ());
|
||||
}
|
||||
|
||||
lay::Margin
|
||||
MarginWidget::get_margin () const
|
||||
{
|
||||
bool rel_mode = mp_mode_cb->currentIndex () == 1;
|
||||
double rel = 0.0, abs = 0.0;
|
||||
tl::from_string (tl::to_string (mp_rel_edit->text ()), rel);
|
||||
tl::from_string (tl::to_string (mp_abs_edit->text ()), abs);
|
||||
|
||||
lay::Margin m = m_margin;
|
||||
m.set_relative_mode (rel_mode);
|
||||
if (rel_mode) {
|
||||
m.set_relative_value (rel * 0.01);
|
||||
} else {
|
||||
m.set_absolute_value (abs);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
void
|
||||
MarginWidget::set_margin (const lay::Margin &margin)
|
||||
{
|
||||
m_margin = margin;
|
||||
|
||||
mp_abs_edit->setText (tl::to_qstring (tl::to_string (margin.absolute_value ())));
|
||||
mp_rel_edit->setText (tl::to_qstring (tl::to_string (margin.relative_value () * 100.0)));
|
||||
mp_mode_cb->setCurrentIndex (margin.relative_mode () ? 1 : 0);
|
||||
mode_selection_changed ();
|
||||
}
|
||||
|
||||
void
|
||||
MarginWidget::mode_selection_changed ()
|
||||
{
|
||||
bool rel_mode = mp_mode_cb->currentIndex () == 1;
|
||||
// NOTE: first hiding and then showing avoids layout flicker ..
|
||||
mp_rel_edit->hide ();
|
||||
mp_abs_edit->hide ();
|
||||
if (rel_mode) {
|
||||
mp_rel_edit->show ();
|
||||
} else {
|
||||
mp_abs_edit->show ();
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// DecoratedLineEdit implementation
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#define HDR_layWidgets
|
||||
|
||||
#include "layuiCommon.h"
|
||||
#include "layMargin.h"
|
||||
|
||||
#include "tlObject.h"
|
||||
#include "tlDeferredExecution.h"
|
||||
|
|
@ -316,6 +317,33 @@ private slots:
|
|||
virtual void selected ();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Margin edit box
|
||||
*
|
||||
* This class implements a special widget to edit a lay::Margin object.
|
||||
* This object allows specification of a relative or absolute margin.
|
||||
*/
|
||||
class LAYUI_PUBLIC MarginWidget
|
||||
: public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MarginWidget (QWidget *parent, const char *name = 0);
|
||||
|
||||
lay::Margin get_margin () const;
|
||||
void set_margin (const lay::Margin &margin);
|
||||
|
||||
protected slots:
|
||||
void mode_selection_changed ();
|
||||
|
||||
private:
|
||||
QLineEdit *mp_abs_edit;
|
||||
QLineEdit *mp_rel_edit;
|
||||
QComboBox *mp_mode_cb;
|
||||
lay::Margin m_margin;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Color chooser button
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "layConverters.h"
|
||||
#include "layDispatcher.h"
|
||||
#include "layUtils.h"
|
||||
#include "layMargin.h"
|
||||
|
||||
#include "ui_MarkerBrowserConfigPage.h"
|
||||
#include "ui_MarkerBrowserConfigPage2.h"
|
||||
|
|
@ -159,9 +160,11 @@ MarkerBrowserConfigPage::setup (lay::Dispatcher *root)
|
|||
mp_ui->cbx_window->setCurrentIndex (int (wmode));
|
||||
|
||||
// window dimension
|
||||
double wdim = 1.0;
|
||||
root->config_get (cfg_rdb_window_dim, wdim);
|
||||
mp_ui->le_window->setText (tl::to_qstring (tl::to_string (wdim)));
|
||||
lay::Margin wdim (1.0);
|
||||
std::string wdim_str = wdim.to_string ();
|
||||
root->config_get (cfg_rdb_window_dim, wdim_str);
|
||||
wdim = lay::Margin::from_string (wdim_str);
|
||||
mp_ui->mgn_window->set_margin (wdim);
|
||||
|
||||
// max. marker count
|
||||
unsigned int max_marker_count = 1000;
|
||||
|
|
@ -175,21 +178,18 @@ MarkerBrowserConfigPage::setup (lay::Dispatcher *root)
|
|||
void
|
||||
MarkerBrowserConfigPage::window_changed (int m)
|
||||
{
|
||||
mp_ui->le_window->setEnabled (m == int (rdb::FitMarker) || m == int (rdb::CenterSize));
|
||||
mp_ui->mgn_window->setEnabled (m == int (rdb::FitMarker) || m == int (rdb::CenterSize));
|
||||
}
|
||||
|
||||
void
|
||||
MarkerBrowserConfigPage::commit (lay::Dispatcher *root)
|
||||
{
|
||||
double dim = 1.0;
|
||||
tl::from_string_ext (tl::to_string (mp_ui->le_window->text ()), dim);
|
||||
|
||||
unsigned int max_markers_count = 1000;
|
||||
tl::from_string_ext (tl::to_string (mp_ui->le_max_markers->text ()), max_markers_count);
|
||||
|
||||
root->config_set (cfg_rdb_context_mode, rdb::context_mode_type (mp_ui->cbx_context->currentIndex ()), MarkerBrowserContextModeConverter ());
|
||||
root->config_set (cfg_rdb_window_mode, rdb::window_type (mp_ui->cbx_window->currentIndex ()), MarkerBrowserWindowModeConverter ());
|
||||
root->config_set (cfg_rdb_window_dim, dim);
|
||||
root->config_set (cfg_rdb_window_dim, mp_ui->mgn_window->get_margin ().to_string ());
|
||||
root->config_set (cfg_rdb_max_marker_count, max_markers_count);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -470,9 +470,8 @@ MarkerBrowserDialog::configure (const std::string &name, const std::string &valu
|
|||
|
||||
} else if (name == cfg_rdb_window_dim) {
|
||||
|
||||
double wdim = m_window_dim;
|
||||
tl::from_string (value, wdim);
|
||||
if (fabs (wdim - m_window_dim) > 1e-6) {
|
||||
lay::Margin wdim = lay::Margin::from_string (value);
|
||||
if (wdim != m_window_dim) {
|
||||
m_window_dim = wdim;
|
||||
need_update = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "layuiCommon.h"
|
||||
#include "layBrowser.h"
|
||||
#include "layMargin.h"
|
||||
#include "tlColor.h"
|
||||
#include "rdbMarkerBrowser.h"
|
||||
|
||||
|
|
@ -78,7 +79,7 @@ private:
|
|||
Ui::MarkerBrowserDialog *mp_ui;
|
||||
context_mode_type m_context;
|
||||
window_type m_window;
|
||||
double m_window_dim;
|
||||
lay::Margin m_window_dim;
|
||||
unsigned int m_max_marker_count;
|
||||
tl::Color m_marker_color;
|
||||
int m_marker_line_width;
|
||||
|
|
|
|||
|
|
@ -1838,7 +1838,7 @@ MarkerBrowserPage::marker_double_clicked (const QModelIndex &)
|
|||
}
|
||||
|
||||
void
|
||||
MarkerBrowserPage::set_window (rdb::window_type window, double window_dim, rdb::context_mode_type context)
|
||||
MarkerBrowserPage::set_window (rdb::window_type window, const lay::Margin &window_dim, rdb::context_mode_type context)
|
||||
{
|
||||
if (window != m_window || window_dim != m_window_dim || context != m_context) {
|
||||
m_window = window;
|
||||
|
|
@ -2280,15 +2280,17 @@ MarkerBrowserPage::do_update_markers ()
|
|||
|
||||
if (mp_view && ! m_markers_bbox.empty ()) {
|
||||
|
||||
double wdim = m_window_dim.get (m_markers_bbox);
|
||||
|
||||
if (m_window == FitCell) {
|
||||
mp_view->zoom_fit ();
|
||||
} else if (m_window == FitMarker) {
|
||||
mp_view->zoom_box (m_markers_bbox.enlarged (db::DVector (m_window_dim, m_window_dim)));
|
||||
mp_view->zoom_box (m_markers_bbox.enlarged (db::DVector (wdim, wdim)));
|
||||
} else if (m_window == Center) {
|
||||
mp_view->pan_center (m_markers_bbox.p1 () + (m_markers_bbox.p2 () - m_markers_bbox.p1 ()) * 0.5);
|
||||
} else if (m_window == CenterSize) {
|
||||
double w = std::max (m_markers_bbox.width (), m_window_dim);
|
||||
double h = std::max (m_markers_bbox.height (), m_window_dim);
|
||||
double w = std::max (m_markers_bbox.width (), wdim);
|
||||
double h = std::max (m_markers_bbox.height (), wdim);
|
||||
db::DPoint center (m_markers_bbox.p1 () + (m_markers_bbox.p2 () - m_markers_bbox.p1 ()) * 0.5);
|
||||
db::DVector d (w * 0.5, h * 0.5);
|
||||
mp_view->zoom_box (db::DBox (center - d, center + d));
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "ui_MarkerBrowserPage.h"
|
||||
#include "rdbMarkerBrowser.h"
|
||||
#include "layMargin.h"
|
||||
#include "tlDeferredExecution.h"
|
||||
#include "tlColor.h"
|
||||
#include "dbBox.h"
|
||||
|
|
@ -137,7 +138,7 @@ public:
|
|||
/**
|
||||
* @brief Set the window type and window dimensions
|
||||
*/
|
||||
void set_window (rdb::window_type window_type, double window_dim, rdb::context_mode_type context);
|
||||
void set_window (rdb::window_type window_type, const lay::Margin &window_dim, rdb::context_mode_type context);
|
||||
|
||||
/**
|
||||
* @brief Set the maximum number of markers shown in the marker selection list
|
||||
|
|
@ -212,7 +213,7 @@ private:
|
|||
bool m_in_directory_selection_change;
|
||||
rdb::context_mode_type m_context;
|
||||
rdb::window_type m_window;
|
||||
double m_window_dim;
|
||||
lay::Margin m_window_dim;
|
||||
size_t m_max_marker_count;
|
||||
tl::Color m_marker_color;
|
||||
int m_marker_line_width;
|
||||
|
|
|
|||
|
|
@ -1805,7 +1805,10 @@ DXFReader::read_entities (db::Layout &layout, db::Cell &cell, const db::DVector
|
|||
std::list<db::DPoint>::const_iterator ii = i;
|
||||
++ii;
|
||||
while (ii != new_points.end ()) {
|
||||
edges.push_back (safe_from_double (db::DEdge (tt.trans (*i), tt.trans (*ii))));
|
||||
db::Edge edge = safe_from_double (db::DEdge (tt.trans (*i), tt.trans (*ii)));
|
||||
if (! edge.is_degenerate ()) {
|
||||
edges.push_back (edge);
|
||||
}
|
||||
++i;
|
||||
++ii;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1153,8 +1153,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
|||
{
|
||||
while (test ("-")) {
|
||||
|
||||
take (); // pin name
|
||||
|
||||
std::string pin_name = get ();
|
||||
std::string net;
|
||||
std::string dir;
|
||||
std::map <std::pair<std::string, unsigned int>, std::vector <db::Polygon> > geometry;
|
||||
|
|
@ -1281,7 +1280,7 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
|||
if (flush || ! peek ("+")) {
|
||||
|
||||
// TODO: put a label on every single object?
|
||||
std::string label = net;
|
||||
std::string label = pin_name;
|
||||
/* don't add the direction currently, a name is sufficient
|
||||
if (! dir.empty ()) {
|
||||
label += ":";
|
||||
|
|
@ -1296,9 +1295,14 @@ DEFImporter::read_pins (db::Layout &layout, db::Cell &design, double scale)
|
|||
if (! dl.empty ()) {
|
||||
|
||||
db::properties_id_type prop_id = 0;
|
||||
if (produce_pin_props ()) {
|
||||
if (produce_pin_props () || produce_net_props ()) {
|
||||
db::PropertiesRepository::properties_set props;
|
||||
props.insert (std::make_pair (pin_prop_name_id (), tl::Variant (label)));
|
||||
if (produce_pin_props ()) {
|
||||
props.insert (std::make_pair (pin_prop_name_id (), tl::Variant (label)));
|
||||
}
|
||||
if (produce_net_props ()) {
|
||||
props.insert (std::make_pair (net_prop_name_id (), tl::Variant (net)));
|
||||
}
|
||||
prop_id = layout.properties_repository ().properties_id (props);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -326,26 +326,26 @@ TEST(lef8)
|
|||
|
||||
TEST(def1)
|
||||
{
|
||||
run_test (_this, "def1", "lef:in.lef+def:in.def", "au2.oas.gz", default_options ());
|
||||
run_test (_this, "def1", "lef:in.lef+def:in.def", "au2_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def2)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_cell_outline_layer ("OUTLINE (10/0)");
|
||||
run_test (_this, "def2", "lef:0.lef+lef:1.lef+def:in.def.gz", "au.oas.gz", options);
|
||||
run_test (_this, "def2", "lef:0.lef+lef:1.lef+def:in.def.gz", "au_2.oas.gz", options);
|
||||
}
|
||||
|
||||
TEST(def3)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_cell_outline_layer ("OUTLINE (13/0)");
|
||||
run_test (_this, "def3", "lef:in.lef+def:in.def", "au.oas.gz", options);
|
||||
run_test (_this, "def3", "lef:in.lef+def:in.def", "au_2.oas.gz", options);
|
||||
}
|
||||
|
||||
TEST(def4)
|
||||
{
|
||||
run_test (_this, "def4", "lef:in.lef+def:in.def", "au2.oas.gz", default_options ());
|
||||
run_test (_this, "def4", "lef:in.lef+def:in.def", "au2_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def5)
|
||||
|
|
@ -355,17 +355,17 @@ TEST(def5)
|
|||
|
||||
TEST(def6)
|
||||
{
|
||||
run_test (_this, "def6", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new.oas.gz", default_options ());
|
||||
run_test (_this, "def6", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def7)
|
||||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_placement_blockage_layer ("PLACEMENT_BLK (11/0)");
|
||||
run_test (_this, "def7", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new.oas.gz", options);
|
||||
run_test (_this, "def7", "lef:cells.lef+lef:tech.lef+def:in.def.gz", "au-new_2.oas.gz", options);
|
||||
|
||||
options.set_placement_blockage_layer ("PLACEMENT_BLK (60/0)");
|
||||
run_test (_this, "def7", "map:in.map+lef:cells.lef+lef:tech.lef+def:in.def.gz", "au2_with_map_file-new.oas.gz", options);
|
||||
run_test (_this, "def7", "map:in.map+lef:cells.lef+lef:tech.lef+def:in.def.gz", "au2_with_map_file-new_2.oas.gz", options);
|
||||
}
|
||||
|
||||
TEST(def8)
|
||||
|
|
@ -377,9 +377,9 @@ TEST(def9)
|
|||
{
|
||||
db::LEFDEFReaderOptions options = default_options ();
|
||||
options.set_separate_groups (true);
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au-new.oas.gz", options);
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au-new_2.oas.gz", options);
|
||||
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au_nogroups-new.oas.gz", default_options ());
|
||||
run_test (_this, "def9", "lef:tech.lef+lef:cells_modified.lef+def:in.def", "au_nogroups-new_2.oas.gz", default_options ());
|
||||
}
|
||||
|
||||
TEST(def10)
|
||||
|
|
@ -413,7 +413,7 @@ TEST(def14)
|
|||
{
|
||||
db::LEFDEFReaderOptions opt = default_options ();
|
||||
opt.set_macro_resolution_mode (1);
|
||||
run_test (_this, "def14", "map:test.map+lef:tech.lef+lef:stdlib.lef+def:test.def", "au.oas.gz", opt);
|
||||
run_test (_this, "def14", "map:test.map+lef:tech.lef+lef:stdlib.lef+def:test.def", "au_2.oas.gz", opt);
|
||||
}
|
||||
|
||||
TEST(def15)
|
||||
|
|
@ -429,7 +429,7 @@ TEST(def16)
|
|||
// (complete example)
|
||||
db::LEFDEFReaderOptions opt = default_options ();
|
||||
opt.set_macro_resolution_mode (1);
|
||||
run_test (_this, "def16", "lef:a.lef+lef:tech.lef+def:a.def", "au.oas.gz", opt);
|
||||
run_test (_this, "def16", "lef:a.lef+lef:tech.lef+def:a.def", "au_2.oas.gz", opt);
|
||||
}
|
||||
|
||||
TEST(100)
|
||||
|
|
@ -886,6 +886,15 @@ TEST(131_patternname)
|
|||
run_test (_this, "patternname", "map:v.map+lef:v.lef+def:v.def", "au.oas.gz", default_options (), false);
|
||||
}
|
||||
|
||||
TEST(132_issue1307_pin_names)
|
||||
{
|
||||
db::LEFDEFReaderOptions opt = default_options ();
|
||||
opt.set_produce_pin_names (true);
|
||||
opt.set_pin_property_name (2);
|
||||
opt.set_cell_outline_layer ("OUTLINE (13/0)");
|
||||
run_test (_this, "issue-1307c", "lef:in.lef+def:in.def", "au.oas", opt, false);
|
||||
}
|
||||
|
||||
TEST(200_lefdef_plugin)
|
||||
{
|
||||
db::Layout ly;
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,34 @@
|
|||
VERSION 5.7 ;
|
||||
DIVIDERCHAR "/" ;
|
||||
BUSBITCHARS "[]" ;
|
||||
DESIGN test ;
|
||||
UNITS DISTANCE MICRONS 2000 ;
|
||||
|
||||
DIEAREA ( 0 0 ) ( 37520 7840 ) ;
|
||||
|
||||
PINS 12 ;
|
||||
- VDD_PIN + NET VDD + SPECIAL + DIRECTION INOUT + USE POWER
|
||||
+ LAYER M2 ( -320 0 ) ( 320 37520 )
|
||||
+ FIXED ( 37520 3920 ) W ;
|
||||
- VSS_PIN + NET VSS + SPECIAL + DIRECTION INOUT + USE GROUND
|
||||
+ PORT
|
||||
+ LAYER M2 ( -18760 0 ) ( 18760 640 )
|
||||
+ FIXED ( 18760 -320 ) N
|
||||
+ PORT
|
||||
+ LAYER M2 ( -18760 0 ) ( 18760 640 )
|
||||
+ FIXED ( 18760 8160 ) S
|
||||
;
|
||||
END PINS
|
||||
|
||||
SPECIALNETS 4 ;
|
||||
- VSS ( * VSS )
|
||||
+ ROUTED M2 640 + SHAPE FOLLOWPIN ( 0 0 ) ( 37520 * )
|
||||
NEW M2 640 + SHAPE FOLLOWPIN ( 0 7840 ) ( 37520 * )
|
||||
+ USE GROUND
|
||||
;
|
||||
- VDD ( * VDD )
|
||||
+ ROUTED M2 640 + SHAPE FOLLOWPIN ( 0 3920 ) ( 37520 * )
|
||||
+ USE POWER
|
||||
;
|
||||
END SPECIALNETS
|
||||
END DESIGN
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
VERSION 5.7 ;
|
||||
|
||||
BUSBITCHARS "[]" ;
|
||||
DIVIDERCHAR "/" ;
|
||||
UNITS
|
||||
DATABASE MICRONS 1000 ;
|
||||
END UNITS
|
||||
|
||||
MANUFACTURINGGRID 0.002 ;
|
||||
|
||||
USEMINSPACING OBS OFF ;
|
||||
|
||||
LAYER overlap
|
||||
TYPE OVERLAP ;
|
||||
END overlap
|
||||
|
||||
LAYER contact
|
||||
TYPE CUT ;
|
||||
END contact
|
||||
|
||||
LAYER metal1
|
||||
TYPE ROUTING ;
|
||||
DIRECTION HORIZONTAL ;
|
||||
END metal1
|
||||
|
||||
LAYER via1
|
||||
TYPE CUT ;
|
||||
END via1
|
||||
|
||||
LAYER metal2
|
||||
TYPE ROUTING ;
|
||||
DIRECTION VERTICAL ;
|
||||
END metal2
|
||||
|
||||
LAYER via2
|
||||
TYPE CUT ;
|
||||
END via2
|
||||
|
||||
LAYER metal3
|
||||
TYPE ROUTING ;
|
||||
DIRECTION HORIZONTAL ;
|
||||
END metal3
|
||||
|
||||
LAYER via3
|
||||
TYPE CUT ;
|
||||
END via3
|
||||
|
||||
LAYER metal4
|
||||
TYPE ROUTING ;
|
||||
DIRECTION VERTICAL ;
|
||||
END metal4
|
||||
|
||||
LAYER via4
|
||||
TYPE CUT ;
|
||||
END via4
|
||||
|
||||
LAYER metal5
|
||||
TYPE ROUTING ;
|
||||
DIRECTION HORIZONTAL ;
|
||||
END metal5
|
||||
|
||||
|
||||
END LIBRARY
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1102,7 +1102,7 @@ class DBShapes_TestClass < TestBase
|
|||
|
||||
arr = []
|
||||
shapes.each( RBA::Shapes::SAll ) { |s| arr.push( s.to_s ) }
|
||||
assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) prop_id=1"] )
|
||||
assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) f=3 ha=c va=b prop_id=1"] )
|
||||
|
||||
assert_equal( s1.is_valid?, true )
|
||||
assert_equal( s1.shapes.is_valid?(s1), true )
|
||||
|
|
@ -1316,7 +1316,7 @@ class DBShapes_TestClass < TestBase
|
|||
|
||||
arr = []
|
||||
shapes.each( RBA::Shapes::SAll ) { |s| arr.push( s.to_s ) }
|
||||
assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) prop_id=1"] )
|
||||
assert_equal( arr, ["edge (1,2;3,4)", "text ('text',r0 100,200)", "text ('blabla',m0 100,200) f=3 ha=c va=b prop_id=1"] )
|
||||
|
||||
assert_equal( s1.is_valid?, true )
|
||||
assert_equal( s1.shapes.is_valid?(s1), true )
|
||||
|
|
|
|||
|
|
@ -102,20 +102,20 @@ class DBText_TestClass < TestBase
|
|||
|
||||
b = a.dup
|
||||
|
||||
assert_equal( a.moved( RBA::DPoint::new( 0, 1 ) ).to_s, "('hallo',m45 5,8)" )
|
||||
assert_equal( a.moved( RBA::DPoint::new( 0, 1 ) ).to_s, "('hallo',m45 5,8) s=23 f=8 ha=r va=b" )
|
||||
a.move( RBA::DPoint::new( 1, 0 ) )
|
||||
assert_equal( a.to_s, "('hallo',m45 6,7)" )
|
||||
assert_equal( a.to_s, "('hallo',m45 6,7) s=23 f=8 ha=r va=b" )
|
||||
|
||||
b = b.transformed( RBA::DTrans::new( RBA::DTrans::R0, RBA::DPoint::new( 1, 0 )) )
|
||||
assert_equal( b.to_s, "('hallo',m45 6,7)" )
|
||||
assert_equal( b.to_s, "('hallo',m45 6,7) s=23 f=8 ha=r va=b" )
|
||||
|
||||
m = RBA::DCplxTrans::new( RBA::DTrans::new, 1.5 )
|
||||
assert_equal( a.transformed(m).class.to_s, "RBA::DText" )
|
||||
assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5)" )
|
||||
assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5) s=34.5 f=8 ha=r va=b" )
|
||||
|
||||
m = RBA::VCplxTrans::new( 1000.0 )
|
||||
assert_equal( a.transformed(m).class.to_s, "RBA::Text" )
|
||||
assert_equal( a.transformed(m).to_s, "('hallo',m45 6000,7000)" )
|
||||
assert_equal( a.transformed(m).to_s, "('hallo',m45 6000,7000) s=23000 f=8 ha=r va=b" )
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -196,16 +196,16 @@ class DBText_TestClass < TestBase
|
|||
|
||||
b = a.dup
|
||||
|
||||
assert_equal( a.moved( RBA::Point::new( 0, 1 ) ).to_s, "('hallo',m45 5,8)" )
|
||||
assert_equal( a.moved( RBA::Point::new( 0, 1 ) ).to_s, "('hallo',m45 5,8) s=23 f=8 ha=l va=t" )
|
||||
a.move( RBA::Point::new( 1, 0 ) )
|
||||
assert_equal( a.to_s, "('hallo',m45 6,7)" )
|
||||
assert_equal( a.to_s, "('hallo',m45 6,7) s=23 f=8 ha=l va=t" )
|
||||
|
||||
b = b.transformed( RBA::Trans::new( RBA::Trans::R0, RBA::Point::new( 1, 0 )) )
|
||||
assert_equal( b.to_s, "('hallo',m45 6,7)" )
|
||||
assert_equal( b.to_s, "('hallo',m45 6,7) s=23 f=8 ha=l va=t" )
|
||||
|
||||
m = RBA::CplxTrans::new( RBA::Trans::new, 1.5 )
|
||||
assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5)" )
|
||||
assert_equal( a.transformed(RBA::ICplxTrans::new(m)).to_s, "('hallo',m45 9,11)" )
|
||||
assert_equal( a.transformed(m).to_s, "('hallo',m45 9,10.5) s=34.5 f=8 ha=l va=t" )
|
||||
assert_equal( a.transformed(RBA::ICplxTrans::new(m)).to_s, "('hallo',m45 9,11) s=35 f=8 ha=l va=t" )
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue