Skip to content

Commit

Permalink
Merge branch 'extended-transient-selection-config'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koefferlein committed Nov 30, 2024
2 parents 637660c + abe5785 commit 6861b68
Show file tree
Hide file tree
Showing 7 changed files with 400 additions and 59 deletions.
25 changes: 17 additions & 8 deletions src/edt/edt/edtService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1192,8 +1192,11 @@ Service::transient_select (const db::DPoint &pos)
marker->set_vertex_shape (lay::ViewOp::Cross);
marker->set_vertex_size (9 /*cross vertex size*/);
marker->set (inst, gt, tv);
marker->set_line_width (1);
marker->set_halo (0);
marker->set_line_width (view ()->default_transient_marker_line_width ());
marker->set_halo (view ()->default_transient_marker_halo ());
marker->set_color (view ()->default_transient_marker_color ());
marker->set_dither_pattern (view ()->default_transient_dither_pattern ());
marker->set_line_style (view ()->default_transient_line_style ());
marker->set_text_enabled (false);

mp_transient_marker = marker;
Expand All @@ -1205,9 +1208,12 @@ Service::transient_select (const db::DPoint &pos)
lay::Marker *marker = new lay::Marker (view (), r->cv_index ());
db::box_convert<db::CellInst> bc (cv->layout ());
marker->set (bc (r->back ().inst_ptr.cell_inst ().object ()), gt * r->back ().inst_ptr.cell_inst ().complex_trans (*r->back ().array_inst), tv);
marker->set_vertex_size (0);
marker->set_line_width (1);
marker->set_halo (0);
marker->set_vertex_size (view ()->default_transient_marker_vertex_size ());
marker->set_line_width (view ()->default_transient_marker_line_width ());
marker->set_halo (view ()->default_transient_marker_halo ());
marker->set_color (view ()->default_transient_marker_color ());
marker->set_dither_pattern (view ()->default_transient_dither_pattern ());
marker->set_line_style (view ()->default_transient_line_style ());

mp_transient_marker = marker;

Expand Down Expand Up @@ -1258,10 +1264,13 @@ Service::transient_select (const db::DPoint &pos)
marker->set_vertex_shape (lay::ViewOp::Cross);
marker->set_vertex_size (9 /*cross vertex size*/);
} else {
marker->set_vertex_size (0);
marker->set_vertex_size (view ()->default_transient_marker_vertex_size ());
}
marker->set_line_width (1);
marker->set_halo (0);
marker->set_line_width (view ()->default_transient_marker_line_width ());
marker->set_halo (view ()->default_transient_marker_halo ());
marker->set_color (view ()->default_transient_marker_color ());
marker->set_dither_pattern (view ()->default_transient_dither_pattern ());
marker->set_line_style (view ()->default_transient_line_style ());

mp_transient_marker = marker;

Expand Down
83 changes: 83 additions & 0 deletions src/laybasic/laybasic/layLayoutViewBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ LayoutViewBase::init (db::Manager *mgr)
m_marker_dither_pattern = 1;
m_marker_line_style = 0;
m_marker_halo = true;
m_transient_marker_line_width = 0;
m_transient_marker_vertex_size = 0;
m_transient_marker_dither_pattern = 1;
m_transient_marker_line_style = 0;
m_transient_marker_halo = true;
m_transient_selection_mode = true;
m_sel_inside_pcells = false;
m_add_other_layers = false;
Expand Down Expand Up @@ -1301,6 +1306,84 @@ LayoutViewBase::configure (const std::string &name, const std::string &value)
// do not take - let others receive this configuration as well
return false;

} else if (name == cfg_transient_sel_color) {

tl::Color color;
lay::ColorConverter ().from_string (value, color);

// Change the color
if (lay::test_and_set (m_transient_marker_color, color)) {
mp_canvas->update_image ();
}

// do not take - let others receive this configuration as well
return false;

} else if (name == cfg_transient_sel_line_width) {

int lw = 0;
tl::from_string (value, lw);

// Change the line width
if (lay::test_and_set (m_transient_marker_line_width, lw)) {
mp_canvas->update_image ();
}

// do not take - let others receive this configuration as well
return false;

} else if (name == cfg_transient_sel_dither_pattern) {

int dp = 0;
tl::from_string (value, dp);

// Change the vertex_size
if (lay::test_and_set (m_transient_marker_dither_pattern, dp)) {
mp_canvas->update_image ();
}

// do not take - let others receive this configuration as well
return false;

} else if (name == cfg_transient_sel_line_style) {

int dp = 0;
tl::from_string (value, dp);

// Change the vertex_size
if (lay::test_and_set (m_transient_marker_line_style, dp)) {
mp_canvas->update_image ();
}

// do not take - let others receive this configuration as well
return false;

} else if (name == cfg_transient_sel_vertex_size) {

int vs = 0;
tl::from_string (value, vs);

// Change the vertex_size
if (lay::test_and_set (m_transient_marker_vertex_size, vs)) {
mp_canvas->update_image ();
}

// do not take - let others receive this configuration as well
return false;

} else if (name == cfg_transient_sel_halo) {

bool halo = 0;
tl::from_string (value, halo);

// Change the vertex_size
if (lay::test_and_set (m_transient_marker_halo, halo)) {
mp_canvas->update_image ();
}

// do not take - let others receive this configuration as well
return false;

} else {
return false;
}
Expand Down
56 changes: 56 additions & 0 deletions src/laybasic/laybasic/layLayoutViewBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -2347,6 +2347,55 @@ class LAYBASIC_PUBLIC LayoutViewBase :
return m_marker_halo;
}


