| 80 | } |
| 81 | |
| 82 | bool Plot3DCanvas::finishAdding_() |
| 83 | { |
| 84 | if (layers_.getCurrentLayer().type != LayerDataBase::DT_PEAK) |
| 85 | { |
| 86 | popIncompleteLayer_("This widget supports peak data only. Aborting!"); |
| 87 | return false; |
| 88 | } |
| 89 | |
| 90 | // Abort if no data points are contained |
| 91 | auto& layer = dynamic_cast<LayerDataPeak&>(getCurrentLayer()); |
| 92 | |
| 93 | if (layer.getPeakData()->empty()) |
| 94 | { |
| 95 | popIncompleteLayer_("Cannot add a dataset that contains no survey scans. Aborting!"); |
| 96 | return false; |
| 97 | } |
| 98 | |
| 99 | recalculateRanges_(); |
| 100 | resetZoom(false); |
| 101 | |
| 102 | //Warn if negative intensities are contained |
| 103 | if (getCurrentMinIntensity() < 0.0) |
| 104 | { |
| 105 | QMessageBox::warning(this, "Warning", "This dataset contains negative intensities. Use it at your own risk!"); |
| 106 | } |
| 107 | |
| 108 | emit layerActivated(this); |
| 109 | openglwidget()->recalculateDotGradient_(getCurrentLayer()); |
| 110 | update_buffer_ = true; |
| 111 | update_(OPENMS_PRETTY_FUNCTION); |
| 112 | |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | void Plot3DCanvas::activateLayer(Size index) |
| 117 | { |
nothing calls this directly
no test coverage detected