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

Method showProjections_

src/openms_gui/source/VISUAL/Plot2DWidget.cpp:136–164  ·  view source on GitHub ↗

projections

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 13

getUnitMethod · 0.80
setMapperMethod · 0.80
addLayerMethod · 0.80
setVisibleAreaYMethod · 0.80
minYMethod · 0.80
maxYMethod · 0.80
setVisibleAreaXMethod · 0.80
minXMethod · 0.80
maxXMethod · 0.80
showMethod · 0.80
canvasFunction · 0.50
getProjectionMethod · 0.45

Tested by

no test coverage detected