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

Method delete_layer

src/laybasic/laybasic/layLayoutViewBase.cc:2166–2198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2164}
2165
2166void
2167LayoutViewBase::delete_layer (unsigned int index, LayerPropertiesConstIterator &iter)
2168{
2169 if (index >= layer_lists ()) {
2170 return;
2171 }
2172
2173 lay::LayerPropertiesNode orig = *iter;
2174
2175 if (index == current_layer_list ()) {
2176 begin_layer_updates ();
2177 }
2178
2179 // delete the element
2180 m_layer_properties_lists [index]->erase (LayerPropertiesIterator (*m_layer_properties_lists [index], iter.uint ()));
2181
2182 if (transacting ()) {
2183 manager ()->queue (this, new OpDeleteLayerProps (index, (unsigned int) iter.uint (), orig));
2184 } else if (manager () && ! replaying ()) {
2185 manager ()->clear ();
2186 }
2187
2188 // signal to the observers that something has changed
2189 if (index == current_layer_list ()) {
2190 end_layer_updates ();
2191 layer_list_changed_event (2);
2192 redraw_later ();
2193 m_prop_changed = true;
2194 }
2195
2196 // invalidate the iterator so it can be used to refer to the next element
2197 iter.invalidate ();
2198}
2199
2200void
2201LayoutViewBase::save_as (unsigned int index, const std::string &filename, tl::OutputStream::OutputStreamMode om, const db::SaveLayoutOptions &options, bool update, int keep_backups)

Callers 7

do_deleteMethod · 0.45
cm_groupMethod · 0.45
cm_ungroupMethod · 0.45
cm_delete_layerMethod · 0.45
delete_layers1Function · 0.45
delete_layers2Function · 0.45
eraseMethod · 0.45

Calls 10

layer_listsFunction · 0.85
current_layer_listFunction · 0.85
LayerPropertiesIteratorFunction · 0.70
transactingFunction · 0.70
managerFunction · 0.70
replayingFunction · 0.50
eraseMethod · 0.45
queueMethod · 0.45
clearMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected