projections
| 134 | |
| 135 | // projections |
| 136 | void Plot2DWidget::showProjections_(const LayerDataBase* source_layer) |
| 137 | { |
| 138 | auto [projection_ontoX, projection_ontoY, stats] = |
| 139 | source_layer->getProjection(canvas_->getMapper().getDim(DIM::X).getUnit(), canvas_->getMapper().getDim(DIM::Y).getUnit(), canvas_->getVisibleArea().getAreaUnit()); |
| 140 | |
| 141 | projectionInfo_(stats.number_of_datapoints, stats.sum_intensity, stats.max_intensity); |
| 142 | |
| 143 | auto va = canvas()->getVisibleArea().getAreaXY(); |
| 144 | |
| 145 | projection_onto_Y_->showLegend(false); |
| 146 | projection_onto_Y_->setMapper({{DIM_UNIT::INT, canvas_->getMapper().getDim(DIM::Y).getUnit()}}); // must be done before addLayer() |
| 147 | projection_onto_Y_->canvas()->removeLayers(); |
| 148 | projection_onto_Y_->canvas()->addLayer(std::move(projection_ontoY)); |
| 149 | // manually set projected unit, since 'addPeakLayer' will guess a visible area, but we want the exact same scaling |
| 150 | projection_onto_Y_->canvas()->setVisibleAreaY(va.minY(), va.maxY()); |
| 151 | grid_->setColumnStretch(3, 2); |
| 152 | |
| 153 | projection_onto_X_->showLegend(false); |
| 154 | projection_onto_X_->setMapper({{canvas_->getMapper().getDim(DIM::X).getUnit(), DIM_UNIT::INT}}); // must be done before addLayer() |
| 155 | projection_onto_X_->canvas()->removeLayers(); |
| 156 | projection_onto_X_->canvas()->addLayer(std::move(projection_ontoX)); |
| 157 | // manually set projected unit, since 'addPeakLayer' will guess a visible area, but we want the exact same scaling |
| 158 | projection_onto_X_->canvas()->setVisibleAreaX(va.minX(), va.maxX()); |
| 159 | grid_->setRowStretch(0, 2); |
| 160 | |
| 161 | projection_box_->show(); |
| 162 | projection_onto_X_->show(); |
| 163 | projection_onto_Y_->show(); |
| 164 | } |
| 165 | |
| 166 | const Plot1DWidget* Plot2DWidget::getProjectionOntoX() const |
| 167 | { |
nothing calls this directly
no test coverage detected