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

Method add_style

src/laybasic/laybasic/layLineStyles.cc:474–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474unsigned int
475LineStyles::add_style (const LineStyleInfo &p)
476{
477 unsigned int oi = 0;
478 lay::LineStyles::iterator iempty = end ();
479 for (lay::LineStyles::iterator i = begin_custom (); i != end (); ++i) {
480 if (i->order_index () == 0) {
481 iempty = i;
482 } else if (i->order_index () > oi) {
483 oi = i->order_index ();
484 }
485 }
486
487 unsigned int index = std::distance (begin (), iempty);
488
489 // NOTE: doing it this way will enable undo/redo because replace_pattern
490 // is undo/redo enabled.
491 LineStyleInfo pdup = p;
492 pdup.set_order_index (oi + 1);
493 replace_style (index, pdup);
494
495 return index;
496}
497
498namespace {
499 struct display_order

Callers 3

new_button_clickedMethod · 0.80
add_line_style1Function · 0.80
add_line_style2Function · 0.80

Calls 3

endFunction · 0.70
beginFunction · 0.70
distanceFunction · 0.50

Tested by

no test coverage detected