MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / removeLayer

Method removeLayer

src/openms_gui/source/VISUAL/PlotCanvas.cpp:914–927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912 }
913
914 void LayerStack::removeLayer(Size layer_index)
915 {
916 if (layer_index >= layers_.size())
917 {
918 throw Exception::IndexOverflow(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, layer_index, layers_.size());
919 }
920 layers_.erase(layers_.begin() + layer_index);
921
922 // update current layer if it became invalid TODO dont you have to adjust the index to stay on the same layer??
923 if (current_layer_ >= getLayerCount())
924 {
925 current_layer_ = getLayerCount() - 1; // overflow is intentional
926 }
927 }
928
929 void LayerStack::removeCurrentLayer()
930 {

Callers 2

contextMenuEventMethod · 0.45

Calls 4

getLayerCountFunction · 0.85
sizeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected