Skip to content

Commit 19dc5e8

Browse files
author
Matthias Koefferlein
committed
Implemented a solution for #2180
Implements a new option to show/hide unresolved references (ghost cells). The option is found in "Display/Cells" in the Setup dialog and also in the View menu.
1 parent 0016710 commit 19dc5e8

File tree

8 files changed

+69
-11
lines changed

8 files changed

+69
-11
lines changed

src/lay/lay/layMainWindow.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,6 +4489,7 @@ class MainWindowPluginDeclaration
44894489
menu_entries.push_back (lay::config_menu_item ("show_markers", at, tl::to_string (QObject::tr ("Show Markers")), cfg_markers_visible, "?"));
44904490
menu_entries.push_back (lay::config_menu_item ("show_texts", at, tl::to_string (QObject::tr ("Show Texts")), cfg_text_visible, "?"));
44914491
menu_entries.push_back (lay::config_menu_item ("show_cell_boxes", at, tl::to_string (QObject::tr ("Show Cell Frames")), cfg_cell_box_visible, "?"));
4492+
menu_entries.push_back (lay::config_menu_item ("show_ghost_cells", at, tl::to_string (QObject::tr ("Show Unresolved References")), cfg_ghost_cells_visible, "?"));
44924493
menu_entries.push_back (lay::config_menu_item ("no_stipples", at, tl::to_string (QObject::tr ("Show Layers Without Fill")), cfg_no_stipple, "?"));
44934494
menu_entries.push_back (lay::config_menu_item ("synchronized_views", at, tl::to_string (QObject::tr ("Synchronized Views")), cfg_synchronized_views, "?"));
44944495
menu_entries.push_back (lay::config_menu_item ("edit_top_level_selection:edit_mode", at, tl::to_string (QObject::tr ("Select Top Level Objects")), edt::cfg_edit_top_level_selection, "?"));

src/laybasic/laybasic/layLayoutViewBase.cc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ LayoutViewBase::init (db::Manager *mgr)
343343
m_box_font = 0;
344344
m_min_size_for_label = 16;
345345
m_cell_box_visible = true;
346+
m_ghost_cells_visible = true;
346347
m_text_visible = true;
347348
m_default_font_size = lay::FixedFont::default_font_size ();
348349
m_text_lazy_rendering = true;
@@ -958,6 +959,13 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
958959
cell_box_visible (flag);
959960
return true;
960961

962+
} else if (name == cfg_ghost_cells_visible) {
963+
964+
bool flag;
965+
tl::from_string (value, flag);
966+
ghost_cells_visible (flag);
967+
return true;
968+
961969
} else if (name == cfg_cell_box_color) {
962970

963971
tl::Color color;
@@ -4328,7 +4336,7 @@ LayoutViewBase::set_view_ops ()
43284336
}
43294337

43304338
// ghost cells
4331-
if (m_cell_box_visible) { // @@@
4339+
if (m_ghost_cells_visible) {
43324340

43334341
lay::ViewOp vop, vopv;
43344342

@@ -5422,7 +5430,16 @@ LayoutViewBase::cell_box_visible (bool vis)
54225430
}
54235431
}
54245432

