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

Method finishAdding_

src/openms_gui/source/VISUAL/Plot2DCanvas.cpp:235–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 }
234
235 bool Plot2DCanvas::finishAdding_()
236 {
237 // deselect all peaks
238 selected_peak_.clear();
239 measurement_start_.clear();
240
241 auto& layer = getCurrentLayer();
242 layer.updateRanges(); // required for minIntensity() below and hasRange()
243 if (layer.getRange().hasRange() == HasRangeType::NONE)
244 {
245 popIncompleteLayer_("Cannot add a dataset that contains no data. Aborting!");
246 return false;
247 }
248 // overall values update
249 recalculateRanges_();
250
251 // pick dimensions to show (based on data)
252
253
254 update_buffer_ = true;
255
256 if (getLayerCount() == 1)
257 {
258 resetZoom(false); //no repaint as this is done in intensityModeChange_() anyway
259 }
260 else if (getLayerCount() == 2)
261 {
262 setIntensityMode(IM_PERCENTAGE);
263 }
264 intensityModeChange_();
265
266 emit layerActivated(this);
267
268 // warn if negative intensities are contained
269 if (getCurrentMinIntensity() < 0)
270 {
271 QMessageBox::warning(this, "Warning", "This dataset contains negative intensities. Use it at your own risk!");
272 }
273
274 return true;
275 }
276
277 void Plot2DCanvas::removeLayer(Size layer_index)
278 {

Callers

nothing calls this directly

Calls 9

recalculateRanges_Function · 0.85
getLayerCountFunction · 0.85
resetZoomFunction · 0.85
setIntensityModeFunction · 0.85
getCurrentMinIntensityFunction · 0.85
hasRangeMethod · 0.80
getRangeMethod · 0.80
clearMethod · 0.45
updateRangesMethod · 0.45

Tested by

no test coverage detected