/**
* @brief Get the default color for markers
*/
tl::Color default_transient_marker_color () const
{
return m_transient_marker_color;
}

/**
* @brief Get the default line width for markers
*/
int default_transient_marker_line_width () const
{
return m_transient_marker_line_width;
}

/**
* @brief Get the default marker dither pattern index
*/
int default_transient_dither_pattern () const
{
return m_transient_marker_dither_pattern;
}

/**
* @brief Get the default marker line style index
*/
int default_transient_line_style () const
{
return m_transient_marker_line_style;
}

/**
* @brief Get the default vertex size for markers
*/
int default_transient_marker_vertex_size () const
{
return m_transient_marker_vertex_size;
}

/**
* @brief Get the default halo flag for markers
*/
int default_transient_marker_halo () const
{
return m_transient_marker_halo;
}

/**
* @brief Gets the "search range" in pixels (for single click)
* The search range applies whenever some object is looked up in the vicinity of the
Expand Down Expand Up @@ -2845,6 +2894,13 @@ class LAYBASIC_PUBLIC LayoutViewBase :
int m_marker_line_style;
bool m_marker_halo;

tl::Color m_transient_marker_color;
int m_transient_marker_line_width;
int m_transient_marker_vertex_size;
int m_transient_marker_dither_pattern;
int m_transient_marker_line_style;
bool m_transient_marker_halo;

unsigned int m_search_range;
unsigned int m_search_range_box;

Expand Down
6 changes: 6 additions & 0 deletions src/laybasic/laybasic/layLayoutViewConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class LayoutViewBasicConfigDeclaration
options.push_back (std::pair<std::string, std::string> (cfg_sel_dither_pattern, "1"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_line_style, "0"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_halo, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_transient_sel_color, cc.to_string (tl::Color ())));
options.push_back (std::pair<std::string, std::string> (cfg_transient_sel_line_width, "1"));
options.push_back (std::pair<std::string, std::string> (cfg_transient_sel_vertex_size, "0"));
options.push_back (std::pair<std::string, std::string> (cfg_transient_sel_dither_pattern, "-1")); // no specific one
options.push_back (std::pair<std::string, std::string> (cfg_transient_sel_line_style, "-1")); // no specific one
options.push_back (std::pair<std::string, std::string> (cfg_transient_sel_halo, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_transient_mode, "true"));
options.push_back (std::pair<std::string, std::string> (cfg_sel_inside_pcells_mode, "false"));
options.push_back (std::pair<std::string, std::string> (cfg_tracking_cursor_enabled, "true"));
Expand Down
6 changes: 6 additions & 0 deletions src/laybasic/laybasic/laybasicConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ static const std::string cfg_sel_vertex_size ("sel-vertex-size");
static const std::string cfg_sel_halo ("sel-halo");
static const std::string cfg_sel_dither_pattern ("sel-dither-pattern");
static const std::string cfg_sel_line_style ("sel-line-style");
static const std::string cfg_transient_sel_color ("transient-sel-color");
static const std::string cfg_transient_sel_line_width ("transient-sel-line-width");
static const std::string cfg_transient_sel_vertex_size ("transient-sel-vertex-size");
static const std::string cfg_transient_sel_halo ("transient-sel-halo");
static const std::string cfg_transient_sel_dither_pattern ("transient-sel-dither-pattern");
static const std::string cfg_transient_sel_line_style ("transient-sel-line-style");
static const std::string cfg_sel_transient_mode ("sel-transient-mode");
static const std::string cfg_sel_inside_pcells_mode ("sel-inside-pcells-mode");

Expand Down
Loading

0 comments on commit 6861b68

Please sign in to comment.