5425-
void
5433+
void
5434+
LayoutViewBase::ghost_cells_visible (bool vis)
5435+
{
5436+
if (m_ghost_cells_visible != vis) {
5437+
m_ghost_cells_visible = vis;
5438+
update_content ();
5439+
}
5440+
}
5441+
5442+
void
54265443
LayoutViewBase::text_font (unsigned int f)
54275444
{
54285445
if (m_text_font != f) {

src/laybasic/laybasic/layLayoutViewBase.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,19 @@ class LAYBASIC_PUBLIC LayoutViewBase :
11151115
return m_cell_box_visible;
11161116
}
11171117

1118+
/**
1119+
* @brief Visibility of ghost cells
1120+
*/
1121+
void ghost_cells_visible (bool vis);
1122+
1123+
/**
1124+
* @brief Visibility of ghost cells
1125+
*/
1126+
bool ghost_cells_visible () const
1127+
{
1128+
return m_ghost_cells_visible;
1129+
}
1130+
11181131
/**
11191132
* @brief Min instance label size setter
11201133
*/
@@ -2910,6 +2923,7 @@ class LAYBASIC_PUBLIC LayoutViewBase :
29102923
unsigned int m_box_font;
29112924
int m_min_size_for_label;
29122925
bool m_cell_box_visible;
2926+
bool m_ghost_cells_visible;
29132927

29142928
tl::Color m_marker_color;
29152929
int m_marker_line_width;

src/laybasic/laybasic/layLayoutViewConfig.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class LayoutViewBasicConfigDeclaration
5959
options.push_back (std::pair<std::string, std::string> (cfg_cell_box_text_transform, "true"));
6060
options.push_back (std::pair<std::string, std::string> (cfg_cell_box_color, "auto"));
6161
options.push_back (std::pair<std::string, std::string> (cfg_cell_box_visible, "true"));
62+
options.push_back (std::pair<std::string, std::string> (cfg_ghost_cells_visible, "true"));
6263
options.push_back (std::pair<std::string, std::string> (cfg_text_color, "auto"));
6364
options.push_back (std::pair<std::string, std::string> (cfg_text_visible, "true"));
6465
options.push_back (std::pair<std::string, std::string> (cfg_text_lazy_rendering, "true"));

src/laybasic/laybasic/layRedrawThreadWorker.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ RedrawThreadWorker::draw_boxes_impl (bool drawing_context, db::cell_index_type c
841841
// paint the box on this level
842842
draw_cell (drawing_context, level, trans, bbox, empty_cell, mp_layout->display_name (ci));
843843

844-
} else if (! for_ghosts && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
844+
} else if (! for_ghosts && ! cell.is_ghost_cell () && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
845845

846846
// paint the box on this level
847847
draw_cell (drawing_context, level, trans, bbox, empty_cell, mp_layout->display_name (ci));
@@ -1003,7 +1003,7 @@ RedrawThreadWorker::draw_box_properties (bool drawing_context, db::cell_index_ty
10031003
void
10041004
RedrawThreadWorker::draw_box_properties_for_ghosts (bool drawing_context, db::cell_index_type ci, const db::CplxTrans &trans, const std::vector<db::Box> &vp, int level)
10051005
{
1006-
draw_box_properties_impl (drawing_context, ci, trans, vp, level, false);
1006+
draw_box_properties_impl (drawing_context, ci, trans, vp, level, true);
10071007
}
10081008

10091009
void
@@ -1057,7 +1057,7 @@ RedrawThreadWorker::draw_box_properties_impl (bool drawing_context, db::cell_ind
10571057
// paint the box on this level
10581058
draw_cell_properties (drawing_context, level, trans, bbox, prop_id);
10591059

1060-
} else if (! for_ghosts && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
1060+
} else if (! for_ghosts && ! cell.is_ghost_cell () && (level == m_to_level || (m_cv_index < int (m_hidden_cells.size ()) && m_hidden_cells [m_cv_index].find (ci) != m_hidden_cells [m_cv_index].end ()))) {
10611061

10621062
// paint the box on this level
10631063
draw_cell_properties (drawing_context, level, trans, bbox, prop_id);

src/laybasic/laybasic/laybasicConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ static const std::string cfg_cell_box_text_font ("inst-label-font");
9595
static const std::string cfg_cell_box_text_transform ("inst-label-transform");
9696
static const std::string cfg_cell_box_color ("inst-color");
9797
static const std::string cfg_cell_box_visible ("inst-visible");
98+
static const std::string cfg_ghost_cells_visible ("ghost-cells-visible");
9899
static const std::string cfg_text_color ("text-color");
99100
static const std::string cfg_text_visible ("text-visible");
100101
static const std::string cfg_text_lazy_rendering ("text-lazy-rendering");

src/layui/layui/LayoutViewConfigPage2a.ui

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>631</width>
10-
<height>320</height>
9+
<width>656</width>
10+
<height>397</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -20,13 +20,33 @@
2020
<property name="margin" stdset="0">
2121
<number>9</number>
2222
</property>
23+
<item>
24+
<widget class="QCheckBox" name="cell_boxes_visible">
25+
<property name="text">
26+
<string>Show cell boxes</string>
27+
</property>
28+
<property name="checked">
29+
<bool>true</bool>
30+
</property>
31+
</widget>
32+
</item>
33+
<item>
34+
<widget class="QCheckBox" name="ghost_cells_visible">
35+
<property name="text">
36+
<string>Show unresolved references (ghost cells) </string>
37+
</property>
38+
<property name="checked">
39+
<bool>true</bool>
40+
</property>
41+
</widget>
42+
</item>
2343
<item>
2444
<widget class="QGroupBox" name="cell_group">
2545
<property name="title">
26-
<string>Show cell boxes</string>
46+
<string>Cell box appearance</string>
2747
</property>
2848
<property name="checkable">
29-
<bool>true</bool>
49+
<bool>false</bool>
3050
</property>
3151
<layout class="QGridLayout">
3252
<property name="margin" stdset="0">

src/layui/layui/layLayoutViewConfigPages.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ LayoutViewConfigPage2a::setup (lay::Dispatcher *root)
207207
mp_ui->cell_xform_text_cbx->setChecked (flag);
208208

209209
root->config_get (cfg_cell_box_visible, flag);
210-
mp_ui->cell_group->setChecked (flag);
210+
mp_ui->cell_boxes_visible->setChecked (flag);
211+
212+
root->config_get (cfg_ghost_cells_visible, flag);
213+
mp_ui->ghost_cells_visible->setChecked (flag);
211214

212215
int font = 0;
213216
root->config_get (cfg_cell_box_text_font, font);
@@ -247,7 +250,8 @@ LayoutViewConfigPage2a::commit (lay::Dispatcher *root)
247250
root->config_set (cfg_cell_box_text_transform, mp_ui->cell_xform_text_cbx->isChecked ());
248251
root->config_set (cfg_cell_box_text_font, mp_ui->cell_font_cb->currentIndex ());
249252
root->config_set (cfg_cell_box_color, mp_ui->cell_box_color_pb->get_color (), ColorConverter ());
250-
root->config_set (cfg_cell_box_visible, mp_ui->cell_group->isChecked ());
253+
root->config_set (cfg_cell_box_visible, mp_ui->cell_boxes_visible->isChecked ());
254+
root->config_set (cfg_ghost_cells_visible, mp_ui->ghost_cells_visible->isChecked ());
251255

252256
root->config_set (cfg_guiding_shape_visible, mp_ui->pcell_gs_group->isChecked ());
253257
root->config_set (cfg_guiding_shape_line_width, mp_ui->pcell_gs_lw->value ());

0 commit comments

Comments
 (0)