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

Method add_pattern

src/laybasic/laybasic/layDitherPattern.cc:1045–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1043}
1044
1045unsigned int
1046DitherPattern::add_pattern (const DitherPatternInfo &p)
1047{
1048 unsigned int oi = 0;
1049 lay::DitherPattern::iterator iempty = end ();
1050 for (lay::DitherPattern::iterator i = begin_custom (); i != end (); ++i) {
1051 if (i->order_index () == 0) {
1052 iempty = i;
1053 } else if (i->order_index () > oi) {
1054 oi = i->order_index ();
1055 }
1056 }
1057
1058 unsigned int index = std::distance (begin (), iempty);
1059
1060 // NOTE: doing it this way will enable undo/redo because replace_pattern
1061 // is undo/redo enabled.
1062 DitherPatternInfo pdup = p;
1063 pdup.set_order_index (oi + 1);
1064 replace_pattern (index, pdup);
1065
1066 return index;
1067}
1068
1069void
1070DitherPattern::scale_pattern (unsigned int n)

Callers 4

new_button_clickedMethod · 0.80
pasteMethod · 0.80
add_stipple1Function · 0.80
add_stipple2Function · 0.80

Calls 3

endFunction · 0.70
beginFunction · 0.70
distanceFunction · 0.50

Tested by

no test coverage detected