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

Method recalculateAxes_

src/openms_gui/source/VISUAL/Plot1DWidget.cpp:56–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 void Plot1DWidget::recalculateAxes_()
57 {
58 // set names
59 x_axis_->setLegend(string(canvas()->getMapper().getDim(DIM::X).getDimName()));
60 y_axis_->setLegend(string(canvas()->getMapper().getDim(DIM::Y).getDimName()));
61
62 // determine which is the gravity axis (usually equals intensity axis (for LOG mode))
63 AxisWidget* other_axis = x_axis_;
64 AxisWidget* int_axis = y_axis_;
65 // in the unusual case: gravity is on X axis
66 if (canvas()->getGravitator().getGravityAxis() == DIM::X)
67 {
68 swap(other_axis, int_axis);
69 //vis_area_xy.swapDimensions();
70 //all_area_xy.swapDimensions();
71 }
72 // from now on, we can assume X-dim = data; Y-dim = gravity=intensity
73
74 // deal with log scaling for intensity axis
75 int_axis->setLogScale(canvas()->getIntensityMode() == PlotCanvas::IM_LOG);
76
77 // use visible area. Its the only authority!
78 const auto& xy_ranges = canvas()->getVisibleArea().getAreaXY();
79
80 x_axis_->setAxisBounds(xy_ranges.minX(), xy_ranges.maxX());
81 y_axis_->setAxisBounds(xy_ranges.minY(), xy_ranges.maxY());
82
83 // assume flipped-y-axis is identical
84 flipped_y_axis_->setLegend(y_axis_->getLegend());
85 flipped_y_axis_->setLogScale(y_axis_->isLogScale());
86 flipped_y_axis_->setAxisBounds(y_axis_->getAxisMinimum(), y_axis_->getAxisMaximum());
87 }
88
89 Plot1DWidget::~Plot1DWidget()
90 {

Callers

nothing calls this directly

Calls 14

stringClass · 0.85
getGravityAxisMethod · 0.80
setLogScaleMethod · 0.80
setAxisBoundsMethod · 0.80
minXMethod · 0.80
maxXMethod · 0.80
minYMethod · 0.80
maxYMethod · 0.80
isLogScaleMethod · 0.80
getAxisMinimumMethod · 0.80
getAxisMaximumMethod · 0.80
canvasFunction · 0.50

Tested by

no test coverage detected