| 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 | { |
no test coverage detected