MCPcopy Create free account
hub / github.com/KLayout/klayout / ascend

Method ascend

src/laybasic/laybasic/layLayoutViewBase.cc:6261–6311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6259}
6260
6261db::InstElement
6262LayoutViewBase::ascend (int index)
6263{
6264 tl_assert (int (m_cellviews.size ()) > index && cellview_iter (index)->is_valid ());
6265
6266 lay::CellView &cv = *cellview_iter (index);
6267
6268 cellview_about_to_change_event (index);
6269
6270 lay::CellView::specific_cell_path_type spath (cv.specific_path ());
6271 if (spath.empty ()) {
6272
6273 lay::CellView::unspecific_cell_path_type upath (cv.unspecific_path ());
6274 if (upath.size () >= 2) {
6275
6276 db::cell_index_type last = upath.back ();
6277 upath.pop_back ();
6278 const db::Cell &new_cell = cv->layout ().cell (upath.back ());
6279
6280 auto i = new_cell.begin ();
6281 while (! i.at_end () && i->cell_index () != last) {
6282 ++i;
6283 }
6284
6285 if (! i.at_end ()) {
6286 select_cell_dispatch (upath, index);
6287 return db::InstElement (*i);
6288 }
6289
6290 }
6291
6292 return db::InstElement ();
6293
6294 } else {
6295
6296 cancel ();
6297 db::InstElement ret = spath.back ();
6298 spath.pop_back ();
6299 cv.set_specific_path (spath);
6300
6301 store_state ();
6302 redraw ();
6303
6304 cellview_changed (index);
6305
6306 update_content ();
6307
6308 return ret;
6309
6310 }
6311}
6312
6313void
6314LayoutViewBase::descend (const std::vector<db::InstElement> &path, int index)

Callers 4

test_2Method · 0.45
cm_ascendMethod · 0.45
tspathFunction · 0.45
cv_ascendFunction · 0.45

Calls 15

InstElementFunction · 0.85
store_stateFunction · 0.85
redrawFunction · 0.85
set_specific_pathMethod · 0.80
cancelFunction · 0.70
sizeMethod · 0.45
is_validMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45
cellMethod · 0.45
layoutMethod · 0.45

Tested by 2

test_2Method · 0.36
tspathFunction · 0.36