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

Method remove_unused_layers

src/laybasic/laybasic/layLayoutViewBase.cc:5717–5743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5715}
5716
5717void
5718LayoutViewBase::remove_unused_layers ()
5719{
5720 bool any_deleted;
5721 do {
5722
5723 std::vector <lay::LayerPropertiesConstIterator> sel;
5724
5725 lay::LayerPropertiesConstIterator l = begin_layers ();
5726 while (! l.at_end ()) {
5727 if (! l->has_children () && l->bbox ().empty ()) {
5728 sel.push_back (l);
5729 }
5730 ++l;
5731 }
5732
5733 std::sort (sel.begin (), sel.end (), CompareLayerIteratorBottomUp ());
5734 any_deleted = false;
5735 for (std::vector<lay::LayerPropertiesConstIterator>::iterator s = sel.begin (); s != sel.end (); ++s) {
5736 delete_layer (*s);
5737 any_deleted = true;
5738 }
5739
5740 } while (any_deleted);
5741
5742 emit_layer_order_changed ();
5743}
5744
5745void
5746LayoutViewBase::add_missing_layers ()

Callers 2

cm_remove_unusedMethod · 0.80
cm_remove_unusedMethod · 0.80

Calls 11

sortFunction · 0.85
delete_layerFunction · 0.85
begin_layersFunction · 0.70
emit_layer_order_changedFunction · 0.70
at_endMethod · 0.45
has_childrenMethod · 0.45
emptyMethod · 0.45
bboxMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected