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

Method merge_dither_pattern

src/laybasic/laybasic/layLayoutViewBase.cc:1890–1940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1888}
1889
1890void
1891LayoutViewBase::merge_dither_pattern (lay::LayerPropertiesList &props)
1892{
1893 {
1894 lay::DitherPattern dp (dither_pattern ());
1895
1896 std::map <unsigned int, unsigned int> index_map;
1897 dp.merge (props.dither_pattern (), index_map);
1898
1899 // remap the dither pattern index
1900 for (lay::LayerPropertiesIterator l = props.begin_recursive (); l != props.end_recursive (); ++l) {
1901 int dpi = l->dither_pattern (false /*local*/);
1902 std::map <unsigned int, unsigned int>::iterator m = index_map.find ((unsigned int) dpi);
1903 if (m != index_map.end ()) {
1904 l->set_dither_pattern (int (m->second));
1905 }
1906 }
1907
1908 // install the new custom pattern table
1909 if (mp_canvas->dither_pattern () != dp) {
1910 mp_canvas->set_dither_pattern (dp);
1911 for (unsigned int i = 0; i < layer_lists (); ++i) {
1912 m_layer_properties_lists [i]->set_dither_pattern (dp);
1913 }
1914 }
1915 }
1916
1917 {
1918 lay::LineStyles ls (line_styles ());
1919
1920 std::map <unsigned int, unsigned int> index_map;
1921 ls.merge (props.line_styles (), index_map);
1922
1923 // remap the dither pattern index
1924 for (lay::LayerPropertiesIterator l = props.begin_recursive (); l != props.end_recursive (); ++l) {
1925 int lsi = l->line_style (false /*local*/);
1926 std::map <unsigned int, unsigned int>::iterator m = index_map.find ((unsigned int) lsi);
1927 if (m != index_map.end ()) {
1928 l->set_line_style (int (m->second));
1929 }
1930 }
1931
1932 // install the new custom pattern table
1933 if (mp_canvas->line_styles () != ls) {
1934 mp_canvas->set_line_styles (ls);
1935 for (unsigned int i = 0; i < layer_lists (); ++i) {
1936 m_layer_properties_lists [i]->set_line_styles (ls);
1937 }
1938 }
1939 }
1940}
1941
1942bool
1943LayoutViewBase::always_show_source () const

Callers

nothing calls this directly

Calls 12

dither_patternFunction · 0.85
layer_listsFunction · 0.85
dither_patternMethod · 0.80
begin_recursiveMethod · 0.80
end_recursiveMethod · 0.80
line_styleMethod · 0.80
mergeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
set_dither_patternMethod · 0.45
set_line_styleMethod · 0.45
set_line_stylesMethod · 0.45

Tested by

no test coverage detected