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

Method add_missing_layers

src/laybasic/laybasic/layLayoutViewBase.cc:5745–5780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5743}
5744
5745void
5746LayoutViewBase::add_missing_layers ()
5747{
5748 std::set <lay::ParsedLayerSource> present;
5749 LayerPropertiesConstIterator l = begin_layers ();
5750 while (! l.at_end ()) {
5751 if (! l->has_children ()) {
5752 present.insert (l->source (true /*real*/));
5753 }
5754 ++l;
5755 }
5756
5757 std::vector <lay::ParsedLayerSource> actual;
5758 for (unsigned int cv = 0; cv < cellviews (); ++cv) {
5759 const db::Layout &layout = cellview (cv)->layout ();
5760 for (unsigned int l = 0; l < layout.layers (); ++l) {
5761 if (layout.is_valid_layer (l)) {
5762 actual.push_back (lay::ParsedLayerSource (layout.get_properties (l), cv));
5763 }
5764 }
5765 }
5766
5767 std::sort (actual.begin (), actual.end ());
5768
5769 for (std::vector <lay::ParsedLayerSource>::const_iterator a = actual.begin (); a != actual.end (); ++a) {
5770 if (present.find (*a) == present.end ()) {
5771 lay::LayerPropertiesNode node;
5772 node.attach_view (this, current_layer_list ());
5773 node.set_source (*a);
5774 init_layer_properties (node);
5775 insert_layer (end_layers (), node);
5776 }
5777 }
5778
5779 emit_layer_order_changed ();
5780}
5781
5782LayerState
5783LayoutViewBase::layer_snapshot () const

Callers 2

cm_add_missingMethod · 0.80
export_netsMethod · 0.80

Calls 15

cellviewsFunction · 0.85
sortFunction · 0.85
current_layer_listFunction · 0.85
get_propertiesMethod · 0.80
begin_layersFunction · 0.70
end_layersFunction · 0.70
emit_layer_order_changedFunction · 0.70
at_endMethod · 0.45
has_childrenMethod · 0.45
insertMethod · 0.45
sourceMethod · 0.45
layoutMethod · 0.45

Tested by

no test coverage detected