libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::BasePlotWidget Class Reference

#include <baseplotwidget.h>

Inheritance diagram for pappso::BasePlotWidget:
pappso::BaseColorMapPlotWidget pappso::BaseTracePlotWidget pappso::DriftSpecMassSpecColorMapPlotWidget pappso::TicXicChromDriftSpecColorMapPlotWidget pappso::TicXicChromMassSpecColorMapPlotWidget pappso::DriftSpecTracePlotWidget pappso::MassSpecTracePlotWidget pappso::TicXicChromTracePlotWidget

Signals

void setFocusSignal ()
void lastCursorHoveredPointSignal (const QPointF &pointf)
void plotRangesChangedSignal (QMouseEvent *event, const pappso::BasePlotContext &context)
void plotRangesChangedWheelEventSignal (QWheelEvent *event, const pappso::BasePlotContext &context)
void xAxisMeasurementSignal (const pappso::BasePlotContext &context, bool with_delta)
void keyPressEventSignal (const pappso::BasePlotContext &context)
void keyReleaseEventSignal (const pappso::BasePlotContext &context)
void mousePressEventSignal (QMouseEvent *event, const pappso::BasePlotContext &context)
void mouseReleaseEventSignal (QMouseEvent *event, const pappso::BasePlotContext &context)
void mouseWheelEventSignal (QWheelEvent *event, const pappso::BasePlotContext &context)
void plottableSelectionChangedSignal (QCPAbstractPlottable *plottable_p, bool selected)
void integrationRequestedSignal (const BasePlotContext &context)
void plottableDestructionRequestedSignal (BasePlotWidget *base_plot_widget_p, QCPAbstractPlottable *plottable_p, const pappso::BasePlotContext &context)
void beforeReplotSignal ()
void afterLayoutSignal ()
void afterReplotSignal ()

Public Member Functions

 BasePlotWidget (QWidget *parent)
 BasePlotWidget (QWidget *parent, const QString &x_axis_label, const QString &y_axis_label)
virtual ~BasePlotWidget ()
 Destruct this BasePlotWidget instance.
virtual bool setupWidget ()
virtual void setPen (const QPen &pen)
virtual const QPen & getPen () const
virtual void setPlottingColor (QCPAbstractPlottable *plottable_p, const QColor &new_color)
virtual void setPlottingColor (int index, const QColor &new_color)
virtual QColor getPlottingColor (QCPAbstractPlottable *plottable_p) const
virtual QColor getPlottingColor (int index=0) const
virtual void setAxisLabelX (const QString &label)
virtual void setAxisLabelY (const QString &label)
virtual void resetAxesRangeHistory ()
virtual void updateAxesRangeHistory ()
 Create new axis range history items and append them to the history.
virtual void restorePreviousAxesRangeHistory ()
 Go up one history element in the axis history.
virtual void restoreAxesRangeHistory (std::size_t index)
 Get the axis histories at index index and update the plot ranges.
virtual void keyPressEvent (QKeyEvent *event)
 KEYBOARD-related EVENTS.
virtual void keyReleaseEvent (QKeyEvent *event)
 Handle specific key codes and trigger respective actions.
virtual void spaceKeyReleaseEvent (QKeyEvent *event)
virtual void directionKeyPressEvent (QKeyEvent *event)
virtual void directionKeyReleaseEvent (QKeyEvent *event)
virtual void mousePseudoButtonKeyPressEvent (QKeyEvent *event)
virtual void mousePseudoButtonKeyReleaseEvent (QKeyEvent *event)
virtual void mousePressHandler (QMouseEvent *event)
 KEYBOARD-related EVENTS.
virtual void mouseReleaseHandler (QMouseEvent *event)
virtual void mouseReleaseHandlerLeftButton (QMouseEvent *event)
virtual void mouseReleaseHandlerRightButton (QMouseEvent *event)
virtual void mouseWheelHandler (QWheelEvent *event)
virtual void mouseMoveHandler (QMouseEvent *event)
 KEYBOARD-related EVENTS.
virtual void mouseMoveHandlerNotDraggingCursor (QMouseEvent *event)
virtual void mouseMoveHandlerDraggingCursor (QMouseEvent *event)
virtual void mouseMoveHandlerLeftButtonDraggingCursor (QMouseEvent *event)
virtual void mouseMoveHandlerRightButtonDraggingCursor (QMouseEvent *event)
virtual void axisDoubleClickHandler (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
bool isClickOntoXAxis (const QPointF &mousePoint)
bool isClickOntoYAxis (const QPointF &mousePoint)
int dragDirection ()
 MOUSE-related EVENTS.
virtual void moveMouseCursorGraphCoordToGlobal (QPointF plot_coordinates)
virtual void moveMouseCursorPixelCoordToGlobal (QPointF local_coordinates)
virtual void horizontalMoveMouseCursorCountPixels (int pixel_count)
virtual QPointF horizontalGetGraphCoordNewPointCountPixels (int pixel_count)
virtual void verticalMoveMouseCursorCountPixels (int pixel_count)
virtual QPointF verticalGetGraphCoordNewPointCountPixels (int pixel_count)
virtual QCPRange getRangeX (bool &found_range, int index) const
 MOUSE MOVEMENTS mouse/keyboard-triggered.
virtual QCPRange getRangeY (bool &found_range, int index) const
QCPRange getRange (Enums::Axis axis, RangeType range_type, bool &found_range) const
virtual QCPRange getInnermostRangeX (bool &found_range) const
virtual QCPRange getOutermostRangeX (bool &found_range) const
virtual QCPRange getInnermostRangeY (bool &found_range) const
virtual QCPRange getOutermostRangeY (bool &found_range) const
void yMinMaxOnXAxisCurrentRange (double &min, double &max, QCPAbstractPlottable *plottable_p=nullptr)
void yMinMaxOnXAxisCurrentRange (double &min, double &max, int index)
virtual void axisRescale ()
 RANGE-related functions.
virtual void axisReframe ()
virtual void axisZoom ()
virtual void axisPan ()
virtual void replotWithAxesRanges (QCPRange xAxisRange, QCPRange yAxisRange, Enums::Axis axis)
virtual void replotWithAxisRangeX (double lower, double upper)
virtual void replotWithAxisRangeY (double lower, double upper)
virtual void hideAllPlotItems ()
 PLOTTING / REPLOTTING functions.
virtual void showTracers ()
 Show the traces (vertical and horizontal).
virtual void hideTracers ()
 Hide the traces (vertical and horizontal).
virtual void drawXScopeSpanFeatures ()
virtual void drawYScopeSpanFeatures ()
virtual void calculateDragDeltas ()
virtual bool isVerticalDisplacementAboveThreshold ()
virtual void drawSelectionRectangleAndPrepareZoom (bool as_line_segment=false, bool for_integration=false)
virtual void updateIntegrationScopeDrawing (bool as_line_segment=false, bool for_integration=false)
virtual void resetSelectionRectangle ()
virtual void hideSelectionRectangle (bool reset_values=false)
virtual bool isSelectionRectangleVisible ()
virtual SelectionDrawingLines whatIsVisibleOfTheSelectionRectangle ()
virtual void setFocus ()
 PLOT ITEMS : TRACER TEXT ITEMS...
virtual void redrawPlotBackground (QWidget *focusedPlotWidget)
 Redraw the background of the focusedPlotWidget plot widget.
virtual void updateContextXandYAxisRanges ()
virtual const BasePlotContextgetContext () const

Protected Member Functions

virtual void createAllAncillaryItems ()
virtual void updateIntegrationScope (bool for_integration=false)
virtual void updateIntegrationScopeRect (bool for_integration=false)
virtual void updateIntegrationScopeHorizontalRhomb (bool for_integration=false)
virtual void updateIntegrationScopeVerticalRhomb (bool for_integration=false)
virtual void updateIntegrationScopeRhomb (bool for_integration=false)
virtual QString allLayerNamesToString () const
virtual QString layerableLayerName (QCPLayerable *layerable_p) const
virtual int layerableLayerIndex (QCPLayerable *layerable_p) const

Protected Attributes

QString m_name = "NOT_SET"
 Name of the plot widget.
QString m_desc = "NOT_SET"
 Description of the plot widget.
QString m_fileName
 The name of the data file from which the mass data were read.
QString m_axisLabelX
QString m_axisLabelY
BasePlotContext m_context
int m_leftMousePseudoButtonKey = Qt::Key_Less
int m_rightMousePseudoButtonKey = Qt::Key_Greater
QCPItemLine * mp_selectionRectangeLine1 = nullptr
 Rectangle defining the borders of zoomed-in/out data.
QCPItemLine * mp_selectionRectangeLine2 = nullptr
QCPItemLine * mp_selectionRectangeLine3 = nullptr
QCPItemLine * mp_selectionRectangeLine4 = nullptr
QCPItemText * mp_xDeltaTextItem = nullptr
 Text describing the x-axis delta value during a drag operation.
QCPItemText * mp_yDeltaTextItem = nullptr
bool m_shouldTracersBeVisible = true
 Tells if the tracers should be visible.
QCPItemLine * mp_hPosTracerItem = nullptr
 Horizontal position tracer.
QCPItemLine * mp_vPosTracerItem = nullptr
 Vertical position tracer.
QCPItemLine * mp_vStartTracerItem = nullptr
 Vertical selection start tracer (typically in green).
QCPItemLine * mp_vEndTracerItem = nullptr
 Vertical selection end tracer (typically in red).
std::size_t m_lastAxisRangeHistoryIndex = 0
 Index of the last axis range history item.
std::vector< QCPRange * > m_xAxisRangeHistory
 List of x axis ranges occurring during the panning zooming actions.
std::vector< QCPRange * > m_yAxisRangeHistory
 List of y axis ranges occurring during the panning zooming actions.
int m_mouseMoveHandlerSkipAmount = 10
 How many mouse move events must be skipped *‍/.
int m_mouseMoveHandlerSkipCount = 0
 Counter to handle the "fat data" mouse move event handling.
QColor m_unfocusedColor = QColor("lightgray")
 Color used for the background of unfocused plot.
QBrush m_unfocusedBrush = QBrush(m_unfocusedColor)
 Color used for the background of unfocused plot.
QColor m_focusedColor = QColor(Qt::transparent)
 Color used for the background of focused plot.
QBrush m_focusedBrush = QBrush(m_focusedColor)
 Color used for the background of focused plot.
QPen m_pen
 Pen used to draw the graph and textual elements in the plot widget.

Detailed Description

Definition at line 83 of file baseplotwidget.h.

Constructor & Destructor Documentation

◆ BasePlotWidget() [1/2]

pappso::BasePlotWidget::BasePlotWidget ( QWidget * parent)
explicit

Definition at line 49 of file baseplotwidget.cpp.

49 : QCustomPlot(parent)
50{
51 if(parent == nullptr)
52 qFatal("Programming error.");
53
54 // Default settings for the pen used to graph the data.
55 m_pen.setStyle(Qt::SolidLine);
56 m_pen.setBrush(Qt::black);
57 m_pen.setWidth(1);
58
59 // qDebug() << "Created new BasePlotWidget with" << layerCount()
60 //<< "layers before setting up widget.";
61 // qDebug().noquote() << "All layer names:\n" << allLayerNamesToString();
62
63 // As of today 20210313, the QCustomPlot is created with the following 6
64 // layers:
65 //
66 // All layers' name:
67 //
68 // Layer index 0 name: background
69 // Layer index 1 name: grid
70 // Layer index 2 name: main
71 // Layer index 3 name: axes
72 // Layer index 4 name: legend
73 // Layer index 5 name: overlay
74
75 if(!setupWidget())
76 qFatal("Programming error.");
77
78 // Do not call createAllAncillaryItems() in this base class because all the
79 // items will have been created *before* the addition of plots and then the
80 // rendering order will hide them to the viewer, since the rendering order is
81 // according to the order in which the items have been created.
82 //
83 // The fact that the ancillary items are created before trace plots is not a
84 // problem because the trace plots are sparse and do not effectively hide the
85 // data.
86 //
87 // But, in the color map plot widgets, we cannot afford to create the
88 // ancillary items *before* the plot itself because then, the rendering of the
89 // plot (created after) would screen off the ancillary items (created before).
90 //
91 // So, the createAllAncillaryItems() function needs to be called in the
92 // derived classes at the most appropriate moment in the setting up of the
93 // widget.
94 //
95 // All this is only a workaround of a bug in QCustomPlot. See
96 // https://www.qcustomplot.com/index.php/support/forum/2283.
97 //
98 // I initially wanted to have a plots layer on top of the default background
99 // layer and a items layer on top of it. But that setting prevented the
100 // selection of graphs.
101
102 // qDebug() << "Created new BasePlotWidget with" << layerCount()
103 //<< "layers after setting up widget.";
104 // qDebug().noquote() << "All layer names:\n" << allLayerNamesToString();
105
106 show();
107}
QPen m_pen
Pen used to draw the graph and textual elements in the plot widget.

References m_pen, and setupWidget().

Referenced by pappso::BaseColorMapPlotWidget::BaseColorMapPlotWidget(), pappso::BaseColorMapPlotWidget::BaseColorMapPlotWidget(), pappso::BaseTracePlotWidget::BaseTracePlotWidget(), pappso::BaseTracePlotWidget::BaseTracePlotWidget(), and plottableDestructionRequestedSignal().

◆ BasePlotWidget() [2/2]

pappso::BasePlotWidget::BasePlotWidget ( QWidget * parent,
const QString & x_axis_label,
const QString & y_axis_label )
explicit

Definition at line 109 of file baseplotwidget.cpp.

112 : QCustomPlot(parent), m_axisLabelX(x_axis_label), m_axisLabelY(y_axis_label)
113{
114 // qDebug();
115
116 if(parent == nullptr)
117 qFatal("Programming error.");
118
119 // Default settings for the pen used to graph the data.
120 m_pen.setStyle(Qt::SolidLine);
121 m_pen.setBrush(Qt::black);
122 m_pen.setWidth(1);
123
124 xAxis->setLabel(x_axis_label);
125 yAxis->setLabel(y_axis_label);
126
127 // qDebug() << "Created new BasePlotWidget with" << layerCount()
128 //<< "layers before setting up widget.";
129 // qDebug().noquote() << "All layer names:\n" << allLayerNamesToString();
130
131 // As of today 20210313, the QCustomPlot is created with the following 6
132 // layers:
133 //
134 // All layers' name:
135 //
136 // Layer index 0 name: background
137 // Layer index 1 name: grid
138 // Layer index 2 name: main
139 // Layer index 3 name: axes
140 // Layer index 4 name: legend
141 // Layer index 5 name: overlay
142
143 if(!setupWidget())
144 qFatal("Programming error.");
145
146 // qDebug() << "Created new BasePlotWidget with" << layerCount()
147 //<< "layers after setting up widget.";
148 // qDebug().noquote() << "All layer names:\n" << allLayerNamesToString();
149
150 show();
151}

References m_axisLabelX, m_axisLabelY, m_pen, and setupWidget().

◆ ~BasePlotWidget()

pappso::BasePlotWidget::~BasePlotWidget ( )
virtual

Destruct this BasePlotWidget instance.

The destruction involves clearing the history, deleting all the axis range history items for x and y axes.

Definition at line 160 of file baseplotwidget.cpp.

161{
162 // qDebug() << "In the destructor of plot widget:" << this;
163
164 m_xAxisRangeHistory.clear();
165 m_yAxisRangeHistory.clear();
166
167 // Note that the QCustomPlot xxxItem objects are allocated with (this) which
168 // means their destruction is automatically handled upon *this' destruction.
169}
std::vector< QCPRange * > m_yAxisRangeHistory
List of y axis ranges occurring during the panning zooming actions.
std::vector< QCPRange * > m_xAxisRangeHistory
List of x axis ranges occurring during the panning zooming actions.

References m_xAxisRangeHistory, and m_yAxisRangeHistory.

Member Function Documentation

◆ afterLayoutSignal

void pappso::BasePlotWidget::afterLayoutSignal ( )
signal

Referenced by setupWidget().

◆ afterReplotSignal

void pappso::BasePlotWidget::afterReplotSignal ( )
signal

Referenced by setupWidget().

◆ allLayerNamesToString()

QString pappso::BasePlotWidget::allLayerNamesToString ( ) const
protectedvirtual

Definition at line 172 of file baseplotwidget.cpp.

173{
174
175 QString text;
176
177 for(int iter = 0; iter < layerCount(); ++iter)
178 {
179 text +=
180 QString("Layer index %1: %2\n").arg(iter).arg(layer(iter)->name());
181 }
182
183 return text;
184}

◆ axisDoubleClickHandler()

void pappso::BasePlotWidget::axisDoubleClickHandler ( QCPAxis * axis,
QCPAxis::SelectablePart part,
QMouseEvent * event )
virtual

Reimplemented in pappso::BaseTracePlotWidget.

Definition at line 1673 of file baseplotwidget.cpp.

1677{
1678 // qDebug();
1679
1680 m_context.m_keyboardModifiers = QGuiApplication::queryKeyboardModifiers();
1681
1682 if(m_context.m_keyboardModifiers & Qt::ControlModifier)
1683 {
1684 // qDebug();
1685
1686 // If the Ctrl modifiers is active, then both axes are to be reset. Also
1687 // the histories are reset also.
1688
1689 rescaleAxes();
1691 }
1692 else
1693 {
1694 // qDebug();
1695
1696 // Only the axis passed as parameter is to be rescaled.
1697 // Reset the range of that axis to the max view possible.
1698
1699 axis->rescale();
1700
1702
1703 event->accept();
1704 }
1705
1706 // The double-click event does not cancel the mouse press event. That is, if
1707 // left-double-clicking, at the end of the operation the button still
1708 // "pressed". We need to remove manually the button from the pressed buttons
1709 // context member.
1710
1711 m_context.m_pressedMouseButtons ^= event->button();
1712
1714
1716
1717 replot();
1718}
virtual void updateAxesRangeHistory()
Create new axis range history items and append them to the history.
void plotRangesChangedSignal(QMouseEvent *event, const pappso::BasePlotContext &context)
virtual void resetAxesRangeHistory()
virtual void updateContextXandYAxisRanges()
BasePlotContext m_context

References m_context, plotRangesChangedSignal(), resetAxesRangeHistory(), updateAxesRangeHistory(), and updateContextXandYAxisRanges().

Referenced by setupWidget().

◆ axisPan()

void pappso::BasePlotWidget::axisPan ( )
virtual

Reimplemented in pappso::BaseTracePlotWidget.

Definition at line 2143 of file baseplotwidget.cpp.

2144{
2145 // Sanity check
2146 if(!m_context.m_wasClickOnXAxis && !m_context.m_wasClickOnYAxis)
2147 qFatal(
2148 "This function can only be called if the mouse click was on one of the "
2149 "axes");
2150
2151 if(m_context.m_wasClickOnXAxis)
2152 {
2153 xAxis->setRange(m_context.m_xRange.lower - m_context.m_xDelta,
2154 m_context.m_xRange.upper - m_context.m_xDelta);
2155 }
2156
2157 if(m_context.m_wasClickOnYAxis)
2158 {
2159 yAxis->setRange(m_context.m_yRange.lower - m_context.m_yDelta,
2160 m_context.m_yRange.upper - m_context.m_yDelta);
2161 }
2162
2164
2165 // qDebug() << "The updated context:" << m_context.toString();
2166
2167 // We cannot store the new ranges in the history, because the pan operation
2168 // involved a huge quantity of micro-movements elicited upon each mouse move
2169 // cursor event so we would have a huge history.
2170 // updateAxesRangeHistory();
2171
2172 // Now that the context has the right range values, we can emit the
2173 // signal that will be used by this plot widget users, typically to
2174 // abide by the x/y range lock required by the user.
2175
2176 emit plotRangesChangedSignal((QMouseEvent *)nullptr, m_context);
2177
2178 replot();
2179}

References m_context, plotRangesChangedSignal(), and updateContextXandYAxisRanges().

Referenced by mouseMoveHandlerLeftButtonDraggingCursor(), and yMinMaxOnXAxisCurrentRange().

◆ axisReframe()

void pappso::BasePlotWidget::axisReframe ( )
virtual

Reimplemented in pappso::BaseTracePlotWidget.

Definition at line 2086 of file baseplotwidget.cpp.

2087{
2088
2089 // double sorted_start_drag_point_x =
2090 // std::min(m_context.m_startDragPoint.x(),
2091 // m_context.m_currentDragPoint.x());
2092
2093 // xAxis->setRange(sorted_start_drag_point_x,
2094 // sorted_start_drag_point_x + fabs(m_context.m_xDelta));
2095
2096 xAxis->setRange(
2097 QCPRange(m_context.m_xRegionRangeStart, m_context.m_xRegionRangeEnd));
2098
2099 // Note that the y axis should be rescaled from current lower value to new
2100 // upper value matching the y-axis position of the cursor when the mouse
2101 // button was released.
2102
2103 yAxis->setRange(xAxis->range().lower,
2104 std::max<double>(m_context.m_yRegionRangeStart,
2105 m_context.m_yRegionRangeEnd));
2106
2107 // qDebug() << "xaxis:" << xAxis->range().lower << "-" <<
2108 // xAxis->range().upper
2109 //<< "yaxis:" << yAxis->range().lower << "-" << yAxis->range().upper;
2110
2112
2114 emit plotRangesChangedSignal((QMouseEvent *)nullptr, m_context);
2115
2116 replot();
2117}

References m_context, plotRangesChangedSignal(), updateAxesRangeHistory(), and updateContextXandYAxisRanges().

Referenced by mouseReleaseHandlerLeftButton(), and yMinMaxOnXAxisCurrentRange().

◆ axisRescale()

void pappso::BasePlotWidget::axisRescale ( )
virtual

RANGE-related functions.

PLOTTING / REPLOTTING functions

Reimplemented in pappso::BaseTracePlotWidget.

Definition at line 2031 of file baseplotwidget.cpp.

2032{
2033 // Get the current x lower/upper range, that is, leftmost/rightmost x
2034 // coordinate.
2035 double xLower = xAxis->range().lower;
2036 double xUpper = xAxis->range().upper;
2037
2038 // Get the current y lower/upper range, that is, bottommost/topmost y
2039 // coordinate.
2040 double yLower = yAxis->range().lower;
2041 double yUpper = yAxis->range().upper;
2042
2043 // This function is called only when the user has clicked on the x/y axis or
2044 // when the user has dragged the left mouse button with the Ctrl key
2045 // modifier. The m_context.m_wasClickOnXAxis is then simulated in the mouse
2046 // move handler. So we need to test which axis was clicked-on.
2047
2048 if(m_context.m_wasClickOnXAxis)
2049 {
2050 // We are changing the range of the X axis.
2051
2052 // If xDelta is < 0, then we were dragging from right to left, we are
2053 // compressing the view on the x axis, by adding new data to the right
2054 // hand size of the graph. So we add xDelta to the upper bound of the
2055 // range. Otherwise we are uncompressing the view on the x axis and
2056 // remove the xDelta from the upper bound of the range. This is why we
2057 // have the
2058 // '-'
2059 // and not '+' below;
2060
2061 xAxis->setRange(xLower, xUpper - m_context.m_xDelta);
2062 }
2063 // End of
2064 // if(m_context.m_wasClickOnXAxis)
2065 else // that is, if(m_context.m_wasClickOnYAxis)
2066 {
2067 // We are changing the range of the Y axis.
2068
2069 // See above for an explanation of the computation (the - sign below).
2070
2071 yAxis->setRange(yLower, yUpper - m_context.m_yDelta);
2072 }
2073 // End of
2074 // else // that is, if(m_context.m_wasClickOnYAxis)
2075
2076 // Update the context with the current axes ranges
2077
2079
2080 emit plotRangesChangedSignal((QMouseEvent *)nullptr, m_context);
2081
2082 replot();
2083}

References m_context, plotRangesChangedSignal(), and updateContextXandYAxisRanges().

Referenced by mouseMoveHandlerLeftButtonDraggingCursor(), and yMinMaxOnXAxisCurrentRange().

◆ axisZoom()

void pappso::BasePlotWidget::axisZoom ( )
virtual

Reimplemented in pappso::BaseTracePlotWidget.

Definition at line 2120 of file baseplotwidget.cpp.

2121{
2122
2123 // Use the m_context.m_xRegionRangeStart/End values, but we need to sort the
2124 // values before using them, because now we want to really have the lower x
2125 // value. Simply craft a QCPRange that will swap the values if lower is not
2126 // < than upper QCustomPlot calls this normalization).
2127
2128 xAxis->setRange(
2129 QCPRange(m_context.m_xRegionRangeStart, m_context.m_xRegionRangeEnd));
2130
2131 yAxis->setRange(
2132 QCPRange(m_context.m_yRegionRangeStart, m_context.m_yRegionRangeEnd));
2133
2135
2137 emit plotRangesChangedSignal((QMouseEvent *)nullptr, m_context);
2138
2139 replot();
2140}

References m_context, plotRangesChangedSignal(), updateAxesRangeHistory(), and updateContextXandYAxisRanges().

Referenced by mouseReleaseHandlerLeftButton(), and yMinMaxOnXAxisCurrentRange().

◆ beforeReplotSignal

void pappso::BasePlotWidget::beforeReplotSignal ( )
signal

Referenced by setupWidget().

◆ calculateDragDeltas()

void pappso::BasePlotWidget::calculateDragDeltas ( )
virtual

Definition at line 2559 of file baseplotwidget.cpp.

2560{
2561
2562 // We compute signed differentials. If the user does not want the sign,
2563 // fabs(double) is their friend.
2564
2565 // Compute the xAxis differential:
2566
2567 m_context.m_xDelta =
2568 m_context.m_currentDragPoint.x() - m_context.m_startDragPoint.x();
2569
2570 // Same with the Y-axis range:
2571
2572 m_context.m_yDelta =
2573 m_context.m_currentDragPoint.y() - m_context.m_startDragPoint.y();
2574
2575 return;
2576}

References m_context.

Referenced by mouseMoveHandlerDraggingCursor(), and yMinMaxOnXAxisCurrentRange().

◆ createAllAncillaryItems()

void pappso::BasePlotWidget::createAllAncillaryItems ( )
protectedvirtual

Definition at line 215 of file baseplotwidget.cpp.

216{
217 // Make a copy of the pen to just change its color and set that color to
218 // the tracer line.
219 QPen pen = m_pen;
220
221 // Create the lines that will act as tracers for position and selection of
222 // regions.
223 //
224 // We have the cross hair that serves as the cursor. That crosshair cursor is
225 // made of a vertical line (green, because when click-dragging the mouse it
226 // becomes the tracer that is being anchored at the region start. The second
227 // line i horizontal and is always black.
228
229 pen.setColor(QColor("steelblue"));
230
231 // The set of tracers (horizontal and vertical) that track the position of the
232 // mouse cursor.
233
234 mp_vPosTracerItem = new QCPItemLine(this);
235 mp_vPosTracerItem->setLayer("plotsLayer");
236 mp_vPosTracerItem->setPen(pen);
237 mp_vPosTracerItem->start->setType(QCPItemPosition::ptPlotCoords);
238 mp_vPosTracerItem->end->setType(QCPItemPosition::ptPlotCoords);
239 mp_vPosTracerItem->start->setCoords(0, 0);
240 mp_vPosTracerItem->end->setCoords(0, 0);
241
242 mp_hPosTracerItem = new QCPItemLine(this);
243 mp_hPosTracerItem->setLayer("plotsLayer");
244 mp_hPosTracerItem->setPen(pen);
245 mp_hPosTracerItem->start->setType(QCPItemPosition::ptPlotCoords);
246 mp_hPosTracerItem->end->setType(QCPItemPosition::ptPlotCoords);
247 mp_hPosTracerItem->start->setCoords(0, 0);
248 mp_hPosTracerItem->end->setCoords(0, 0);
249
250 // The set of tracers (horizontal only) that track the region
251 // spanning/selection regions.
252 //
253 // The start vertical tracer is colored in greeen.
254 pen.setColor(QColor("green"));
255
256 mp_vStartTracerItem = new QCPItemLine(this);
257 mp_vStartTracerItem->setLayer("plotsLayer");
258 mp_vStartTracerItem->setPen(pen);
259 mp_vStartTracerItem->start->setType(QCPItemPosition::ptPlotCoords);
260 mp_vStartTracerItem->end->setType(QCPItemPosition::ptPlotCoords);
261 mp_vStartTracerItem->start->setCoords(0, 0);
262 mp_vStartTracerItem->end->setCoords(0, 0);
263
264 // The end vertical tracer is colored in red.
265 pen.setColor(QColor("red"));
266
267 mp_vEndTracerItem = new QCPItemLine(this);
268 mp_vEndTracerItem->setLayer("plotsLayer");
269 mp_vEndTracerItem->setPen(pen);
270 mp_vEndTracerItem->start->setType(QCPItemPosition::ptPlotCoords);
271 mp_vEndTracerItem->end->setType(QCPItemPosition::ptPlotCoords);
272 mp_vEndTracerItem->start->setCoords(0, 0);
273 mp_vEndTracerItem->end->setCoords(0, 0);
274
275 // When the user click-drags the mouse, the X distance between the drag start
276 // point and the drag end point (current point) is the xDelta.
277 mp_xDeltaTextItem = new QCPItemText(this);
278 mp_xDeltaTextItem->setLayer("plotsLayer");
279 mp_xDeltaTextItem->setColor(QColor("steelblue"));
280 mp_xDeltaTextItem->setPositionAlignment(Qt::AlignBottom | Qt::AlignCenter);
281 mp_xDeltaTextItem->position->setType(QCPItemPosition::ptPlotCoords);
282 mp_xDeltaTextItem->setVisible(false);
283
284 // Same for the y delta
285 mp_yDeltaTextItem = new QCPItemText(this);
286 mp_yDeltaTextItem->setLayer("plotsLayer");
287 mp_yDeltaTextItem->setColor(QColor("steelblue"));
288 mp_yDeltaTextItem->setPositionAlignment(Qt::AlignBottom | Qt::AlignCenter);
289 mp_yDeltaTextItem->position->setType(QCPItemPosition::ptPlotCoords);
290 mp_yDeltaTextItem->setVisible(false);
291
292 // Make sure we prepare the four lines that will be needed to
293 // draw the selection rectangle.
294 pen = m_pen;
295
296 pen.setColor("steelblue");
297
298 mp_selectionRectangeLine1 = new QCPItemLine(this);
299 mp_selectionRectangeLine1->setLayer("plotsLayer");
300 mp_selectionRectangeLine1->setPen(pen);
301 mp_selectionRectangeLine1->start->setType(QCPItemPosition::ptPlotCoords);
302 mp_selectionRectangeLine1->end->setType(QCPItemPosition::ptPlotCoords);
303 mp_selectionRectangeLine1->start->setCoords(0, 0);
304 mp_selectionRectangeLine1->end->setCoords(0, 0);
305 mp_selectionRectangeLine1->setVisible(false);
306
307 mp_selectionRectangeLine2 = new QCPItemLine(this);
308 mp_selectionRectangeLine2->setLayer("plotsLayer");
309 mp_selectionRectangeLine2->setPen(pen);
310 mp_selectionRectangeLine2->start->setType(QCPItemPosition::ptPlotCoords);
311 mp_selectionRectangeLine2->end->setType(QCPItemPosition::ptPlotCoords);
312 mp_selectionRectangeLine2->start->setCoords(0, 0);
313 mp_selectionRectangeLine2->end->setCoords(0, 0);
314 mp_selectionRectangeLine2->setVisible(false);
315
316 mp_selectionRectangeLine3 = new QCPItemLine(this);
317 mp_selectionRectangeLine3->setLayer("plotsLayer");
318 mp_selectionRectangeLine3->setPen(pen);
319 mp_selectionRectangeLine3->start->setType(QCPItemPosition::ptPlotCoords);
320 mp_selectionRectangeLine3->end->setType(QCPItemPosition::ptPlotCoords);
321 mp_selectionRectangeLine3->start->setCoords(0, 0);
322 mp_selectionRectangeLine3->end->setCoords(0, 0);
323 mp_selectionRectangeLine3->setVisible(false);
324
325 mp_selectionRectangeLine4 = new QCPItemLine(this);
326 mp_selectionRectangeLine4->setLayer("plotsLayer");
327 mp_selectionRectangeLine4->setPen(pen);
328 mp_selectionRectangeLine4->start->setType(QCPItemPosition::ptPlotCoords);
329 mp_selectionRectangeLine4->end->setType(QCPItemPosition::ptPlotCoords);
330 mp_selectionRectangeLine4->start->setCoords(0, 0);
331 mp_selectionRectangeLine4->end->setCoords(0, 0);
332 mp_selectionRectangeLine4->setVisible(false);
333}
QCPItemText * mp_yDeltaTextItem
QCPItemLine * mp_selectionRectangeLine1
Rectangle defining the borders of zoomed-in/out data.
QCPItemLine * mp_selectionRectangeLine2
QCPItemText * mp_xDeltaTextItem
Text describing the x-axis delta value during a drag operation.
QCPItemLine * mp_hPosTracerItem
Horizontal position tracer.
QCPItemLine * mp_vPosTracerItem
Vertical position tracer.
QCPItemLine * mp_selectionRectangeLine4
QCPItemLine * mp_vStartTracerItem
Vertical selection start tracer (typically in green).
QCPItemLine * mp_selectionRectangeLine3
QCPItemLine * mp_vEndTracerItem
Vertical selection end tracer (typically in red).

References m_pen, mp_hPosTracerItem, mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, mp_selectionRectangeLine4, mp_vEndTracerItem, mp_vPosTracerItem, mp_vStartTracerItem, mp_xDeltaTextItem, and mp_yDeltaTextItem.

Referenced by pappso::BaseTracePlotWidget::BaseTracePlotWidget(), pappso::BaseTracePlotWidget::BaseTracePlotWidget(), pappso::BaseColorMapPlotWidget::addColorMap(), and pappso::BaseColorMapPlotWidget::addColorMap().

◆ directionKeyPressEvent()

void pappso::BasePlotWidget::directionKeyPressEvent ( QKeyEvent * event)
virtual

Definition at line 802 of file baseplotwidget.cpp.

803{
804 // qDebug() << "event key:" << event->key();
805
806 // The user is trying to move the positional cursor/markers. There are
807 // multiple way they can do that:
808 //
809 // 1.a. Hitting the arrow left/right keys alone will search for next pixel.
810 // 1.b. Hitting the arrow left/right keys with Alt modifier will search for
811 // a multiple of pixels that might be equivalent to one 20th of the pixel
812 // width of the plot widget. 1.c Hitting the left/right keys with Alt and
813 // Shift modifiers will search for a multiple of pixels that might be the
814 // equivalent to half of the pixel width.
815 //
816 // 2. Hitting the Control modifier will move the cursor to the next data
817 // point of the graph.
818
819 int pixel_increment = 0;
820
821 if(m_context.m_keyboardModifiers == Qt::NoModifier)
822 pixel_increment = 1;
823 else if(m_context.m_keyboardModifiers == Qt::AltModifier)
824 pixel_increment = 50;
825
826 // The user is moving the positional markers. This is equivalent to a
827 // non-dragging cursor movement to the next pixel. Note that the origin is
828 // located at the top left, so key down increments and key up decrements.
829
830 if(event->key() == Qt::Key_Left)
831 horizontalMoveMouseCursorCountPixels(-pixel_increment);
832 else if(event->key() == Qt::Key_Right)
834 else if(event->key() == Qt::Key_Up)
835 verticalMoveMouseCursorCountPixels(-pixel_increment);
836 else if(event->key() == Qt::Key_Down)
837 verticalMoveMouseCursorCountPixels(pixel_increment);
838
839 event->accept();
840}
virtual void verticalMoveMouseCursorCountPixels(int pixel_count)
virtual void horizontalMoveMouseCursorCountPixels(int pixel_count)

References horizontalMoveMouseCursorCountPixels(), m_context, and verticalMoveMouseCursorCountPixels().

Referenced by keyPressEvent().

◆ directionKeyReleaseEvent()

void pappso::BasePlotWidget::directionKeyReleaseEvent ( QKeyEvent * event)
virtual

Definition at line 843 of file baseplotwidget.cpp.

844{
845 // qDebug() << "event key:" << event->key();
846 event->accept();
847}

Referenced by keyReleaseEvent().

◆ dragDirection()

int pappso::BasePlotWidget::dragDirection ( )

MOUSE-related EVENTS.

MOUSE MOVEMENTS mouse/keyboard-triggered

Definition at line 1776 of file baseplotwidget.cpp.

1777{
1778 // The user is dragging the mouse, probably to rescale the axes, but we need
1779 // to sort out in which direction the drag is happening.
1780
1781 // This function should be called after calculateDragDeltas, so that
1782 // m_context has the proper x/y delta values that we'll compare.
1783
1784 // Note that we cannot compare simply x or y deltas because the y axis might
1785 // have a different scale that the x axis. So we first need to convert the
1786 // positions to pixels.
1787
1788 double x_delta_pixel =
1789 fabs(xAxis->coordToPixel(m_context.m_currentDragPoint.x()) -
1790 xAxis->coordToPixel(m_context.m_startDragPoint.x()));
1791
1792 double y_delta_pixel =
1793 fabs(yAxis->coordToPixel(m_context.m_currentDragPoint.y()) -
1794 yAxis->coordToPixel(m_context.m_startDragPoint.y()));
1795
1796 if(x_delta_pixel > y_delta_pixel)
1797 return Qt::Horizontal;
1798
1799 return Qt::Vertical;
1800}

References m_context.

◆ drawSelectionRectangleAndPrepareZoom()

void pappso::BasePlotWidget::drawSelectionRectangleAndPrepareZoom ( bool as_line_segment = false,
bool for_integration = false )
virtual

Definition at line 2280 of file baseplotwidget.cpp.

2282{
2283 // The user has dragged the mouse left button on the graph, which means he
2284 // is willing to draw a selection rectangle, either for zooming-in or for
2285 // integration.
2286
2287 if(mp_xDeltaTextItem != nullptr)
2288 mp_xDeltaTextItem->setVisible(false);
2289 if(mp_yDeltaTextItem != nullptr)
2290 mp_yDeltaTextItem->setVisible(false);
2291
2292 // Ensure the right selection rectangle is drawn.
2293
2294 updateIntegrationScopeDrawing(as_line_segment, for_integration);
2295
2296 // Note that if we draw a zoom rectangle, then we are certainly not
2297 // measuring anything. So set the boolean value to false so that the user of
2298 // this widget or derived classes know that there is nothing to perform upon
2299 // (like deconvolution, for example).
2300
2301 m_context.m_isMeasuringDistance = false;
2302
2303 // Also remove the delta value from the pipeline by sending a simple
2304 // distance without measurement signal.
2305
2306 emit xAxisMeasurementSignal(m_context, false);
2307
2308 replot();
2309}
virtual void updateIntegrationScopeDrawing(bool as_line_segment=false, bool for_integration=false)
void xAxisMeasurementSignal(const pappso::BasePlotContext &context, bool with_delta)

References m_context, mp_xDeltaTextItem, mp_yDeltaTextItem, updateIntegrationScopeDrawing(), and xAxisMeasurementSignal().

Referenced by mouseMoveHandlerLeftButtonDraggingCursor(), mouseMoveHandlerRightButtonDraggingCursor(), and yMinMaxOnXAxisCurrentRange().

◆ drawXScopeSpanFeatures()

void pappso::BasePlotWidget::drawXScopeSpanFeatures ( )
virtual

Definition at line 2312 of file baseplotwidget.cpp.

2313{
2314 // Depending on the kind of integration scope, we will have to display
2315 // differently calculated values. We want to provide the user with
2316 // the horizontal span of the integration scope. There are different
2317 // situations.
2318
2319 // 1. The scope is mono-dimensional across the x axis: the span
2320 // is thus simply the width.
2321
2322 // 2. The scope is bi-dimensional and is a rectangle: the span is
2323 // thus simply the width.
2324
2325 // 3. The socpe is bi-dimensional and is a rhomboid: the span is
2326 // the width.
2327
2328 // In the first and second cases above, the width is equal to the
2329 // m_context.m_xDelta.
2330
2331 // In the case of the rhomboid, the span is not m_context.m_xDelta,
2332 // it is more than that if the rhomboid is horizontal because it is
2333 // the m_context.m_xDelta plus the rhomboid's horizontal size.
2334
2335 // FIXME: is this still true?
2336 //
2337 // We do not want to show the position markers because the only horiontal
2338 // line to be visible must be contained between the start and end vertical
2339 // tracer items.
2340 mp_hPosTracerItem->setVisible(false);
2341 mp_vPosTracerItem->setVisible(false);
2342
2343 // We want to draw the text in the middle position of the leftmost-rightmost
2344 // point, even with rhomboid scopes.
2345
2346 QPointF leftmost_point;
2347 if(!m_context.msp_integrationScope->getLeftMostPoint(leftmost_point))
2348 qFatal("Could not get the left-most point.");
2349
2350 double width;
2351 if(!m_context.msp_integrationScope->getWidth(width))
2352 qFatal("Could not get width.");
2353 // qDebug() << "width:" << width;
2354
2355 double x_axis_center_position = leftmost_point.x() + width / 2;
2356
2357 // We want the text to print inside the rectangle, always at the current
2358 // drag point so the eye can follow the delta value while looking where to
2359 // drag the mouse. To position the text inside the rectangle, we need to
2360 // know what is the drag direction.
2361
2362 // What is the distance between the rectangle line at current drag point and
2363 // the text itself. Think of this as a margin distance between the
2364 // point of interest and the actual position of the text.
2365 int pixels_away_from_line = 15;
2366
2367 QPointF reference_point_for_y_axis_label_position;
2368
2369 // ATTENTION: the pixel coordinates for the vertical direction go in reverse
2370 // order with respect to the y axis values !!! That is, pixel(0,0) is top
2371 // left of the graph.
2372 if(static_cast<int>(m_context.m_dragDirections) &
2373 static_cast<int>(DragDirections::BOTTOM_TO_TOP))
2374 {
2375 // We need to print outside the rectangle, that is pixels_away_from_line
2376 // pixels to the top, so with pixel y value decremented of that
2377 // pixels_above_line value (one would have expected to increment that
2378 // value, along the y axis, but the coordinates in pixel go in reverse
2379 // order).
2380
2381 pixels_away_from_line *= -1;
2382
2383 if(!m_context.msp_integrationScope->getTopMostPoint(
2384 reference_point_for_y_axis_label_position))
2385 qFatal("Failed to get top most point.");
2386 }
2387 else
2388 {
2389 if(!m_context.msp_integrationScope->getBottomMostPoint(
2390 reference_point_for_y_axis_label_position))
2391 qFatal("Failed to get bottom most point.");
2392 }
2393
2394 // double y_axis_pixel_coordinate =
2395 // yAxis->coordToPixel(m_context.m_currentDragPoint.y());
2396 double y_axis_pixel_coordinate =
2397 yAxis->coordToPixel(reference_point_for_y_axis_label_position.y());
2398
2399 // Now that we have the coordinate in pixel units, we can correct
2400 // it by the value of the margin we want to give.
2401 double y_axis_modified_pixel_coordinate =
2402 y_axis_pixel_coordinate + pixels_away_from_line;
2403
2404 // Set aside a point instance to store the pixel coordinates of the text.
2405 QPointF pixel_coordinates;
2406
2407 pixel_coordinates.setX(x_axis_center_position);
2408 pixel_coordinates.setY(y_axis_modified_pixel_coordinate);
2409
2410 // Now convert back to graph coordinates.
2411 QPointF graph_coordinates(xAxis->pixelToCoord(pixel_coordinates.x()),
2412 yAxis->pixelToCoord(pixel_coordinates.y()));
2413
2414 // qDebug() << "Should print the label at point:" << graph_coordinates;
2415
2416 if(mp_xDeltaTextItem != nullptr)
2417 {
2418 mp_xDeltaTextItem->position->setCoords(x_axis_center_position,
2419 graph_coordinates.y());
2420
2421 // Dynamically set the number of decimals to ensure we can read
2422 // a meaning full delta value even if it is very very very small.
2423 // That is, allow one to read 0.00333, 0.000333, 1.333 and so on.
2424
2425 // The computation below only works properly when the passed
2426 // value is fabs() (not negative !!!).
2427
2428 int decimals = Utils::zeroDecimalsInValue(width) + 3;
2429
2430 QString label_text = QString("full x span %1 -- x drag delta %2")
2431 .arg(width, 0, 'f', decimals)
2432 .arg(fabs(m_context.m_xDelta), 0, 'f', decimals);
2433
2434 mp_xDeltaTextItem->setText(label_text);
2435
2436 mp_xDeltaTextItem->setFont(QFont(font().family(), 9));
2437 mp_xDeltaTextItem->setVisible(true);
2438 }
2439
2440 // Set the boolean to true so that derived widgets know that something is
2441 // being measured, and they can act accordingly, for example by computing
2442 // deconvolutions in a mass spectrum.
2443 m_context.m_isMeasuringDistance = true;
2444
2445 replot();
2446
2447 // Let the caller know that we were measuring something.
2449
2450 return;
2451}
static int zeroDecimalsInValue(pappso_double value)
Determine the number of zero decimals between the decimal point and the first non-zero decimal.
Definition utils.cpp:102

References pappso::BOTTOM_TO_TOP, m_context, mp_hPosTracerItem, mp_vPosTracerItem, mp_xDeltaTextItem, xAxisMeasurementSignal(), and pappso::Utils::zeroDecimalsInValue().

Referenced by mouseMoveHandlerLeftButtonDraggingCursor(), mouseMoveHandlerRightButtonDraggingCursor(), updateIntegrationScopeDrawing(), and yMinMaxOnXAxisCurrentRange().

◆ drawYScopeSpanFeatures()

void pappso::BasePlotWidget::drawYScopeSpanFeatures ( )
virtual

Definition at line 2454 of file baseplotwidget.cpp.

2455{
2456 // See drawXScopeSpanFeatures() for explanations.
2457
2458 // Check right away if there is height!
2459 double height;
2460 if(!m_context.msp_integrationScope->getHeight(height))
2461 qFatal("Could not get height.");
2462
2463 // If there is no height, we have nothing to do here.
2464 if(!height)
2465 return;
2466 // qDebug() << "height:" << height;
2467
2468 // FIXME: is this still true?
2469 //
2470 // We do not want to show the position markers because the only horiontal
2471 // line to be visible must be contained between the start and end vertical
2472 // tracer items.
2473 mp_hPosTracerItem->setVisible(false);
2474 mp_vPosTracerItem->setVisible(false);
2475
2476 // First the easy part: the vertical position: centered on the
2477 // scope Y span.
2478 QPointF bottom_most_point;
2479 if(!m_context.msp_integrationScope->getBottomMostPoint(bottom_most_point))
2480 qFatal("Could not get the bottom-most bottom point.");
2481
2482 double y_axis_center_position = bottom_most_point.y() + height / 2;
2483
2484 // We want to draw the text outside the rectangle (if normal rectangle)
2485 // at a small distance from the vertical limit of the scope at the
2486 // position of the current drag point. We need to check the horizontal
2487 // drag direction to put the text at the right place (left of
2488 // current drag point if dragging right to left, for example).
2489
2490 // What is the distance between the rectangle line at current drag point and
2491 // the text itself.
2492 int pixels_away_from_line = 15;
2493 double x_axis_coordinate;
2494 double x_axis_pixel_coordinate;
2495
2496 if(static_cast<int>(m_context.m_dragDirections) &
2497 static_cast<int>(DragDirections::RIGHT_TO_LEFT))
2498 {
2499 QPointF left_most_point;
2500
2501 if(!m_context.msp_integrationScope->getLeftMostPoint(left_most_point))
2502 qFatal("Failed to get left most point.");
2503
2504 x_axis_coordinate = left_most_point.x();
2505
2506 pixels_away_from_line *= -1;
2507 }
2508 else
2509 {
2510 QPointF right_most_point;
2511
2512 if(!m_context.msp_integrationScope->getRightMostPoint(right_most_point))
2513 qFatal("Failed to get right most point.");
2514
2515 x_axis_coordinate = right_most_point.x();
2516 }
2517 x_axis_pixel_coordinate = xAxis->coordToPixel(x_axis_coordinate);
2518
2519 double x_axis_modified_pixel_coordinate =
2520 x_axis_pixel_coordinate + pixels_away_from_line;
2521
2522 // Set aside a point instance to store the pixel coordinates of the text.
2523 QPointF pixel_coordinates;
2524
2525 pixel_coordinates.setX(x_axis_modified_pixel_coordinate);
2526 pixel_coordinates.setY(y_axis_center_position);
2527
2528 // Now convert back to graph coordinates.
2529
2530 QPointF graph_coordinates(xAxis->pixelToCoord(pixel_coordinates.x()),
2531 yAxis->pixelToCoord(pixel_coordinates.y()));
2532
2533 mp_yDeltaTextItem->position->setCoords(graph_coordinates.x(),
2534 y_axis_center_position);
2535
2536 int decimals = Utils::zeroDecimalsInValue(height) + 3;
2537
2538 QString label_text = QString("full y span %1 -- y drag delta %2")
2539 .arg(height, 0, 'f', decimals)
2540 .arg(fabs(m_context.m_yDelta), 0, 'f', decimals);
2541
2542 mp_yDeltaTextItem->setText(label_text);
2543 mp_yDeltaTextItem->setFont(QFont(font().family(), 9));
2544 mp_yDeltaTextItem->setVisible(true);
2545 mp_yDeltaTextItem->setRotation(90);
2546
2547 // Set the boolean to true so that derived widgets know that something is
2548 // being measured, and they can act accordingly, for example by computing
2549 // deconvolutions in a mass spectrum.
2550 m_context.m_isMeasuringDistance = true;
2551
2552 replot();
2553
2554 // Let the caller know that we were measuring something.
2556}

References m_context, mp_hPosTracerItem, mp_vPosTracerItem, mp_yDeltaTextItem, pappso::RIGHT_TO_LEFT, xAxisMeasurementSignal(), and pappso::Utils::zeroDecimalsInValue().

Referenced by mouseMoveHandlerLeftButtonDraggingCursor(), mouseMoveHandlerRightButtonDraggingCursor(), and yMinMaxOnXAxisCurrentRange().

◆ getContext()

const BasePlotContext & pappso::BasePlotWidget::getContext ( ) const
virtual

Definition at line 3301 of file baseplotwidget.cpp.

3302{
3303 return m_context;
3304}

References m_context.

Referenced by yMinMaxOnXAxisCurrentRange().

◆ getInnermostRangeX()

QCPRange pappso::BasePlotWidget::getInnermostRangeX ( bool & found_range) const
virtual

Definition at line 2000 of file baseplotwidget.cpp.

2001{
2002
2003 return getRange(Enums::Axis::x, RangeType::innermost, found_range);
2004}
QCPRange getRange(Enums::Axis axis, RangeType range_type, bool &found_range) const

References getRange(), pappso::innermost, and pappso::Enums::x.

◆ getInnermostRangeY()

QCPRange pappso::BasePlotWidget::getInnermostRangeY ( bool & found_range) const
virtual

Definition at line 2013 of file baseplotwidget.cpp.

2014{
2015
2016 return getRange(Enums::Axis::y, RangeType::innermost, found_range);
2017}

References getRange(), pappso::innermost, and pappso::Enums::y.

◆ getOutermostRangeX()

QCPRange pappso::BasePlotWidget::getOutermostRangeX ( bool & found_range) const
virtual

Definition at line 2007 of file baseplotwidget.cpp.

2008{
2009 return getRange(Enums::Axis::x, RangeType::outermost, found_range);
2010}

References getRange(), pappso::outermost, and pappso::Enums::x.

◆ getOutermostRangeY()

QCPRange pappso::BasePlotWidget::getOutermostRangeY ( bool & found_range) const
virtual

Definition at line 2020 of file baseplotwidget.cpp.

2021{
2022 return getRange(Enums::Axis::y, RangeType::outermost, found_range);
2023}

References getRange(), pappso::outermost, and pappso::Enums::y.

◆ getPen()

const QPen & pappso::BasePlotWidget::getPen ( ) const
virtual

Definition at line 405 of file baseplotwidget.cpp.

406{
407 return m_pen;
408}

References m_pen.

◆ getPlottingColor() [1/2]

QColor pappso::BasePlotWidget::getPlottingColor ( int index = 0) const
virtual

Reimplemented in pappso::BaseColorMapPlotWidget.

Definition at line 451 of file baseplotwidget.cpp.

452{
453 QCPGraph *graph_p = graph(index);
454
455 if(graph_p == nullptr)
456 qFatal("Programming error.");
457
458 return getPlottingColor(graph_p);
459}
virtual QColor getPlottingColor(QCPAbstractPlottable *plottable_p) const

References getPlottingColor().

◆ getPlottingColor() [2/2]

QColor pappso::BasePlotWidget::getPlottingColor ( QCPAbstractPlottable * plottable_p) const
virtual

Definition at line 442 of file baseplotwidget.cpp.

443{
444 if(plottable_p == nullptr)
445 qFatal("Programming error.");
446
447 return plottable_p->pen().color();
448}

Referenced by getPlottingColor().

◆ getRange()

QCPRange pappso::BasePlotWidget::getRange ( Enums::Axis axis,
RangeType range_type,
bool & found_range ) const

Definition at line 1909 of file baseplotwidget.cpp.

1912{
1913
1914 // Iterate in all the graphs in this widget and return a QCPRange that has
1915 // its lower member as the greatest lower value of all
1916 // its upper member as the smallest upper value of all
1917
1918 if(!graphCount())
1919 {
1920 found_range = false;
1921
1922 return QCPRange(0, 1);
1923 }
1924
1925 if(graphCount() == 1)
1926 return graph()->getKeyRange(found_range);
1927
1928 bool found_at_least_one_range = false;
1929
1930 // Create an invalid range.
1931 QCPRange result_range(QCPRange::minRange + 1, QCPRange::maxRange + 1);
1932
1933 for(int iter = 0; iter < graphCount(); ++iter)
1934 {
1935 QCPRange temp_range;
1936
1937 bool found_range_for_iter = false;
1938
1939 QCPGraph *graph_p = graph(iter);
1940
1941 // Depending on the axis param, select the key or value range.
1942
1943 if(axis == Enums::Axis::x)
1944 temp_range = graph_p->getKeyRange(found_range_for_iter);
1945 else if(axis == Enums::Axis::y)
1946 temp_range = graph_p->getValueRange(found_range_for_iter);
1947 else
1948 qFatal("Cannot reach this point. Programming error.");
1949
1950 // Was a range found for the iterated graph ? If not skip this
1951 // iteration.
1952
1953 if(!found_range_for_iter)
1954 continue;
1955
1956 // While the innermost_range is invalid, we need to seed it with a good
1957 // one. So check this.
1958
1959 if(!QCPRange::validRange(result_range))
1960 qFatal("The obtained range is invalid !");
1961
1962 // At this point we know the obtained range is OK.
1963 result_range = temp_range;
1964
1965 // We found at least one valid range!
1966 found_at_least_one_range = true;
1967
1968 // At this point we have two valid ranges to compare. Depending on
1969 // range_type, we need to perform distinct comparisons.
1970
1971 if(range_type == RangeType::innermost)
1972 {
1973 if(temp_range.lower > result_range.lower)
1974 result_range.lower = temp_range.lower;
1975 if(temp_range.upper < result_range.upper)
1976 result_range.upper = temp_range.upper;
1977 }
1978 else if(range_type == RangeType::outermost)
1979 {
1980 if(temp_range.lower < result_range.lower)
1981 result_range.lower = temp_range.lower;
1982 if(temp_range.upper > result_range.upper)
1983 result_range.upper = temp_range.upper;
1984 }
1985 else
1986 qFatal("Cannot reach this point. Programming error.");
1987
1988 // Continue to next graph, if any.
1989 }
1990 // End of
1991 // for(int iter = 0; iter < graphCount(); ++iter)
1992
1993 // Let the caller know if we found at least one range.
1994 found_range = found_at_least_one_range;
1995
1996 return result_range;
1997}

References pappso::innermost, pappso::outermost, pappso::Enums::x, and pappso::Enums::y.

Referenced by getInnermostRangeX(), getInnermostRangeY(), getOutermostRangeX(), and getOutermostRangeY().

◆ getRangeX()

QCPRange pappso::BasePlotWidget::getRangeX ( bool & found_range,
int index ) const
virtual

MOUSE MOVEMENTS mouse/keyboard-triggered.

RANGE-related functions

Definition at line 1887 of file baseplotwidget.cpp.

1888{
1889 QCPGraph *graph_p = graph(index);
1890
1891 if(graph_p == nullptr)
1892 qFatal("Programming error.");
1893
1894 return graph_p->getKeyRange(found_range);
1895}

◆ getRangeY()

QCPRange pappso::BasePlotWidget::getRangeY ( bool & found_range,
int index ) const
virtual

Definition at line 1898 of file baseplotwidget.cpp.

1899{
1900 QCPGraph *graph_p = graph(index);
1901
1902 if(graph_p == nullptr)
1903 qFatal("Programming error.");
1904
1905 return graph_p->getValueRange(found_range);
1906}

◆ hideAllPlotItems()

void pappso::BasePlotWidget::hideAllPlotItems ( )
virtual

PLOTTING / REPLOTTING functions.

PLOT ITEMS : TRACER TEXT ITEMS...

PLOT ITEMS : TRACER TEXT ITEMS... Hide the selection line, the xDelta text and the zoom rectangle items.

Definition at line 2233 of file baseplotwidget.cpp.

2234{
2235 mp_xDeltaTextItem->setVisible(false);
2236 mp_yDeltaTextItem->setVisible(false);
2237
2238 // mp_zoomRectItem->setVisible(false);
2240
2241 // Force a replot to make sure the action is immediately visible by the
2242 // user, even without moving the mouse.
2243 replot();
2244}
virtual void hideSelectionRectangle(bool reset_values=false)

References hideSelectionRectangle(), mp_xDeltaTextItem, and mp_yDeltaTextItem.

Referenced by restoreAxesRangeHistory(), and yMinMaxOnXAxisCurrentRange().

◆ hideSelectionRectangle()

void pappso::BasePlotWidget::hideSelectionRectangle ( bool reset_values = false)
virtual

◆ hideTracers()

void pappso::BasePlotWidget::hideTracers ( )
virtual

Hide the traces (vertical and horizontal).

Definition at line 2265 of file baseplotwidget.cpp.

2266{
2268 mp_hPosTracerItem->setVisible(false);
2269 mp_vPosTracerItem->setVisible(false);
2270
2271 mp_vStartTracerItem->setVisible(false);
2272 mp_vEndTracerItem->setVisible(false);
2273
2274 // Force a replot to make sure the action is immediately visible by the
2275 // user, even without moving the mouse.
2276 replot();
2277}
bool m_shouldTracersBeVisible
Tells if the tracers should be visible.

References m_shouldTracersBeVisible, mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, and mp_vStartTracerItem.

Referenced by keyReleaseEvent(), and yMinMaxOnXAxisCurrentRange().

◆ horizontalGetGraphCoordNewPointCountPixels()

QPointF pappso::BasePlotWidget::horizontalGetGraphCoordNewPointCountPixels ( int pixel_count)
virtual

Definition at line 1836 of file baseplotwidget.cpp.

1837{
1838 QPointF pixel_coordinates(
1839 xAxis->coordToPixel(m_context.m_lastCursorHoveredPoint.x()) + pixel_count,
1840 yAxis->coordToPixel(m_context.m_lastCursorHoveredPoint.y()));
1841
1842 // Now convert back to local coordinates.
1843
1844 QPointF graph_coordinates(xAxis->pixelToCoord(pixel_coordinates.x()),
1845 yAxis->pixelToCoord(pixel_coordinates.y()));
1846
1847 return graph_coordinates;
1848}

References m_context.

Referenced by horizontalMoveMouseCursorCountPixels().

◆ horizontalMoveMouseCursorCountPixels()

void pappso::BasePlotWidget::horizontalMoveMouseCursorCountPixels ( int pixel_count)
virtual

Definition at line 1821 of file baseplotwidget.cpp.

1822{
1823 QPointF graph_coord = horizontalGetGraphCoordNewPointCountPixels(pixel_count);
1824
1825 QPointF pixel_coord(xAxis->coordToPixel(graph_coord.x()),
1826 yAxis->coordToPixel(graph_coord.y()));
1827
1828 // Now we need ton convert the new coordinates to the global position system
1829 // and to move the cursor to that new position. That will create an event to
1830 // move the mouse cursor.
1831
1832 moveMouseCursorPixelCoordToGlobal(pixel_coord.toPoint());
1833}
virtual void moveMouseCursorPixelCoordToGlobal(QPointF local_coordinates)
virtual QPointF horizontalGetGraphCoordNewPointCountPixels(int pixel_count)

References horizontalGetGraphCoordNewPointCountPixels(), and moveMouseCursorPixelCoordToGlobal().

Referenced by directionKeyPressEvent().

◆ integrationRequestedSignal

void pappso::BasePlotWidget::integrationRequestedSignal ( const BasePlotContext & context)
signal

◆ isClickOntoXAxis()

bool pappso::BasePlotWidget::isClickOntoXAxis ( const QPointF & mousePoint)

Definition at line 1721 of file baseplotwidget.cpp.

1722{
1723 QCPLayoutElement *layoutElement = layoutElementAt(mousePoint);
1724
1725 if(layoutElement &&
1726 layoutElement == dynamic_cast<QCPLayoutElement *>(axisRect()))
1727 {
1728 // The graph is *inside* the axisRect that is the outermost envelope of
1729 // the graph. Thus, if we want to know if the click was indeed on an
1730 // axis, we need to check what selectable part of the the axisRect we
1731 // were clicking:
1732 QCPAxis::SelectablePart selectablePart;
1733
1734 selectablePart = xAxis->getPartAt(mousePoint);
1735
1736 if(selectablePart == QCPAxis::spAxisLabel ||
1737 selectablePart == QCPAxis::spAxis ||
1738 selectablePart == QCPAxis::spTickLabels)
1739 return true;
1740 }
1741
1742 return false;
1743}

Referenced by mousePressHandler().

◆ isClickOntoYAxis()

bool pappso::BasePlotWidget::isClickOntoYAxis ( const QPointF & mousePoint)

Definition at line 1746 of file baseplotwidget.cpp.

1747{
1748 QCPLayoutElement *layoutElement = layoutElementAt(mousePoint);
1749
1750 if(layoutElement &&
1751 layoutElement == dynamic_cast<QCPLayoutElement *>(axisRect()))
1752 {
1753 // The graph is *inside* the axisRect that is the outermost envelope of
1754 // the graph. Thus, if we want to know if the click was indeed on an
1755 // axis, we need to check what selectable part of the the axisRect we
1756 // were clicking:
1757 QCPAxis::SelectablePart selectablePart;
1758
1759 selectablePart = yAxis->getPartAt(mousePoint);
1760
1761 if(selectablePart == QCPAxis::spAxisLabel ||
1762 selectablePart == QCPAxis::spAxis ||
1763 selectablePart == QCPAxis::spTickLabels)
1764 return true;
1765 }
1766
1767 return false;
1768}

Referenced by mousePressHandler().

◆ isSelectionRectangleVisible()

bool pappso::BasePlotWidget::isSelectionRectangleVisible ( )
virtual

Definition at line 3237 of file baseplotwidget.cpp.

3238{
3239 // Sanity check
3240 int check = 0;
3241
3242 check += mp_selectionRectangeLine1->visible();
3243 check += mp_selectionRectangeLine2->visible();
3244 check += mp_selectionRectangeLine3->visible();
3245 check += mp_selectionRectangeLine4->visible();
3246
3247 if(check > 0)
3248 return true;
3249
3250 return false;
3251}

References mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, and mp_selectionRectangeLine4.

Referenced by yMinMaxOnXAxisCurrentRange().

◆ isVerticalDisplacementAboveThreshold()

bool pappso::BasePlotWidget::isVerticalDisplacementAboveThreshold ( )
virtual

Definition at line 2579 of file baseplotwidget.cpp.

2580{
2581 // First get the height of the plot.
2582 double plotHeight = yAxis->range().upper - yAxis->range().lower;
2583
2584 double heightDiff =
2585 fabs(m_context.m_startDragPoint.y() - m_context.m_currentDragPoint.y());
2586
2587 double heightDiffRatio = (heightDiff / plotHeight) * 100;
2588
2589 if(heightDiffRatio > 10)
2590 {
2591 return true;
2592 }
2593
2594 return false;
2595}

References m_context.

Referenced by keyReleaseEvent(), mouseMoveHandlerLeftButtonDraggingCursor(), mouseMoveHandlerRightButtonDraggingCursor(), and yMinMaxOnXAxisCurrentRange().

◆ keyPressEvent()

void pappso::BasePlotWidget::keyPressEvent ( QKeyEvent * event)
virtual

KEYBOARD-related EVENTS.

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 607 of file baseplotwidget.cpp.

608{
609 // qDebug() << "ENTER";
610
611 // We need this because some keys modify our behaviour.
612 m_context.m_pressedKeyCode = event->key();
613 m_context.m_keyboardModifiers = QGuiApplication::queryKeyboardModifiers();
614
615 if(event->key() == Qt::Key_Left || event->key() == Qt::Key_Right ||
616 event->key() == Qt::Key_Up || event->key() == Qt::Key_Down)
617 {
618 return directionKeyPressEvent(event);
619 }
620 else if(event->key() == m_leftMousePseudoButtonKey ||
621 event->key() == m_rightMousePseudoButtonKey)
622 {
623 return mousePseudoButtonKeyPressEvent(event);
624 }
625
626 // Do not do anything here, because this function is used by derived classes
627 // that will emit the signal below. Otherwise there are going to be multiple
628 // signals sent.
629 // qDebug() << "Going to emit keyPressEventSignal(m_context);";
630 // emit keyPressEventSignal(m_context);
631}
virtual void mousePseudoButtonKeyPressEvent(QKeyEvent *event)
virtual void directionKeyPressEvent(QKeyEvent *event)

References directionKeyPressEvent(), m_context, m_leftMousePseudoButtonKey, m_rightMousePseudoButtonKey, and mousePseudoButtonKeyPressEvent().

Referenced by pappso::DriftSpecMassSpecColorMapPlotWidget::keyPressEvent(), pappso::DriftSpecTracePlotWidget::keyPressEvent(), pappso::MassSpecTracePlotWidget::keyPressEvent(), pappso::TicXicChromDriftSpecColorMapPlotWidget::keyPressEvent(), pappso::TicXicChromMassSpecColorMapPlotWidget::keyPressEvent(), and pappso::TicXicChromTracePlotWidget::keyPressEvent().

◆ keyPressEventSignal

void pappso::BasePlotWidget::keyPressEventSignal ( const pappso::BasePlotContext & context)
signal

◆ keyReleaseEvent()

void pappso::BasePlotWidget::keyReleaseEvent ( QKeyEvent * event)
virtual

Handle specific key codes and trigger respective actions.

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 635 of file baseplotwidget.cpp.

636{
637 m_context.m_releasedKeyCode = event->key();
638
639 // The keyboard key is being released, set the key code to 0.
640 m_context.m_pressedKeyCode = 0;
641
642 m_context.m_keyboardModifiers = QGuiApplication::queryKeyboardModifiers();
643
644 // Now test if the key that was released is one of the housekeeping keys.
645 if(event->key() == Qt::Key_Backspace)
646 {
647 // qDebug();
648
649 // The user wants to iterate back in the x/y axis range history.
651
652 event->accept();
653 }
654 else if(event->key() == Qt::Key_Space)
655 {
656 return spaceKeyReleaseEvent(event);
657 }
658 else if(event->key() == Qt::Key_Delete)
659 {
660 // The user wants to delete a graph. What graph is to be determined
661 // programmatically:
662
663 // If there is a single graph, then that is the graph to be removed.
664 // If there are more than one graph, then only the ones that are selected
665 // are to be removed.
666
667 // Note that the user of this widget might want to provide the user with
668 // the ability to specify if all the children graph needs to be removed
669 // also. This can be coded in key modifiers. So provide the context.
670
671 int graph_count = plottableCount();
672
673 if(!graph_count)
674 {
675 // qDebug() << "Not a single graph in the plot widget. Doing
676 // nothing.";
677
678 event->accept();
679 return;
680 }
681
682 if(graph_count == 1)
683 {
684 // qDebug() << "A single graph is in the plot widget. Emitting a graph
685 // " "destruction requested signal for it:"
686 //<< graph();
687
689 }
690 else
691 {
692 // At this point we know there are more than one graph in the plot
693 // widget. We need to get the selected one (if any).
694 QList<QCPGraph *> selected_graph_list;
695
696 selected_graph_list = selectedGraphs();
697
698 if(!selected_graph_list.size())
699 {
700 event->accept();
701 return;
702 }
703
704 // qDebug() << "Number of selected graphs to be destrobyed:"
705 //<< selected_graph_list.size();
706
707 for(int iter = 0; iter < selected_graph_list.size(); ++iter)
708 {
709 // qDebug()
710 //<< "Emitting a graph destruction requested signal for graph:"
711 //<< selected_graph_list.at(iter);
712
714 this, selected_graph_list.at(iter), m_context);
715
716 // We do not do this, because we want the slot called by the
717 // signal above to handle that removal. Remember that it is not
718 // possible to delete graphs manually.
719 //
720 // removeGraph(selected_graph_list.at(iter));
721 }
722 event->accept();
723 }
724 }
725 // End of
726 // else if(event->key() == Qt::Key_Delete)
727 else if(event->key() == Qt::Key_T)
728 {
729 // The user wants to toggle the visibiity of the tracers.
731
733 hideTracers();
734 else
735 showTracers();
736
737 event->accept();
738 }
739 else if(event->key() == Qt::Key_Left || event->key() == Qt::Key_Right ||
740 event->key() == Qt::Key_Up || event->key() == Qt::Key_Down)
741 {
742 return directionKeyReleaseEvent(event);
743 }
744 else if(event->key() == m_leftMousePseudoButtonKey ||
745 event->key() == m_rightMousePseudoButtonKey)
746 {
748 }
749 else if(event->key() == Qt::Key_S)
750 {
751 // The user is defining the size of the rhomboid fixed side. That could be
752 // either a vertical side (less intuitive) or a horizontal size (more
753 // intuitive, first exclusive implementation). But, in order to be able to
754 // perform identical integrations starting from non-transposed color maps
755 // and transposed color maps, the ability to define a vertical fixed size
756 // side of the rhomboid integration scope has become necessary.
757
758 // Check if the vertical displacement is significant (>= 10% of the color
759 // map height.
760
762 {
763 // The user is dragging the cursor vertically in a sufficient delta to
764 // consider that they are willing to define a vertical fixed size
765 // of the rhomboid integration scope.
766
767 m_context.m_integrationScopeRhombWidth = 0;
768 m_context.m_integrationScopeRhombHeight = abs(
769 m_context.m_currentDragPoint.y() - m_context.m_startDragPoint.y());
770
771 // qDebug() << "Set m_context.m_integrationScopePolyHeight to"
772 // << m_context.m_integrationScopeRhombHeight
773 // << "upon release of S key";
774 }
775 else
776 {
777 // The user is dragging the cursor horiontally to define a horizontal
778 // fixed size of the rhomboid integration scope.
779
780 m_context.m_integrationScopeRhombWidth = abs(
781 m_context.m_currentDragPoint.x() - m_context.m_startDragPoint.x());
782 m_context.m_integrationScopeRhombHeight = 0;
783
784 // qDebug() << "Set m_context.m_integrationScopePolyWidth to"
785 // << m_context.m_integrationScopeRhombWidth
786 // << "upon release of S key";
787 }
788 }
789 // At this point emit the signal, since we did not treat it. Maybe the
790 // consumer widget wants to know that the keyboard key was released.
791
793}
void plottableDestructionRequestedSignal(BasePlotWidget *base_plot_widget_p, QCPAbstractPlottable *plottable_p, const pappso::BasePlotContext &context)
virtual void directionKeyReleaseEvent(QKeyEvent *event)
virtual void spaceKeyReleaseEvent(QKeyEvent *event)
virtual bool isVerticalDisplacementAboveThreshold()
virtual void showTracers()
Show the traces (vertical and horizontal).
void keyReleaseEventSignal(const pappso::BasePlotContext &context)
virtual void restorePreviousAxesRangeHistory()
Go up one history element in the axis history.
virtual void hideTracers()
Hide the traces (vertical and horizontal).
virtual void mousePseudoButtonKeyReleaseEvent(QKeyEvent *event)

References directionKeyReleaseEvent(), hideTracers(), isVerticalDisplacementAboveThreshold(), keyReleaseEventSignal(), m_context, m_leftMousePseudoButtonKey, m_rightMousePseudoButtonKey, m_shouldTracersBeVisible, mousePseudoButtonKeyReleaseEvent(), plottableDestructionRequestedSignal(), restorePreviousAxesRangeHistory(), showTracers(), and spaceKeyReleaseEvent().

Referenced by pappso::DriftSpecMassSpecColorMapPlotWidget::keyReleaseEvent(), pappso::DriftSpecTracePlotWidget::keyReleaseEvent(), pappso::MassSpecTracePlotWidget::keyReleaseEvent(), pappso::TicXicChromDriftSpecColorMapPlotWidget::keyReleaseEvent(), pappso::TicXicChromMassSpecColorMapPlotWidget::keyReleaseEvent(), and pappso::TicXicChromTracePlotWidget::keyReleaseEvent().

◆ keyReleaseEventSignal

void pappso::BasePlotWidget::keyReleaseEventSignal ( const pappso::BasePlotContext & context)
signal

Referenced by keyReleaseEvent().

◆ lastCursorHoveredPointSignal

void pappso::BasePlotWidget::lastCursorHoveredPointSignal ( const QPointF & pointf)
signal

◆ layerableLayerIndex()

int pappso::BasePlotWidget::layerableLayerIndex ( QCPLayerable * layerable_p) const
protectedvirtual

Definition at line 198 of file baseplotwidget.cpp.

199{
200 if(layerable_p == nullptr)
201 qFatal("Programming error.");
202
203 QCPLayer *layer_p = layerable_p->layer();
204
205 for(int iter = 0; iter < layerCount(); ++iter)
206 {
207 if(layer(iter) == layer_p)
208 return iter;
209 }
210
211 return -1;
212}

◆ layerableLayerName()

QString pappso::BasePlotWidget::layerableLayerName ( QCPLayerable * layerable_p) const
protectedvirtual

Definition at line 187 of file baseplotwidget.cpp.

188{
189 if(layerable_p == nullptr)
190 qFatal("Programming error.");
191
192 QCPLayer *layer_p = layerable_p->layer();
193
194 return layer_p->name();
195}

◆ mouseMoveHandler()

void pappso::BasePlotWidget::mouseMoveHandler ( QMouseEvent * event)
virtual

KEYBOARD-related EVENTS.

MOUSE-related EVENTS

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 926 of file baseplotwidget.cpp.

927{
928
929 // If we have no focus, then get it. See setFocus() to understand why asking
930 // for focus is cosly and thus why we want to make this decision first.
931 if(!hasFocus())
932 setFocus();
933
934 // qDebug() << (graph() != nullptr);
935 // if(graph(0) != nullptr)
936 // { // check if the widget contains some graphs
937
938 // The event->button() must be by Qt instructions considered to be 0.
939
940 // Whatever happens, we want to store the plot coordinates of the current
941 // mouse cursor position (will be useful later for countless needs).
942
943 QPointF mousePoint = event->position();
944
945 // qDebug() << "local mousePoint position in pixels:" << mousePoint;
946
947 m_context.m_lastCursorHoveredPoint.setX(xAxis->pixelToCoord(mousePoint.x()));
948 m_context.m_lastCursorHoveredPoint.setY(yAxis->pixelToCoord(mousePoint.y()));
949
950 // qDebug() << "lastCursorHoveredPoint coord:"
951 //<< m_context.m_lastCursorHoveredPoint;
952
953 // Now, depending on the button(s) (if any) that are pressed or not, we
954 // have a different processing.
955
956 // qDebug();
957
958 if(m_context.m_pressedMouseButtons & Qt::LeftButton ||
959 m_context.m_pressedMouseButtons & Qt::RightButton)
961 else
963 // }
964 // qDebug();
965 event->accept();
966}
virtual void mouseMoveHandlerDraggingCursor(QMouseEvent *event)
virtual void mouseMoveHandlerNotDraggingCursor(QMouseEvent *event)
virtual void setFocus()
PLOT ITEMS : TRACER TEXT ITEMS...

References m_context, mouseMoveHandlerDraggingCursor(), mouseMoveHandlerNotDraggingCursor(), and setFocus().

Referenced by pappso::DriftSpecMassSpecColorMapPlotWidget::mouseMoveHandler(), pappso::DriftSpecTracePlotWidget::mouseMoveHandler(), pappso::MassSpecTracePlotWidget::mouseMoveHandler(), pappso::TicXicChromDriftSpecColorMapPlotWidget::mouseMoveHandler(), pappso::TicXicChromMassSpecColorMapPlotWidget::mouseMoveHandler(), pappso::TicXicChromTracePlotWidget::mouseMoveHandler(), and setupWidget().

◆ mouseMoveHandlerDraggingCursor()

void pappso::BasePlotWidget::mouseMoveHandlerDraggingCursor ( QMouseEvent * event)
virtual

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 1033 of file baseplotwidget.cpp.

1034{
1035 // qDebug();
1036
1037 m_context.m_isMouseDragging = true;
1038
1039 // Now store the mouse position data into the the current drag point
1040 // member datum, that will be used in countless occasions later.
1041 m_context.m_currentDragPoint = m_context.m_lastCursorHoveredPoint;
1042 m_context.m_keyboardModifiers = QGuiApplication::queryKeyboardModifiers();
1043
1044 // When we drag (either keyboard or mouse), we hide the position markers
1045 // (black) and we show the start and end vertical markers for the region.
1046 // Then, we draw the horizontal region range marker that delimits
1047 // horizontally the dragged-over region.
1048
1049 if(mp_hPosTracerItem != nullptr)
1050 mp_hPosTracerItem->setVisible(false);
1051 if(mp_vPosTracerItem != nullptr)
1052 mp_vPosTracerItem->setVisible(false);
1053
1054 // Only bother with the tracers if the user wants them to be visible.
1056 {
1057
1058 // The vertical end tracer position must be refreshed.
1059 mp_vEndTracerItem->start->setCoords(m_context.m_currentDragPoint.x(),
1060 yAxis->range().upper);
1061
1062 mp_vEndTracerItem->end->setCoords(m_context.m_currentDragPoint.x(),
1063 yAxis->range().lower);
1064
1065 mp_vEndTracerItem->setVisible(true);
1066 }
1067
1068 // Whatever the button, when we are dealing with the axes, we do not
1069 // want to show any of the tracers.
1070
1071 if(m_context.m_wasClickOnXAxis || m_context.m_wasClickOnYAxis)
1072 {
1073 if(mp_hPosTracerItem != nullptr)
1074 mp_hPosTracerItem->setVisible(false);
1075 if(mp_vPosTracerItem != nullptr)
1076 mp_vPosTracerItem->setVisible(false);
1077
1078 if(mp_vStartTracerItem != nullptr)
1079 mp_vStartTracerItem->setVisible(false);
1080 if(mp_vEndTracerItem != nullptr)
1081 mp_vEndTracerItem->setVisible(false);
1082 }
1083 else
1084 {
1085 // qDebug() << "Not moving the mouse cursor over any of the axes.";
1086
1087 // Since we are not dragging the mouse cursor over the axes, make sure
1088 // we store the drag directions in the context, as this might be
1089 // useful for later operations.
1090 // qDebug() << "Recording the drag direction(s).";
1091
1092 m_context.recordDragDirections();
1093
1094 // qDebug() << "Drag direction(s): " <<
1095 // m_context.dragDirectionsToString();
1096 }
1097
1098 // Because when we drag the mouse button (whatever the button) we need to
1099 // know what is the drag delta (distance between start point and current
1100 // point of the drag operation) on both axes, ask that these x|y deltas be
1101 // computed.
1103
1104 // Now deal with the BUTTON-SPECIFIC CODE.
1105
1106 if(m_context.m_mouseButtonsAtMousePress & Qt::LeftButton)
1107 {
1109 }
1110 else if(m_context.m_mouseButtonsAtMousePress & Qt::RightButton)
1111 {
1113 }
1114}
virtual void mouseMoveHandlerLeftButtonDraggingCursor(QMouseEvent *event)
virtual void mouseMoveHandlerRightButtonDraggingCursor(QMouseEvent *event)
virtual void calculateDragDeltas()

References calculateDragDeltas(), m_context, m_shouldTracersBeVisible, mouseMoveHandlerLeftButtonDraggingCursor(), mouseMoveHandlerRightButtonDraggingCursor(), mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, and mp_vStartTracerItem.

Referenced by mouseMoveHandler(), pappso::DriftSpecMassSpecColorMapPlotWidget::mouseMoveHandlerDraggingCursor(), pappso::DriftSpecTracePlotWidget::mouseMoveHandlerDraggingCursor(), pappso::MassSpecTracePlotWidget::mouseMoveHandlerDraggingCursor(), pappso::TicXicChromDriftSpecColorMapPlotWidget::mouseMoveHandlerDraggingCursor(), pappso::TicXicChromMassSpecColorMapPlotWidget::mouseMoveHandlerDraggingCursor(), and pappso::TicXicChromTracePlotWidget::mouseMoveHandlerDraggingCursor().

◆ mouseMoveHandlerLeftButtonDraggingCursor()

void pappso::BasePlotWidget::mouseMoveHandlerLeftButtonDraggingCursor ( QMouseEvent * event)
virtual

Definition at line 1117 of file baseplotwidget.cpp.

1118{
1119 Q_UNUSED(event)
1120
1121 // qDebug() << "The left button is dragging.";
1122
1123 // Set the context.m_isMeasuringDistance to false, which later might be set
1124 // to true if effectively we are measuring a distance. This is required
1125 // because the derived widget classes might want to know if they have to
1126 // perform some action on the basis that context is measuring a distance,
1127 // for example the mass spectrum-specific widget might want to compute
1128 // deconvolutions.
1129
1130 m_context.m_isMeasuringDistance = false;
1131
1132 // Let's first check if the mouse drag operation originated on either
1133 // axis. In that case, the user is performing axis reframing or rescaling.
1134
1135 if(m_context.m_wasClickOnXAxis || m_context.m_wasClickOnYAxis)
1136 {
1137 // qDebug() << "Click was on one of the axes.";
1138
1139 if(m_context.m_keyboardModifiers & Qt::ControlModifier)
1140 {
1141 // The user is asking a rescale of the plot.
1142
1143 // We know that we do not want the tracers when we perform axis
1144 // rescaling operations.
1145
1146 if(mp_hPosTracerItem != nullptr)
1147 mp_hPosTracerItem->setVisible(false);
1148 if(mp_vPosTracerItem != nullptr)
1149 mp_vPosTracerItem->setVisible(false);
1150
1151 if(mp_vStartTracerItem != nullptr)
1152 mp_vStartTracerItem->setVisible(false);
1153 if(mp_vEndTracerItem != nullptr)
1154 mp_vEndTracerItem->setVisible(false);
1155
1156 // This operation is particularly intensive, thus we want to
1157 // reduce the number of calculations by skipping this calculation
1158 // a number of times. The user can ask for this feature by
1159 // clicking the 'Q' letter.
1160
1161 if(m_context.m_pressedKeyCode == Qt::Key_Q)
1162 {
1164 {
1166 return;
1167 }
1168 else
1169 {
1171 }
1172 }
1173
1174 // qDebug() << "Asking that the axes be rescaled.";
1175
1176 axisRescale();
1177 }
1178 else
1179 {
1180 // The user was simply dragging the axis. Just pan, that is slide
1181 // the plot in the same direction as the mouse movement and with the
1182 // same amplitude.
1183
1184 // qDebug() << "Asking that the axes be panned.";
1185
1186 axisPan();
1187 }
1188
1189 return;
1190 }
1191
1192 // At this point we understand that the user was not performing any
1193 // panning/rescaling operation by clicking on any one of the axes.. Go on
1194 // with other possibilities.
1195
1196 // Let's check if the user is actually drawing a rectangle (covering a
1197 // real area) or is drawing a line.
1198
1199 // qDebug() << "The mouse dragging did not originate on an axis.";
1200
1202 {
1203 // qDebug() << "Apparently the selection is two-dimensional.";
1204
1205 // When we draw a two-dimensional integration scope, the tracers are of no
1206 // use.
1207
1208 if(mp_hPosTracerItem != nullptr)
1209 mp_hPosTracerItem->setVisible(false);
1210 if(mp_vPosTracerItem != nullptr)
1211 mp_vPosTracerItem->setVisible(false);
1212
1213 if(mp_vStartTracerItem != nullptr)
1214 mp_vStartTracerItem->setVisible(false);
1215 if(mp_vEndTracerItem != nullptr)
1216 mp_vEndTracerItem->setVisible(false);
1217
1218 // Draw the rectangle, false, not as line segment and
1219 // false, not for integration
1220 drawSelectionRectangleAndPrepareZoom(false /*as_line_segment*/,
1221 false /* for_integration*/);
1222
1223 // Draw the selection width/height text
1226 }
1227 else
1228 {
1229 // qDebug() << "Apparently we are measuring a delta.";
1230
1231 // Draw the rectangle, true, as line segment and
1232 // false, not for integration
1234
1235 // The pure position tracers should be hidden.
1236 if(mp_hPosTracerItem != nullptr)
1237 mp_hPosTracerItem->setVisible(true);
1238 if(mp_vPosTracerItem != nullptr)
1239 mp_vPosTracerItem->setVisible(true);
1240
1241 // Then, make sure the region range vertical tracers are visible.
1242 if(mp_vStartTracerItem != nullptr)
1243 mp_vStartTracerItem->setVisible(true);
1244 if(mp_vEndTracerItem != nullptr)
1245 mp_vEndTracerItem->setVisible(true);
1246
1247 // Draw the selection width text
1249 }
1250}
int m_mouseMoveHandlerSkipAmount
How many mouse move events must be skipped *‍/.
virtual void drawSelectionRectangleAndPrepareZoom(bool as_line_segment=false, bool for_integration=false)
int m_mouseMoveHandlerSkipCount
Counter to handle the "fat data" mouse move event handling.
virtual void drawXScopeSpanFeatures()
virtual void drawYScopeSpanFeatures()
virtual void axisRescale()
RANGE-related functions.

References axisPan(), axisRescale(), drawSelectionRectangleAndPrepareZoom(), drawXScopeSpanFeatures(), drawYScopeSpanFeatures(), isVerticalDisplacementAboveThreshold(), m_context, m_mouseMoveHandlerSkipAmount, m_mouseMoveHandlerSkipCount, mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, and mp_vStartTracerItem.

Referenced by mouseMoveHandlerDraggingCursor().

◆ mouseMoveHandlerNotDraggingCursor()

void pappso::BasePlotWidget::mouseMoveHandlerNotDraggingCursor ( QMouseEvent * event)
virtual

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 969 of file baseplotwidget.cpp.

970{
971 Q_UNUSED(event)
972
973 // qDebug();
974 m_context.m_isMouseDragging = false;
975
976 // qDebug();
977 // We are not dragging the mouse (no button pressed), simply let this
978 // widget's consumer know the position of the cursor and update the markers.
979 // The consumer of this widget will update mouse cursor position at
980 // m_context.m_lastCursorHoveredPoint if so needed.
981
982 emit lastCursorHoveredPointSignal(m_context.m_lastCursorHoveredPoint);
983
984 // qDebug();
985
986 // We are not dragging, so we do not show the region end tracer we only
987 // show the anchoring start trace that might be of use if the user starts
988 // using the arrow keys to move the cursor.
989 if(mp_vEndTracerItem != nullptr)
990 mp_vEndTracerItem->setVisible(false);
991
992 // qDebug();
993 // Only bother with the tracers if the user wants them to be visible.
994 // Their crossing point must be exactly at the last cursor-hovered point.
995
997 {
998 // We are not dragging, so only show the position markers (v and h);
999
1000 // qDebug();
1001 if(mp_hPosTracerItem != nullptr)
1002 {
1003 // Horizontal position tracer.
1004 mp_hPosTracerItem->setVisible(true);
1005 mp_hPosTracerItem->start->setCoords(
1006 xAxis->range().lower, m_context.m_lastCursorHoveredPoint.y());
1007 mp_hPosTracerItem->end->setCoords(
1008 xAxis->range().upper, m_context.m_lastCursorHoveredPoint.y());
1009 }
1010
1011 // qDebug();
1012 // Vertical position tracer.
1013 if(mp_vPosTracerItem != nullptr)
1014 {
1015 mp_vPosTracerItem->setVisible(true);
1016
1017 mp_vPosTracerItem->setVisible(true);
1018 mp_vPosTracerItem->start->setCoords(
1019 m_context.m_lastCursorHoveredPoint.x(), yAxis->range().upper);
1020 mp_vPosTracerItem->end->setCoords(
1021 m_context.m_lastCursorHoveredPoint.x(), yAxis->range().lower);
1022 }
1023
1024 // qDebug();
1025 replot();
1026 }
1027
1028
1029 return;
1030}
void lastCursorHoveredPointSignal(const QPointF &pointf)

References lastCursorHoveredPointSignal(), m_context, m_shouldTracersBeVisible, mp_hPosTracerItem, mp_vEndTracerItem, and mp_vPosTracerItem.

Referenced by mouseMoveHandler(), pappso::DriftSpecMassSpecColorMapPlotWidget::mouseMoveHandlerNotDraggingCursor(), pappso::DriftSpecTracePlotWidget::mouseMoveHandlerNotDraggingCursor(), pappso::MassSpecTracePlotWidget::mouseMoveHandlerNotDraggingCursor(), pappso::TicXicChromDriftSpecColorMapPlotWidget::mouseMoveHandlerNotDraggingCursor(), pappso::TicXicChromMassSpecColorMapPlotWidget::mouseMoveHandlerNotDraggingCursor(), and pappso::TicXicChromTracePlotWidget::mouseMoveHandlerNotDraggingCursor().

◆ mouseMoveHandlerRightButtonDraggingCursor()

void pappso::BasePlotWidget::mouseMoveHandlerRightButtonDraggingCursor ( QMouseEvent * event)
virtual

Definition at line 1253 of file baseplotwidget.cpp.

1254{
1255 Q_UNUSED(event)
1256 // qDebug() << "The right button is dragging.";
1257
1258 // Set the context.m_isMeasuringDistance to false, which later might be set
1259 // to true if effectively we are measuring a distance. This is required
1260 // because the derived widgets might want to know if they have to perform
1261 // some action on the basis that context is measuring a distance, for
1262 // example the mass spectrum-specific widget might want to compute
1263 // deconvolutions.
1264
1265 m_context.m_isMeasuringDistance = false;
1266
1268 {
1269 // qDebug() << "Apparently the selection has height.";
1270
1271 // When we draw a rectangle the tracers are of no use.
1272
1273 if(mp_hPosTracerItem != nullptr)
1274 mp_hPosTracerItem->setVisible(false);
1275 if(mp_vPosTracerItem != nullptr)
1276 mp_vPosTracerItem->setVisible(false);
1277
1278 if(mp_vStartTracerItem != nullptr)
1279 mp_vStartTracerItem->setVisible(false);
1280 if(mp_vEndTracerItem != nullptr)
1281 mp_vEndTracerItem->setVisible(false);
1282
1283 // Draw the rectangle, false for as_line_segment and true for
1284 // integration.
1286
1287 // Draw the selection width/height text
1290 }
1291 else
1292 {
1293 // qDebug() << "Apparently the selection is a not a rectangle.";
1294
1295 // Draw the rectangle, true as line segment and
1296 // true for integration
1298
1299 // Draw the selection width text
1301 }
1302}

References drawSelectionRectangleAndPrepareZoom(), drawXScopeSpanFeatures(), drawYScopeSpanFeatures(), isVerticalDisplacementAboveThreshold(), m_context, mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, and mp_vStartTracerItem.

Referenced by mouseMoveHandlerDraggingCursor().

◆ mousePressEventSignal

void pappso::BasePlotWidget::mousePressEventSignal ( QMouseEvent * event,
const pappso::BasePlotContext & context )
signal

Referenced by mousePressHandler().

◆ mousePressHandler()

void pappso::BasePlotWidget::mousePressHandler ( QMouseEvent * event)
virtual

KEYBOARD-related EVENTS.

MOUSE-related EVENTS

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 1305 of file baseplotwidget.cpp.

1306{
1307 // qDebug() << "Entering";
1308
1309 // When the user clicks this widget it has to take focus.
1310 setFocus();
1311
1312 QPointF mousePoint = event->position();
1313
1314 m_context.m_lastPressedMouseButton = event->button();
1315 m_context.m_mouseButtonsAtMousePress = event->buttons();
1316
1317 // The pressedMouseButtons must continually inform on the status of
1318 // pressed buttons so add the pressed button.
1319 m_context.m_pressedMouseButtons |= event->button();
1320
1321 // qDebug().noquote() << m_context.toString();
1322
1323 // In all the processing of the events, we need to know if the user is
1324 // clicking somewhere with the intent to change the plot ranges (reframing
1325 // or rescaling the plot).
1326 //
1327 // Reframing the plot means that the new x and y axes ranges are modified
1328 // so that they match the region that the user has encompassed by left
1329 // clicking the mouse and dragging it over the plot. That is we reframe
1330 // the plot so that it contains only the "selected" region.
1331 //
1332 // Rescaling the plot means the the new x|y axis range is modified such
1333 // that the lower axis range is constant and the upper axis range is moved
1334 // either left or right by the same amont as the x|y delta encompassed by
1335 // the user moving the mouse. The axis is thus either compressed (mouse
1336 // movement is leftwards) or un-compressed (mouse movement is rightwards).
1337
1338 // There are two ways to perform axis range modifications:
1339 //
1340 // 1. By clicking on any of the axes
1341 // 2. By clicking on the plot region but using keyboard key modifiers,
1342 // like Alt and Ctrl.
1343 //
1344 // We need to know both cases separately which is why we need to perform a
1345 // number of tests below.
1346
1347 // Let's check if the click is on the axes, either X or Y, because that
1348 // will allow us to take proper actions.
1349
1350 if(isClickOntoXAxis(mousePoint))
1351 {
1352 // The X axis was clicked upon, we need to document that:
1353 // qDebug() << __FILE__ << __LINE__
1354 //<< "Layout element is axisRect and actually on an X axis part.";
1355
1356 m_context.m_wasClickOnXAxis = true;
1357
1358 // int currentInteractions = interactions();
1359 // currentInteractions |= QCP::iRangeDrag;
1360 // setInteractions((QCP::Interaction)currentInteractions);
1361 // axisRect()->setRangeDrag(xAxis->orientation());
1362 }
1363 else
1364 m_context.m_wasClickOnXAxis = false;
1365
1366 if(isClickOntoYAxis(mousePoint))
1367 {
1368 // The Y axis was clicked upon, we need to document that:
1369 // qDebug() << __FILE__ << __LINE__
1370 //<< "Layout element is axisRect and actually on an Y axis part.";
1371
1372 m_context.m_wasClickOnYAxis = true;
1373
1374 // int currentInteractions = interactions();
1375 // currentInteractions |= QCP::iRangeDrag;
1376 // setInteractions((QCP::Interaction)currentInteractions);
1377 // axisRect()->setRangeDrag(yAxis->orientation());
1378 }
1379 else
1380 m_context.m_wasClickOnYAxis = false;
1381
1382 // At this point, let's see if we need to remove the QCP::iRangeDrag bit:
1383
1384 if(!m_context.m_wasClickOnXAxis && !m_context.m_wasClickOnYAxis)
1385 {
1386 // qDebug() << __FILE__ << __LINE__
1387 // << "Click outside of axes.";
1388
1389 // int currentInteractions = interactions();
1390 // currentInteractions = currentInteractions & ~QCP::iRangeDrag;
1391 // setInteractions((QCP::Interaction)currentInteractions);
1392 }
1393
1394 m_context.m_startDragPoint.setX(xAxis->pixelToCoord(mousePoint.x()));
1395 m_context.m_startDragPoint.setY(yAxis->pixelToCoord(mousePoint.y()));
1396
1397 // Now install the vertical start tracer at the last cursor hovered
1398 // position.
1399 if((m_shouldTracersBeVisible) && (mp_vStartTracerItem != nullptr))
1400 mp_vStartTracerItem->setVisible(true);
1401
1402 if(mp_vStartTracerItem != nullptr)
1403 {
1404 mp_vStartTracerItem->start->setCoords(
1405 m_context.m_lastCursorHoveredPoint.x(), yAxis->range().upper);
1406 mp_vStartTracerItem->end->setCoords(
1407 m_context.m_lastCursorHoveredPoint.x(), yAxis->range().lower);
1408 }
1409
1410 replot();
1411
1412 emit mousePressEventSignal(event, m_context);
1413
1414 // qDebug() << "Exiting after having emitted mousePressEventSignal with base
1415 // context:"
1416 // << m_context.toString();
1417}
void mousePressEventSignal(QMouseEvent *event, const pappso::BasePlotContext &context)
bool isClickOntoYAxis(const QPointF &mousePoint)
bool isClickOntoXAxis(const QPointF &mousePoint)

References isClickOntoXAxis(), isClickOntoYAxis(), m_context, m_shouldTracersBeVisible, mousePressEventSignal(), mp_vStartTracerItem, and setFocus().

Referenced by pappso::DriftSpecMassSpecColorMapPlotWidget::mousePressHandler(), pappso::DriftSpecTracePlotWidget::mousePressHandler(), pappso::MassSpecTracePlotWidget::mousePressHandler(), pappso::TicXicChromDriftSpecColorMapPlotWidget::mousePressHandler(), pappso::TicXicChromMassSpecColorMapPlotWidget::mousePressHandler(), pappso::TicXicChromTracePlotWidget::mousePressHandler(), mousePseudoButtonKeyReleaseEvent(), and setupWidget().

◆ mousePseudoButtonKeyPressEvent()

void pappso::BasePlotWidget::mousePseudoButtonKeyPressEvent ( QKeyEvent * event)
virtual

Definition at line 850 of file baseplotwidget.cpp.

852{
853 // qDebug();
854}

Referenced by keyPressEvent().

◆ mousePseudoButtonKeyReleaseEvent()

void pappso::BasePlotWidget::mousePseudoButtonKeyReleaseEvent ( QKeyEvent * event)
virtual

Definition at line 857 of file baseplotwidget.cpp.

858{
859
860 QPointF pixel_coordinates(
861 xAxis->coordToPixel(m_context.m_lastCursorHoveredPoint.x()),
862 yAxis->coordToPixel(m_context.m_lastCursorHoveredPoint.y()));
863
864 Qt::MouseButton button = Qt::NoButton;
865 QEvent::Type q_event_type = QEvent::MouseButtonPress;
866
867 if(event->key() == m_leftMousePseudoButtonKey)
868 {
869 // Toggles the left mouse button on/off
870
871 button = Qt::LeftButton;
872
873 m_context.m_isLeftPseudoButtonKeyPressed =
874 !m_context.m_isLeftPseudoButtonKeyPressed;
875
876 if(m_context.m_isLeftPseudoButtonKeyPressed)
877 q_event_type = QEvent::MouseButtonPress;
878 else
879 q_event_type = QEvent::MouseButtonRelease;
880 }
881 else if(event->key() == m_rightMousePseudoButtonKey)
882 {
883 // Toggles the right mouse button.
884
885 button = Qt::RightButton;
886
887 m_context.m_isRightPseudoButtonKeyPressed =
888 !m_context.m_isRightPseudoButtonKeyPressed;
889
890 if(m_context.m_isRightPseudoButtonKeyPressed)
891 q_event_type = QEvent::MouseButtonPress;
892 else
893 q_event_type = QEvent::MouseButtonRelease;
894 }
895
896 // qDebug() << "pressed/released pseudo button:" << button
897 //<< "q_event_type:" << q_event_type;
898
899 // Synthesize a QMouseEvent and use it.
900
901 QMouseEvent *mouse_event_p =
902 new QMouseEvent(q_event_type,
903 pixel_coordinates,
904 mapToGlobal(pixel_coordinates.toPoint()),
905 mapToGlobal(pixel_coordinates.toPoint()),
906 button,
907 button,
908 m_context.m_keyboardModifiers,
909 Qt::MouseEventSynthesizedByApplication);
910
911 if(q_event_type == QEvent::MouseButtonPress)
912 mousePressHandler(mouse_event_p);
913 else
914 mouseReleaseHandler(mouse_event_p);
915
916 delete mouse_event_p;
917 // event->accept();
918}
virtual void mousePressHandler(QMouseEvent *event)
KEYBOARD-related EVENTS.
virtual void mouseReleaseHandler(QMouseEvent *event)

References m_context, m_leftMousePseudoButtonKey, m_rightMousePseudoButtonKey, mousePressHandler(), and mouseReleaseHandler().

Referenced by keyReleaseEvent().

◆ mouseReleaseEventSignal

void pappso::BasePlotWidget::mouseReleaseEventSignal ( QMouseEvent * event,
const pappso::BasePlotContext & context )
signal

Referenced by mouseReleaseHandler().

◆ mouseReleaseHandler()

void pappso::BasePlotWidget::mouseReleaseHandler ( QMouseEvent * event)
virtual

Reimplemented in pappso::DriftSpecMassSpecColorMapPlotWidget, pappso::DriftSpecTracePlotWidget, pappso::MassSpecTracePlotWidget, pappso::TicXicChromDriftSpecColorMapPlotWidget, pappso::TicXicChromMassSpecColorMapPlotWidget, and pappso::TicXicChromTracePlotWidget.

Definition at line 1420 of file baseplotwidget.cpp.

1421{
1422 // qDebug() << "Entering";
1423
1424 // Now the real code of this function.
1425
1426 m_context.m_lastReleasedMouseButton = event->button();
1427
1428 // The event->buttons() is the description of the buttons that are pressed
1429 // at the moment the handler is invoked, that is now. If left and right were
1430 // pressed, and left was released, event->buttons() would be right.
1431 m_context.m_mouseButtonsAtMouseRelease = event->buttons();
1432
1433 // The pressedMouseButtons must continually inform on the status of pressed
1434 // buttons so remove the released button.
1435 m_context.m_pressedMouseButtons ^= event->button();
1436
1437 // qDebug().noquote() << m_context.toString();
1438
1439 // We'll need to know if modifiers were pressed a the moment the user
1440 // released the mouse button.
1441 m_context.m_keyboardModifiers = QGuiApplication::keyboardModifiers();
1442
1443 if(!m_context.m_isMouseDragging)
1444 {
1445 // Let the user know that the mouse was *not* being dragged.
1446 m_context.m_wasMouseDragging = false;
1447
1448 event->accept();
1449
1450 return;
1451 }
1452
1453 // Let the user know that the mouse was being dragged.
1454 m_context.m_wasMouseDragging = true;
1455
1456 // We cannot hide all items in one go because we rely on their visibility
1457 // to know what kind of dragging operation we need to perform (line-only
1458 // X-based zoom or rectangle-based X- and Y-based zoom, for example). The
1459 // only thing we know is that we can make the text invisible.
1460
1461 // Same for the x delta text item
1462 mp_xDeltaTextItem->setVisible(false);
1463 mp_yDeltaTextItem->setVisible(false);
1464
1465 // We do not show the end vertical region range marker.
1466 mp_vEndTracerItem->setVisible(false);
1467
1468 // Horizontal position tracer.
1469 mp_hPosTracerItem->setVisible(true);
1470 mp_hPosTracerItem->start->setCoords(xAxis->range().lower,
1471 m_context.m_lastCursorHoveredPoint.y());
1472 mp_hPosTracerItem->end->setCoords(xAxis->range().upper,
1473 m_context.m_lastCursorHoveredPoint.y());
1474
1475 // Vertical position tracer.
1476 mp_vPosTracerItem->setVisible(true);
1477
1478 mp_vPosTracerItem->setVisible(true);
1479 mp_vPosTracerItem->start->setCoords(m_context.m_lastCursorHoveredPoint.x(),
1480 yAxis->range().upper);
1481 mp_vPosTracerItem->end->setCoords(m_context.m_lastCursorHoveredPoint.x(),
1482 yAxis->range().lower);
1483
1484 // Force replot now because later that call might not be performed.
1485 replot();
1486
1487 // If we were using the "quantum" display for the rescale of the axes
1488 // using the Ctrl-modified left button click drag in the axes, then reset
1489 // the count to 0.
1491
1492 // By definition we are stopping the drag operation by releasing the mouse
1493 // button. Whatever that mouse button was pressed before and if there was
1494 // one pressed before. We cannot set that boolean value to false before
1495 // this place, because we call a number of routines above that need to know
1496 // that dragging was occurring. Like mouseReleaseHandledEvent(event) for
1497 // example.
1498
1499 m_context.m_isMouseDragging = false;
1500
1501 // Now that we have computed the useful ranges, we need to check what to do
1502 // depending on the button that was pressed.
1503
1504 if(m_context.m_lastReleasedMouseButton == Qt::LeftButton)
1505 {
1506 return mouseReleaseHandlerLeftButton(event);
1507 }
1508 else if(m_context.m_lastReleasedMouseButton == Qt::RightButton)
1509 {
1510 return mouseReleaseHandlerRightButton(event);
1511 }
1512
1513 // FIXME: should we really accept ? No, since we pass the event on.
1514 // event->accept();
1515
1516 // Before returning, emit the signal for the user of
1517 // this class consumption.
1518 // qDebug() << "Emitting mouseReleaseEventSignal.";
1520
1521 // qDebug() << "Exiting after having emitted mouseReleaseEventSignal with base
1522 // context:"
1523 // << m_context.toString();
1524
1525 return;
1526}
virtual void mouseReleaseHandlerLeftButton(QMouseEvent *event)
void mouseReleaseEventSignal(QMouseEvent *event, const pappso::BasePlotContext &context)
virtual void mouseReleaseHandlerRightButton(QMouseEvent *event)

References m_context, m_mouseMoveHandlerSkipCount, mouseReleaseEventSignal(), mouseReleaseHandlerLeftButton(), mouseReleaseHandlerRightButton(), mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, mp_xDeltaTextItem, and mp_yDeltaTextItem.

Referenced by mousePseudoButtonKeyReleaseEvent(), pappso::DriftSpecMassSpecColorMapPlotWidget::mouseReleaseHandler(), pappso::DriftSpecTracePlotWidget::mouseReleaseHandler(), pappso::MassSpecTracePlotWidget::mouseReleaseHandler(), pappso::TicXicChromDriftSpecColorMapPlotWidget::mouseReleaseHandler(), pappso::TicXicChromMassSpecColorMapPlotWidget::mouseReleaseHandler(), pappso::TicXicChromTracePlotWidget::mouseReleaseHandler(), and setupWidget().

◆ mouseReleaseHandlerLeftButton()

void pappso::BasePlotWidget::mouseReleaseHandlerLeftButton ( QMouseEvent * event)
virtual

Definition at line 1529 of file baseplotwidget.cpp.

1530{
1531 Q_UNUSED(event)
1532 // qDebug();
1533
1534 if(m_context.m_wasClickOnXAxis || m_context.m_wasClickOnYAxis)
1535 {
1536
1537 // When the mouse move handler pans the plot, we cannot store each axes
1538 // range history element that would mean store a huge amount of such
1539 // elements, as many element as there are mouse move event handled by
1540 // the Qt event queue. But we can store an axis range history element
1541 // for the last situation of the mouse move: when the button is
1542 // released:
1543
1545
1546 // qDebug() << "emit plotRangesChangedSignal(m_context);"
1547
1548 emit plotRangesChangedSignal((QMouseEvent *)nullptr, m_context);
1549
1550 replot();
1551
1552 // Nothing else to do.
1553 return;
1554 }
1555
1556 // There are two possibilities:
1557 //
1558 // 1. The full integration scope (four lines) were currently drawn, which
1559 // means the user was willing to perform a zoom operation.
1560 //
1561 // 2. Only the first top line was drawn, which means the user was dragging
1562 // the cursor horizontally. That might have two ends, as shown below.
1563
1564 // So, first check what is drawn of the selection polygon.
1565
1566 SelectionDrawingLines selection_drawing_lines =
1568
1569 // Now that we know what was currently drawn of the selection polygon, we
1570 // can remove it. true to reset the values to 0.
1572
1573 // Force replot now because later that call might not be performed.
1574 replot();
1575
1576 if(selection_drawing_lines == SelectionDrawingLines::FULL_POLYGON)
1577 {
1578 // qDebug() << "Yes, the full polygon was visible";
1579
1580 // If we were dragging with the left button pressed and could draw a
1581 // rectangle, then we were preparing a zoom operation. Let's bring that
1582 // operation to its accomplishment.
1583
1584 axisZoom();
1585
1586 return;
1587 }
1588 else if(selection_drawing_lines == SelectionDrawingLines::TOP_LINE)
1589 {
1590 // qDebug() << "No, only the top line of the full polygon was visible";
1591
1592 // The user was dragging the left mouse cursor and that may mean they
1593 // were measuring a distance or willing to perform a special zoom
1594 // operation if the Ctrl key was down.
1595
1596 // If the user started by clicking in the plot region, dragged the mouse
1597 // cursor with the left button and pressed the Ctrl modifier, then that
1598 // means that they wanted to do a rescale over the x-axis in the form of
1599 // a reframing.
1600
1601 if(m_context.m_keyboardModifiers & Qt::ControlModifier)
1602 {
1603 return axisReframe();
1604 }
1605 }
1606 // else
1607 // qDebug() << "Another possibility.";
1608}
virtual SelectionDrawingLines whatIsVisibleOfTheSelectionRectangle()
SelectionDrawingLines

References axisReframe(), axisZoom(), pappso::FULL_POLYGON, hideSelectionRectangle(), m_context, plotRangesChangedSignal(), pappso::TOP_LINE, updateAxesRangeHistory(), and whatIsVisibleOfTheSelectionRectangle().

Referenced by mouseReleaseHandler().

◆ mouseReleaseHandlerRightButton()

void pappso::BasePlotWidget::mouseReleaseHandlerRightButton ( QMouseEvent * event)
virtual

Definition at line 1611 of file baseplotwidget.cpp.

1612{
1613 Q_UNUSED(event)
1614 // qDebug();
1615 // The right button is used for the integrations. Not for axis range
1616 // operations. So all we have to do is remove the various graphics items and
1617 // send a signal with the context that contains all the data required by the
1618 // user to perform the integrations over the right plot regions.
1619
1620 // Whatever we were doing we need to make the selection line invisible:
1621
1622 if(mp_xDeltaTextItem->visible())
1623 mp_xDeltaTextItem->setVisible(false);
1624 if(mp_yDeltaTextItem->visible())
1625 mp_yDeltaTextItem->setVisible(false);
1626
1627 // Also make the vertical end tracer invisible.
1628 mp_vEndTracerItem->setVisible(false);
1629
1630 // Once the integration is asked for, then the selection rectangle if of no
1631 // more use.
1633
1634 // Force replot now because later that call might not be performed.
1635 replot();
1636
1637 // Note that we only request an integration if the x-axis delta is enough.
1638
1639 double x_delta_pixel =
1640 fabs(xAxis->coordToPixel(m_context.m_currentDragPoint.x()) -
1641 xAxis->coordToPixel(m_context.m_startDragPoint.x()));
1642
1643 if(x_delta_pixel > 3)
1644 {
1645 // qDebug() << "Emitting integrationRequestedSignal(m_context)";
1647 }
1648 // else
1649 // qDebug() << "Not asking for integration.";
1650}
void integrationRequestedSignal(const BasePlotContext &context)

References hideSelectionRectangle(), integrationRequestedSignal(), m_context, mp_vEndTracerItem, mp_xDeltaTextItem, and mp_yDeltaTextItem.

Referenced by mouseReleaseHandler().

◆ mouseWheelEventSignal

void pappso::BasePlotWidget::mouseWheelEventSignal ( QWheelEvent * event,
const pappso::BasePlotContext & context )
signal

Referenced by mouseWheelHandler().

◆ mouseWheelHandler()

void pappso::BasePlotWidget::mouseWheelHandler ( QWheelEvent * event)
virtual

Definition at line 1653 of file baseplotwidget.cpp.

1654{
1655 // We should record the new range values each time the wheel is used to
1656 // zoom/unzoom.
1657
1658 m_context.m_xRange = QCPRange(xAxis->range());
1659 m_context.m_yRange = QCPRange(yAxis->range());
1660
1661 // qDebug() << "New x range: " << m_context.m_xRange;
1662 // qDebug() << "New y range: " << m_context.m_yRange;
1663
1665
1667 emit mouseWheelEventSignal(event, m_context);
1668
1669 event->accept();
1670}
void mouseWheelEventSignal(QWheelEvent *event, const pappso::BasePlotContext &context)
void plotRangesChangedWheelEventSignal(QWheelEvent *event, const pappso::BasePlotContext &context)

References m_context, mouseWheelEventSignal(), plotRangesChangedWheelEventSignal(), and updateAxesRangeHistory().

Referenced by setupWidget().

◆ moveMouseCursorGraphCoordToGlobal()

void pappso::BasePlotWidget::moveMouseCursorGraphCoordToGlobal ( QPointF plot_coordinates)
virtual

Definition at line 1803 of file baseplotwidget.cpp.

1804{
1805 // First convert the graph coordinates to pixel coordinates.
1806
1807 QPointF pixels_coordinates(xAxis->coordToPixel(graph_coordinates.x()),
1808 yAxis->coordToPixel(graph_coordinates.y()));
1809
1810 moveMouseCursorPixelCoordToGlobal(pixels_coordinates.toPoint());
1811}

References moveMouseCursorPixelCoordToGlobal().

◆ moveMouseCursorPixelCoordToGlobal()

void pappso::BasePlotWidget::moveMouseCursorPixelCoordToGlobal ( QPointF local_coordinates)
virtual

Definition at line 1814 of file baseplotwidget.cpp.

1815{
1816 // qDebug() << "Calling set pos with new cursor position.";
1817 QCursor::setPos(mapToGlobal(pixel_coordinates.toPoint()));
1818}

Referenced by horizontalMoveMouseCursorCountPixels(), moveMouseCursorGraphCoordToGlobal(), and verticalMoveMouseCursorCountPixels().

◆ plotRangesChangedSignal

◆ plotRangesChangedWheelEventSignal

void pappso::BasePlotWidget::plotRangesChangedWheelEventSignal ( QWheelEvent * event,
const pappso::BasePlotContext & context )
signal

Referenced by mouseWheelHandler().

◆ plottableDestructionRequestedSignal

void pappso::BasePlotWidget::plottableDestructionRequestedSignal ( BasePlotWidget * base_plot_widget_p,
QCPAbstractPlottable * plottable_p,
const pappso::BasePlotContext & context )
signal

References BasePlotWidget().

Referenced by keyReleaseEvent().

◆ plottableSelectionChangedSignal

void pappso::BasePlotWidget::plottableSelectionChangedSignal ( QCPAbstractPlottable * plottable_p,
bool selected )
signal

◆ redrawPlotBackground()

void pappso::BasePlotWidget::redrawPlotBackground ( QWidget * focusedPlotWidget)
virtual

Redraw the background of the focusedPlotWidget plot widget.

Definition at line 3267 of file baseplotwidget.cpp.

3268{
3269 if(focusedPlotWidget == nullptr)
3270 throw ExceptionNotPossible(
3271 "baseplotwidget.cpp @ redrawPlotBackground(QWidget *focusedPlotWidget "
3272 "-- "
3273 "ERROR focusedPlotWidget cannot be nullptr.");
3274
3275 if(dynamic_cast<QWidget *>(this) != focusedPlotWidget)
3276 {
3277 // The focused widget is not *this widget. We should make sure that
3278 // we were not the one that had the focus, because in this case we
3279 // need to redraw an unfocused background.
3280
3281 axisRect()->setBackground(m_unfocusedBrush);
3282 }
3283 else
3284 {
3285 axisRect()->setBackground(m_focusedBrush);
3286 }
3287
3288 replot();
3289}
QBrush m_focusedBrush
Color used for the background of focused plot.
QBrush m_unfocusedBrush
Color used for the background of unfocused plot.

References m_focusedBrush, and m_unfocusedBrush.

Referenced by yMinMaxOnXAxisCurrentRange().

◆ replotWithAxesRanges()

void pappso::BasePlotWidget::replotWithAxesRanges ( QCPRange xAxisRange,
QCPRange yAxisRange,
Enums::Axis axis )
virtual

Definition at line 2182 of file baseplotwidget.cpp.

2185{
2186 // qDebug() << "With axis:" << (int)axis;
2187
2188 if(static_cast<int>(axis) & static_cast<int>(Enums::Axis::x))
2189 {
2190 xAxis->setRange(xAxisRange.lower, xAxisRange.upper);
2191 }
2192
2193 if(static_cast<int>(axis) & static_cast<int>(Enums::Axis::y))
2194 {
2195 yAxis->setRange(yAxisRange.lower, yAxisRange.upper);
2196 }
2197
2198 // We do not want to update the history, because there would be way too
2199 // much history items, since this function is called upon mouse moving
2200 // handling and not only during mouse release events.
2201 // updateAxesRangeHistory();
2202
2203 replot();
2204}

References pappso::Enums::x, and pappso::Enums::y.

Referenced by yMinMaxOnXAxisCurrentRange().

◆ replotWithAxisRangeX()

void pappso::BasePlotWidget::replotWithAxisRangeX ( double lower,
double upper )
virtual

Definition at line 2207 of file baseplotwidget.cpp.

2208{
2209 // qDebug();
2210
2211 xAxis->setRange(lower, upper);
2212
2213 replot();
2214}

Referenced by yMinMaxOnXAxisCurrentRange().

◆ replotWithAxisRangeY()

void pappso::BasePlotWidget::replotWithAxisRangeY ( double lower,
double upper )
virtual

Definition at line 2217 of file baseplotwidget.cpp.

2218{
2219 // qDebug();
2220
2221 yAxis->setRange(lower, upper);
2222
2223 replot();
2224}

Referenced by yMinMaxOnXAxisCurrentRange().

◆ resetAxesRangeHistory()

void pappso::BasePlotWidget::resetAxesRangeHistory ( )
virtual

Definition at line 475 of file baseplotwidget.cpp.

476{
477 m_xAxisRangeHistory.clear();
478 m_yAxisRangeHistory.clear();
479
480 m_xAxisRangeHistory.push_back(new QCPRange(xAxis->range()));
481 m_yAxisRangeHistory.push_back(new QCPRange(yAxis->range()));
482
483 // qDebug() << "size of history:" << m_xAxisRangeHistory.size()
484 //<< "setting index to 0";
485
486 // qDebug() << "resetting axes history to values:" << xAxis->range().lower
487 //<< "--" << xAxis->range().upper << "and" << yAxis->range().lower
488 //<< "--" << yAxis->range().upper;
489
491}
std::size_t m_lastAxisRangeHistoryIndex
Index of the last axis range history item.

References m_lastAxisRangeHistoryIndex, m_xAxisRangeHistory, and m_yAxisRangeHistory.

Referenced by pappso::BaseTracePlotWidget::addBars(), pappso::BaseColorMapPlotWidget::addColorMap(), pappso::BaseColorMapPlotWidget::addColorMap(), pappso::BaseTracePlotWidget::addTrace(), axisDoubleClickHandler(), pappso::BaseTracePlotWidget::axisDoubleClickHandler(), pappso::BaseTracePlotWidget::clearGraphData(), and pappso::BaseTracePlotWidget::setGraphData().

◆ resetSelectionRectangle()

void pappso::BasePlotWidget::resetSelectionRectangle ( )
virtual

Definition at line 3187 of file baseplotwidget.cpp.

3188{
3189 std::const_pointer_cast<IntegrationScopeBase>(m_context.msp_integrationScope)
3190 ->reset();
3191}

References m_context.

Referenced by hideSelectionRectangle(), and yMinMaxOnXAxisCurrentRange().

◆ restoreAxesRangeHistory()

void pappso::BasePlotWidget::restoreAxesRangeHistory ( std::size_t index)
virtual

Get the axis histories at index index and update the plot ranges.

Parameters
indexindex at which to select the axis history item.
See also
updateAxesRangeHistory().

Definition at line 549 of file baseplotwidget.cpp.

550{
551 // qDebug() << "Axes history size:" << m_xAxisRangeHistory.size()
552 //<< "current index:" << m_lastAxisRangeHistoryIndex
553 //<< "asking to restore index:" << index;
554
555 if(index >= m_xAxisRangeHistory.size())
556 {
557 // qDebug() << "index >= history size. Returning.";
558 return;
559 }
560
561 // We want to go back to the range history item at index, which means we want
562 // to pop back all the items between index+1 and size-1.
563
564 while(m_xAxisRangeHistory.size() > index + 1)
565 m_xAxisRangeHistory.pop_back();
566
567 if(m_xAxisRangeHistory.size() - 1 != index)
568 qFatal("Programming error.");
569
570 xAxis->setRange(*(m_xAxisRangeHistory.at(index)));
571 yAxis->setRange(*(m_yAxisRangeHistory.at(index)));
572
574
575 mp_vPosTracerItem->setVisible(false);
576 mp_hPosTracerItem->setVisible(false);
577
578 mp_vStartTracerItem->setVisible(false);
579 mp_vEndTracerItem->setVisible(false);
580
581
582 // The start tracer will keep beeing represented at the last position and last
583 // size even if we call this function repetitively. So actually do not show,
584 // it will reappare as soon as the mouse is moved.
585 // if(m_shouldTracersBeVisible)
586 //{
587 // mp_vStartTracerItem->setVisible(true);
588 //}
589
590 replot();
591
593
594 // qDebug() << "restored axes history to index:" << index
595 //<< "with values:" << xAxis->range().lower << "--"
596 //<< xAxis->range().upper << "and" << yAxis->range().lower << "--"
597 //<< yAxis->range().upper;
598
599 emit plotRangesChangedSignal((QMouseEvent *)nullptr, m_context);
600}
virtual void hideAllPlotItems()
PLOTTING / REPLOTTING functions.

References hideAllPlotItems(), m_context, m_xAxisRangeHistory, m_yAxisRangeHistory, mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, mp_vStartTracerItem, plotRangesChangedSignal(), and updateContextXandYAxisRanges().

Referenced by restorePreviousAxesRangeHistory().

◆ restorePreviousAxesRangeHistory()

void pappso::BasePlotWidget::restorePreviousAxesRangeHistory ( )
virtual

Go up one history element in the axis history.

If possible, back up one history item in the axis histories and update the plot's x/y-axis ranges to match that history item.

Definition at line 522 of file baseplotwidget.cpp.

523{
524 // qDebug() << "axes history size:" << m_xAxisRangeHistory.size()
525 //<< "current index:" << m_lastAxisRangeHistoryIndex;
526
528 {
529 // qDebug() << "current index is 0 returning doing nothing";
530
531 return;
532 }
533
534 // qDebug() << "Setting index to:" << m_lastAxisRangeHistoryIndex - 1
535 //<< "and restoring axes history to that index";
536
538}
virtual void restoreAxesRangeHistory(std::size_t index)
Get the axis histories at index index and update the plot ranges.

References m_lastAxisRangeHistoryIndex, and restoreAxesRangeHistory().

Referenced by keyReleaseEvent().

◆ setAxisLabelX()

void pappso::BasePlotWidget::setAxisLabelX ( const QString & label)
virtual

Definition at line 462 of file baseplotwidget.cpp.

463{
464 xAxis->setLabel(label);
465}

◆ setAxisLabelY()

void pappso::BasePlotWidget::setAxisLabelY ( const QString & label)
virtual

Definition at line 468 of file baseplotwidget.cpp.

469{
470 yAxis->setLabel(label);
471}

◆ setFocus()

void pappso::BasePlotWidget::setFocus ( )
virtual

PLOT ITEMS : TRACER TEXT ITEMS...

Definition at line 3254 of file baseplotwidget.cpp.

3255{
3256 // qDebug() << "Setting focus to the QCustomPlot:" << this;
3257
3258 QCustomPlot::setFocus();
3259
3260 // qDebug() << "Emitting setFocusSignal().";
3261
3262 emit setFocusSignal();
3263}

References setFocusSignal().

Referenced by mouseMoveHandler(), mousePressHandler(), and yMinMaxOnXAxisCurrentRange().

◆ setFocusSignal

void pappso::BasePlotWidget::setFocusSignal ( )
signal

Referenced by setFocus().

◆ setPen()

void pappso::BasePlotWidget::setPen ( const QPen & pen)
virtual

Definition at line 399 of file baseplotwidget.cpp.

400{
401 m_pen = pen;
402}

References m_pen.

◆ setPlottingColor() [1/2]

void pappso::BasePlotWidget::setPlottingColor ( int index,
const QColor & new_color )
virtual

Definition at line 428 of file baseplotwidget.cpp.

429{
430 if(!new_color.isValid())
431 return;
432
433 QCPGraph *graph_p = graph(index);
434
435 if(graph_p == nullptr)
436 qFatal("Programming error.");
437
438 return setPlottingColor(graph_p, new_color);
439}
virtual void setPlottingColor(QCPAbstractPlottable *plottable_p, const QColor &new_color)

References setPlottingColor().

◆ setPlottingColor() [2/2]

void pappso::BasePlotWidget::setPlottingColor ( QCPAbstractPlottable * plottable_p,
const QColor & new_color )
virtual

Reimplemented in pappso::BaseColorMapPlotWidget.

Definition at line 411 of file baseplotwidget.cpp.

413{
414 if(plottable_p == nullptr)
415 qFatal("Pointer cannot be nullptr.");
416
417 // First this single-graph widget
418 QPen pen;
419
420 pen = plottable_p->pen();
421 pen.setColor(new_color);
422 plottable_p->setPen(pen);
423
424 replot();
425}

Referenced by setPlottingColor().

◆ setupWidget()

bool pappso::BasePlotWidget::setupWidget ( )
virtual

Definition at line 336 of file baseplotwidget.cpp.

337{
338 // qDebug();
339
340 // By default the widget comes with a graph. Remove it.
341
342 if(graphCount())
343 {
344 // QCPLayer *layer_p = graph(0)->layer();
345 // qDebug() << "The graph was on layer:" << layer_p->name();
346
347 // As of today 20210313, the graph is created on the currentLayer(), that
348 // is "main".
349
350 removeGraph(0);
351 }
352
353 // The general idea is that we do want custom layers for the trace|colormap
354 // plots.
355
356 // qDebug().noquote() << "Right before creating the new layer, layers:\n"
357 //<< allLayerNamesToString();
358
359 // Add the layer that will store all the plots and all the ancillary items.
360 addLayer(
361 "plotsLayer", layer("background"), QCustomPlot::LayerInsertMode::limAbove);
362 // Add the layer that will store the labels.
363 addLayer("labelsLayer", layer("background"), QCustomPlot::LayerInsertMode::limAbove);
364 // qDebug().noquote() << "Added new plotsLayer, layers:\n"
365 //<< allLayerNamesToString();
366
367 // This is required so that we get the keyboard events.
368 setFocusPolicy(Qt::StrongFocus);
369 setInteractions(QCP::iRangeZoom | QCP::iSelectPlottables | QCP::iMultiSelect);
370
371 // We want to capture the signals emitted by the QCustomPlot base class.
372 connect(
373 this, &QCustomPlot::mouseMove, this, &BasePlotWidget::mouseMoveHandler);
374
375 connect(
376 this, &QCustomPlot::mousePress, this, &BasePlotWidget::mousePressHandler);
377
378 connect(this,
379 &QCustomPlot::mouseRelease,
380 this,
382
383 connect(
384 this, &QCustomPlot::mouseWheel, this, &BasePlotWidget::mouseWheelHandler);
385
386 connect(this,
387 &QCustomPlot::axisDoubleClick,
388 this,
390
391 connect(this, &QCustomPlot::beforeReplot, this, [&]() { emit beforeReplotSignal(); });
392 connect(this, &QCustomPlot::afterLayout, this, [&]() { emit afterLayoutSignal(); });
393 connect(this, &QCustomPlot::afterReplot, this, [&]() { emit afterReplotSignal(); });
394
395 return true;
396}
virtual void mouseWheelHandler(QWheelEvent *event)
virtual void axisDoubleClickHandler(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
virtual void mouseMoveHandler(QMouseEvent *event)
KEYBOARD-related EVENTS.

References afterLayoutSignal(), afterReplotSignal(), axisDoubleClickHandler(), beforeReplotSignal(), mouseMoveHandler(), mousePressHandler(), mouseReleaseHandler(), and mouseWheelHandler().

Referenced by BasePlotWidget(), and BasePlotWidget().

◆ showTracers()

void pappso::BasePlotWidget::showTracers ( )
virtual

Show the traces (vertical and horizontal).

Definition at line 2248 of file baseplotwidget.cpp.

2249{
2251
2252 mp_vPosTracerItem->setVisible(true);
2253 mp_hPosTracerItem->setVisible(true);
2254
2255 mp_vStartTracerItem->setVisible(true);
2256 mp_vEndTracerItem->setVisible(true);
2257
2258 // Force a replot to make sure the action is immediately visible by the
2259 // user, even without moving the mouse.
2260 replot();
2261}

References m_shouldTracersBeVisible, mp_hPosTracerItem, mp_vEndTracerItem, mp_vPosTracerItem, and mp_vStartTracerItem.

Referenced by keyReleaseEvent(), and yMinMaxOnXAxisCurrentRange().

◆ spaceKeyReleaseEvent()

void pappso::BasePlotWidget::spaceKeyReleaseEvent ( QKeyEvent * event)
virtual

Definition at line 796 of file baseplotwidget.cpp.

797{
798 // qDebug();
799}

Referenced by keyReleaseEvent().

◆ updateAxesRangeHistory()

void pappso::BasePlotWidget::updateAxesRangeHistory ( )
virtual

Create new axis range history items and append them to the history.

The plot widget is queried to get the current x/y-axis ranges and the current ranges are appended to the history for x-axis and for y-axis.

Definition at line 501 of file baseplotwidget.cpp.

502{
503 m_xAxisRangeHistory.push_back(new QCPRange(xAxis->range()));
504 m_yAxisRangeHistory.push_back(new QCPRange(yAxis->range()));
505
507
508 // qDebug() << "axes history size:" << m_xAxisRangeHistory.size()
509 //<< "current index:" << m_lastAxisRangeHistoryIndex
510 //<< xAxis->range().lower << "--" << xAxis->range().upper << "and"
511 //<< yAxis->range().lower << "--" << yAxis->range().upper;
512}

References m_lastAxisRangeHistoryIndex, m_xAxisRangeHistory, and m_yAxisRangeHistory.

Referenced by axisDoubleClickHandler(), pappso::BaseTracePlotWidget::axisDoubleClickHandler(), axisReframe(), pappso::BaseTracePlotWidget::axisReframe(), axisZoom(), pappso::BaseTracePlotWidget::axisZoom(), mouseReleaseHandlerLeftButton(), and mouseWheelHandler().

◆ updateContextXandYAxisRanges()

void pappso::BasePlotWidget::updateContextXandYAxisRanges ( )
virtual

Definition at line 3292 of file baseplotwidget.cpp.

3293{
3294 m_context.m_xRange = QCPRange(xAxis->range().lower, xAxis->range().upper);
3295 m_context.m_yRange = QCPRange(yAxis->range().lower, yAxis->range().upper);
3296
3297 // qDebug() << "The new updated context: " << m_context.toString();
3298}

References m_context.

Referenced by axisDoubleClickHandler(), pappso::BaseTracePlotWidget::axisDoubleClickHandler(), axisPan(), pappso::BaseTracePlotWidget::axisPan(), axisReframe(), pappso::BaseTracePlotWidget::axisReframe(), axisRescale(), pappso::BaseTracePlotWidget::axisRescale(), axisZoom(), pappso::BaseTracePlotWidget::axisZoom(), restoreAxesRangeHistory(), and yMinMaxOnXAxisCurrentRange().

◆ updateIntegrationScope()

void pappso::BasePlotWidget::updateIntegrationScope ( bool for_integration = false)
protectedvirtual

Definition at line 2598 of file baseplotwidget.cpp.

2599{
2600
2601 // if(for_integration)
2602 // qDebug() << "for_integration:" << for_integration;
2603
2604 // By essence, the one-dimension IntegrationScope is characterized
2605 // by the left-most point and the width. Using these two data bits
2606 // it is possible to compute the x value of the right-most point.
2607
2608 double x_range_start =
2609 std::min(m_context.m_currentDragPoint.x(), m_context.m_startDragPoint.x());
2610 double x_range_end =
2611 std::max(m_context.m_currentDragPoint.x(), m_context.m_startDragPoint.x());
2612
2613 // qDebug() << "x_range_start:" << x_range_start << "-" << "x_range_end:" <<
2614 // x_range_end;
2615
2616 double y_position = m_context.m_startDragPoint.y();
2617
2618 m_context.updateIntegrationScope();
2619
2620 // Top line
2621 mp_selectionRectangeLine1->start->setCoords(
2622 QPointF(x_range_start, y_position));
2623 mp_selectionRectangeLine1->end->setCoords(QPointF(x_range_end, y_position));
2624
2625 // Only if we are drawing a selection rectangle for integration, do we set
2626 // arrow heads to the line.
2627 if(for_integration)
2628 {
2629 mp_selectionRectangeLine1->setHead(QCPLineEnding::esSpikeArrow);
2630 mp_selectionRectangeLine1->setTail(QCPLineEnding::esSpikeArrow);
2631 }
2632 else
2633 {
2634 mp_selectionRectangeLine1->setHead(QCPLineEnding::esNone);
2635 mp_selectionRectangeLine1->setTail(QCPLineEnding::esNone);
2636 }
2637 mp_selectionRectangeLine1->setVisible(true);
2638
2639 // Right line: does not exist, start and end are the same end point of the
2640 // top line.
2641 mp_selectionRectangeLine2->start->setCoords(QPointF(x_range_end, y_position));
2642 mp_selectionRectangeLine2->end->setCoords(QPointF(x_range_end, y_position));
2643 mp_selectionRectangeLine2->setVisible(false);
2644
2645 // Bottom line: identical to the top line, but invisible
2646 mp_selectionRectangeLine3->start->setCoords(
2647 QPointF(x_range_start, y_position));
2648 mp_selectionRectangeLine3->end->setCoords(QPointF(x_range_end, y_position));
2649 mp_selectionRectangeLine3->setVisible(false);
2650
2651 // Left line: does not exist: start and end are the same end point of the
2652 // top line.
2653 mp_selectionRectangeLine4->start->setCoords(QPointF(x_range_end, y_position));
2654 mp_selectionRectangeLine4->end->setCoords(QPointF(x_range_end, y_position));
2655 mp_selectionRectangeLine4->setVisible(false);
2656}

References m_context, mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, and mp_selectionRectangeLine4.

Referenced by updateIntegrationScopeDrawing().

◆ updateIntegrationScopeDrawing()

void pappso::BasePlotWidget::updateIntegrationScopeDrawing ( bool as_line_segment = false,
bool for_integration = false )
virtual

Definition at line 3053 of file baseplotwidget.cpp.

3055{
3056 // qDebug() << "as_line_segment:" << as_line_segment;
3057 // qDebug() << "for_integration:" << for_integration;
3058
3059 // We now need to construct the selection rectangle, either for zoom or for
3060 // integration.
3061
3062 // There are two situations :
3063 //
3064 // 1. if the rectangle should look like a line segment
3065 //
3066 // 2. if the rectangle should actually look like a rectangle. In this case,
3067 // there are two sub-situations:
3068 //
3069 // a. if the Alt modifier key is down, then the rectangle is rhomboid.
3070 //
3071 // b. otherwise the rectangle is conventional.
3072
3073 if(as_line_segment)
3074 {
3075 // qDebug() << "Updating the integration scope to an IntegrationScope.";
3076 updateIntegrationScope(for_integration);
3077 }
3078 else
3079 {
3080 if(!(m_context.m_keyboardModifiers & Qt::AltModifier))
3081 {
3082 // qDebug()
3083 // << "Updating the integration scope to an IntegrationScopeRect.";
3084 updateIntegrationScopeRect(for_integration);
3085 }
3086 else if(m_context.m_keyboardModifiers & Qt::AltModifier)
3087 {
3088 // The user might use the Alt modifier, but if no rhomboid side has
3089 // been defined using the S key, then we do not do any rhomboid
3090 // selection because we do not know the side size of that rhomboid.
3091
3092 if(!m_context.m_integrationScopeRhombHeight &&
3093 !m_context.m_integrationScopeRhombWidth)
3094 updateIntegrationScopeRect(for_integration);
3095 else
3096 // qDebug()
3097 // << "Updating the integration scope to an
3098 // IntegrationScopeRhomb.";
3099 updateIntegrationScopeRhomb(for_integration);
3100 }
3101 }
3102
3103 // Depending on the kind of IntegrationScope, (normal, rect or rhomb)
3104 // we have to measure things in different ways. We now set in the context
3105 // a number of parameters that will be used by its user.
3106
3107 QPointF point;
3108 double height;
3109 std::vector<QPointF> points;
3110
3111 // Integration scope values are sorted:
3112 // Line scope: point is left and width is right.x - left.x
3113 // Rect scope: point is bottom left.
3114 // Rhomb scope: points 1->4 are bottom left->bottom right->top right->top left
3115 // width is 2.x - 1.x.
3116
3117 if(m_context.msp_integrationScope->getPoints(points))
3118 {
3119 // We have defined a IntegrationScopeRhomb.
3120
3121 if(!m_context.msp_integrationScope->getLeftMostPoint(point))
3122 qFatal("Failed to get LeftMost point.");
3123 m_context.m_xRegionRangeStart = point.x();
3124
3125 if(!m_context.msp_integrationScope->getRightMostPoint(point))
3126 qFatal("Failed to get RightMost point.");
3127 m_context.m_xRegionRangeEnd = point.x();
3128 }
3129 else if(m_context.msp_integrationScope->getHeight(height))
3130 {
3131 // We have defined a IntegrationScopeRect.
3132
3133 if(!m_context.msp_integrationScope->getPoint(point))
3134 qFatal("Failed to get point.");
3135 m_context.m_xRegionRangeStart = point.x();
3136
3137 double width;
3138
3139 if(!m_context.msp_integrationScope->getWidth(width))
3140 qFatal("Failed to get width.");
3141
3142 m_context.m_xRegionRangeEnd = m_context.m_xRegionRangeStart + width;
3143
3144 m_context.m_yRegionRangeStart = point.y();
3145
3146 m_context.m_yRegionRangeEnd = point.y() + height;
3147 }
3148 else
3149 {
3150 // We have defined a IntegrationScope.
3151
3152 if(!m_context.msp_integrationScope->getPoint(point))
3153 qFatal("Failed to get point.");
3154 m_context.m_xRegionRangeStart = point.x();
3155
3156 double width;
3157
3158 if(!m_context.msp_integrationScope->getWidth(width))
3159 qFatal("Failed to get width.");
3160 m_context.m_xRegionRangeEnd = m_context.m_xRegionRangeStart + width;
3161 }
3162
3163 // At this point, draw the text describing the widths.
3164
3165 // We want the x-delta on the bottom of the rectangle, inside it
3166 // and the y-delta on the vertical side of the rectangle, inside it.
3167
3168 // Draw the selection width text
3170}
virtual void updateIntegrationScopeRect(bool for_integration=false)
virtual void updateIntegrationScope(bool for_integration=false)
virtual void updateIntegrationScopeRhomb(bool for_integration=false)

References drawXScopeSpanFeatures(), m_context, updateIntegrationScope(), updateIntegrationScopeRect(), and updateIntegrationScopeRhomb().

Referenced by drawSelectionRectangleAndPrepareZoom(), and yMinMaxOnXAxisCurrentRange().

◆ updateIntegrationScopeHorizontalRhomb()

void pappso::BasePlotWidget::updateIntegrationScopeHorizontalRhomb ( bool for_integration = false)
protectedvirtual

Definition at line 2743 of file baseplotwidget.cpp.

2744{
2745 // We are handling a rhomboid scope, that is, a rectangle that
2746 // is tilted either to the left or to the right.
2747
2748 // There are two kinds of rhomboid integration scopes: horizontal and
2749 // vertical.
2750
2751 /*
2752 * +----------+
2753 * | |
2754 * | |
2755 * | |
2756 * | |
2757 * | |
2758 * | |
2759 * | |
2760 * +----------+
2761 * ----width---
2762 */
2763
2764 // As visible here, the fixed size of the rhomboid (using the S key in the
2765 // plot widget) is the *horizontal* side (this is the plot context's
2766 // m_integrationScopeRhombWidth).
2767
2768 IntegrationScopeFeatures scope_features;
2769
2770 // Top horizontal line
2771 QPointF point_1;
2772 scope_features = m_context.msp_integrationScope->getLeftMostTopPoint(point_1);
2773
2774 // When the user rotates the horizontal rhomboid, at some point, if the
2775 // current drag point has the same y axis value as the start drag point, then
2776 // we say that the rhomboid is flattened on the x axis. In this case, we do
2777 // not draw anything as this is a purely unusable situation.
2778
2779 if(scope_features & IntegrationScopeFeatures::FLAT_ON_X_AXIS)
2780 {
2781 // qDebug() << "The horizontal rhomboid is flattened on the x axis.";
2782
2783 mp_selectionRectangeLine1->setVisible(false);
2784 mp_selectionRectangeLine2->setVisible(false);
2785 mp_selectionRectangeLine3->setVisible(false);
2786 mp_selectionRectangeLine4->setVisible(false);
2787
2788 return;
2789 }
2790
2792 qFatal("The rhomboid should be horizontal!");
2793
2794 // At this point we can draw the rhomboid fine.
2795
2796 if(!m_context.msp_integrationScope->getLeftMostTopPoint(point_1))
2797 qFatal("Failed to getLeftMostTopPoint.");
2798 QPointF point_2;
2799 if(!m_context.msp_integrationScope->getRightMostTopPoint(point_2))
2800 qFatal("Failed to getRightMostTopPoint.");
2801
2802 // qDebug() << "For top line, two points:" << point_1 << "--" << point_2;
2803
2804 mp_selectionRectangeLine1->start->setCoords(point_1);
2805 mp_selectionRectangeLine1->end->setCoords(point_2);
2806
2807 // Only if we are drawing a selection rectangle for integration, do we set
2808 // arrow heads to the line.
2809 if(for_integration)
2810 {
2811 mp_selectionRectangeLine1->setHead(QCPLineEnding::esSpikeArrow);
2812 mp_selectionRectangeLine1->setTail(QCPLineEnding::esSpikeArrow);
2813 }
2814 else
2815 {
2816 mp_selectionRectangeLine1->setHead(QCPLineEnding::esNone);
2817 mp_selectionRectangeLine1->setTail(QCPLineEnding::esNone);
2818 }
2819
2820 mp_selectionRectangeLine1->setVisible(true);
2821
2822 // Right line
2823 if(!m_context.msp_integrationScope->getRightMostBottomPoint(point_1))
2824 qFatal("Failed to getRightMostBottomPoint.");
2825 mp_selectionRectangeLine2->start->setCoords(point_2);
2826 mp_selectionRectangeLine2->end->setCoords(point_1);
2827 mp_selectionRectangeLine2->setVisible(true);
2828
2829 // qDebug() << "For right line, two points:" << point_2 << "--" << point_1;
2830
2831 // Bottom horizontal line
2832 if(!m_context.msp_integrationScope->getLeftMostBottomPoint(point_2))
2833 qFatal("Failed to getLeftMostBottomPoint.");
2834 mp_selectionRectangeLine3->start->setCoords(point_1);
2835 mp_selectionRectangeLine3->end->setCoords(point_2);
2836 mp_selectionRectangeLine3->setVisible(true);
2837
2838 // qDebug() << "For bottom line, two points:" << point_1 << "--" << point_2;
2839
2840 // Left line
2841 if(!m_context.msp_integrationScope->getLeftMostTopPoint(point_1))
2842 qFatal("Failed to getLeftMostTopPoint.");
2843 mp_selectionRectangeLine4->end->setCoords(point_2);
2844 mp_selectionRectangeLine4->start->setCoords(point_1);
2845 mp_selectionRectangeLine4->setVisible(true);
2846
2847 // qDebug() << "For left line, two points:" << point_2 << "--" << point_1;
2848}

References pappso::FLAT_ON_X_AXIS, m_context, mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, mp_selectionRectangeLine4, and pappso::RHOMBOID_VERTICAL.

Referenced by updateIntegrationScopeRhomb().

◆ updateIntegrationScopeRect()

void pappso::BasePlotWidget::updateIntegrationScopeRect ( bool for_integration = false)
protectedvirtual

Definition at line 2659 of file baseplotwidget.cpp.

2660{
2661 // qDebug();
2662
2663 // if(for_integration)
2664 // qDebug() << "for_integration:" << for_integration;
2665
2666 // We are handling a conventional rectangle. Just create four points
2667 // from top left to bottom right. But we want the top left point to be
2668 // effectively the top left point and the bottom point to be the bottom
2669 // point. So we need to try all four direction combinations, left to right
2670 // or converse versus top to bottom or converse.
2671
2672 m_context.updateIntegrationScopeRect();
2673
2674 // Now that the integration scope has been updated as a rectangle,
2675 // use these newly set data to actually draw the integration
2676 // scope lines.
2677
2678 QPointF bottom_left_point;
2679 if(!m_context.msp_integrationScope->getPoint(bottom_left_point))
2680 qFatal("Failed to get point.");
2681 // qDebug() << "Starting point is left bottom point:" << bottom_left_point;
2682
2683 double width;
2684 if(!m_context.msp_integrationScope->getWidth(width))
2685 qFatal("Failed to get width.");
2686 // qDebug() << "Width:" << width;
2687
2688 double height;
2689 if(!m_context.msp_integrationScope->getHeight(height))
2690 qFatal("Failed to get height.");
2691 // qDebug() << "Height:" << height;
2692
2693 QPointF bottom_right_point(bottom_left_point.x() + width,
2694 bottom_left_point.y());
2695 // qDebug() << "bottom_right_point:" << bottom_right_point;
2696
2697 QPointF top_right_point(bottom_left_point.x() + width,
2698 bottom_left_point.y() + height);
2699 // qDebug() << "top_right_point:" << top_right_point;
2700
2701 QPointF top_left_point(bottom_left_point.x(), bottom_left_point.y() + height);
2702
2703 // qDebug() << "top_left_point:" << top_left_point;
2704
2705 // Start by drawing the bottom line because the IntegrationScopeRect has the
2706 // left bottom point and the width and the height to fully characterize it.
2707
2708 // Bottom line (left to right)
2709 mp_selectionRectangeLine3->start->setCoords(bottom_left_point);
2710 mp_selectionRectangeLine3->end->setCoords(bottom_right_point);
2711 mp_selectionRectangeLine3->setVisible(true);
2712
2713 // Right line (bottom to top)
2714 mp_selectionRectangeLine2->start->setCoords(bottom_right_point);
2715 mp_selectionRectangeLine2->end->setCoords(top_right_point);
2716 mp_selectionRectangeLine2->setVisible(true);
2717
2718 // Top line (right to left)
2719 mp_selectionRectangeLine1->start->setCoords(top_right_point);
2720 mp_selectionRectangeLine1->end->setCoords(top_left_point);
2721 mp_selectionRectangeLine1->setVisible(true);
2722
2723 // Left line (top to bottom)
2724 mp_selectionRectangeLine4->start->setCoords(top_left_point);
2725 mp_selectionRectangeLine4->end->setCoords(bottom_left_point);
2726 mp_selectionRectangeLine4->setVisible(true);
2727
2728 // Only if we are drawing a selection rectangle for integration, do we
2729 // set arrow heads to the line.
2730 if(for_integration)
2731 {
2732 mp_selectionRectangeLine1->setHead(QCPLineEnding::esSpikeArrow);
2733 mp_selectionRectangeLine1->setTail(QCPLineEnding::esSpikeArrow);
2734 }
2735 else
2736 {
2737 mp_selectionRectangeLine1->setHead(QCPLineEnding::esNone);
2738 mp_selectionRectangeLine1->setTail(QCPLineEnding::esNone);
2739 }
2740}

References m_context, mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, and mp_selectionRectangeLine4.

Referenced by updateIntegrationScopeDrawing().

◆ updateIntegrationScopeRhomb()

void pappso::BasePlotWidget::updateIntegrationScopeRhomb ( bool for_integration = false)
protectedvirtual

Definition at line 2965 of file baseplotwidget.cpp.

2966{
2967 // qDebug();
2968
2969 // if(for_integration)
2970 // qDebug() << "for_integration:" << for_integration;
2971
2972 // We are handling a skewed rectangle (rhomboid), that is a rectangle that
2973 // is tilted either to the left or to the right.
2974
2975 // There are two kinds of rhomboid integration scopes:
2976
2977 /*
2978 4+----------+3
2979 | |
2980 | |
2981 | |
2982 | |
2983 | |
2984 | |
2985 | |
2986 1+----------+2
2987 ----width---
2988 */
2989
2990 // As visible here, the fixed size of the rhomboid (using the S key in the
2991 // plot widget) is the *horizontal* side (this is the plot context's
2992 // m_integrationScopeRhombWidth).
2993
2994 // and
2995
2996
2997 /*
2998 * +3
2999 * . |
3000 * . |
3001 * . |
3002 * . +2
3003 * . .
3004 * . .
3005 * . .
3006 * 4+ .
3007 * | | .
3008 * height | | .
3009 * | | .
3010 * 1+
3011 *
3012 */
3013
3014 // As visible here, the fixed size of the rhomboid (using the S key in the
3015 // plot widget) is the *vertical* side (this is the plot context's
3016 // m_integrationScopeRhombHeight).
3017
3018 // qDebug() << "Before calling updateIntegrationScopeRhomb(), "
3019 // "m_integrationScopeRhombWidth:"
3020 // << m_context.m_integrationScopeRhombWidth
3021 // << "and m_integrationScopeRhombHeight:"
3022 // << m_context.m_integrationScopeRhombHeight;
3023
3024 m_context.updateIntegrationScopeRhomb();
3025
3026 // qDebug() << "After, m_integrationScopeRhombWidth:"
3027 // << m_context.m_integrationScopeRhombWidth
3028 // << "and m_integrationScopeRhombHeight:"
3029 // << m_context.m_integrationScopeRhombHeight;
3030
3031 // Now that the integration scope has been updated as a rhomboid,
3032 // use these newly set data to actually draw the integration
3033 // scope lines.
3034
3035 // We thus need to first establish if we have a horiontal or a vertical
3036 // rhomboid scope. This information is located in
3037 // m_context.m_integrationScopeRhombWidth and
3038 // m_context.m_integrationScopeRhombHeight. If width > 0, height *has to be
3039 // 0*, which indicates a horizontal rhomb.Conversely, if height is > 0, then
3040 // the rhomb is vertical.
3041
3042 if(m_context.m_integrationScopeRhombWidth > 0)
3043 // We are dealing with a horizontal scope.
3045 else if(m_context.m_integrationScopeRhombHeight > 0)
3046 // We are dealing with a vertical scope.
3047 updateIntegrationScopeVerticalRhomb(for_integration);
3048 else
3049 qFatal("Cannot be both the width or height of rhomboid scope be 0.");
3050}
virtual void updateIntegrationScopeHorizontalRhomb(bool for_integration=false)
virtual void updateIntegrationScopeVerticalRhomb(bool for_integration=false)

References m_context, updateIntegrationScopeHorizontalRhomb(), and updateIntegrationScopeVerticalRhomb().

Referenced by updateIntegrationScopeDrawing().

◆ updateIntegrationScopeVerticalRhomb()

void pappso::BasePlotWidget::updateIntegrationScopeVerticalRhomb ( bool for_integration = false)
protectedvirtual

Definition at line 2851 of file baseplotwidget.cpp.

2852{
2853 // We are handling a rhomboid scope, that is, a rectangle that
2854 // is tilted either to the left or to the right.
2855
2856 // There are two kinds of rhomboid integration scopes: horizontal and
2857 // vertical.
2858
2859 /*
2860 * +3
2861 * . |
2862 * . |
2863 * . |
2864 * . +2
2865 * . .
2866 * . .
2867 * . .
2868 * 4+ .
2869 * | | .
2870 * height | | .
2871 * | | .
2872 * 1+
2873 *
2874 */
2875
2876 // As visible here, the fixed size of the rhomboid (using the S key in the
2877 // plot widget) is the *vertical* side (this is the plot context's
2878 // m_integrationScopeRhombHeight).
2879
2880 IntegrationScopeFeatures scope_features;
2881
2882 // Left vertical line
2883 QPointF point_1;
2884 scope_features = m_context.msp_integrationScope->getLeftMostTopPoint(point_1);
2885
2886 // When the user rotates the vertical rhomboid, at some point, if the current
2887 // drag point is on the same x axis value as the start drag point, then we say
2888 // that the rhomboid is flattened on the y axis. In this case, we do not draw
2889 // anything as this is a purely unusable situation.
2890
2891 if(scope_features & IntegrationScopeFeatures::FLAT_ON_Y_AXIS)
2892 {
2893 // qDebug() << "The vertical rhomboid is flattened on the y axis.";
2894
2895 mp_selectionRectangeLine1->setVisible(false);
2896 mp_selectionRectangeLine2->setVisible(false);
2897 mp_selectionRectangeLine3->setVisible(false);
2898 mp_selectionRectangeLine4->setVisible(false);
2899
2900 return;
2901 }
2902
2904 qFatal("The rhomboid should be vertical!");
2905
2906 // At this point we can draw the rhomboid fine.
2907
2908 QPointF point_2;
2909 if(!m_context.msp_integrationScope->getLeftMostBottomPoint(point_2))
2910 qFatal("Failed to getLeftMostBottomPoint.");
2911
2912 // qDebug() << "For left vertical line, two points:" << point_1 << "--"
2913 // << point_2;
2914
2915 mp_selectionRectangeLine1->start->setCoords(point_1);
2916 mp_selectionRectangeLine1->end->setCoords(point_2);
2917
2918 // Only if we are drawing a selection rectangle for integration, do we set
2919 // arrow heads to the line.
2920 if(for_integration)
2921 {
2922 mp_selectionRectangeLine1->setHead(QCPLineEnding::esSpikeArrow);
2923 mp_selectionRectangeLine1->setTail(QCPLineEnding::esSpikeArrow);
2924 }
2925 else
2926 {
2927 mp_selectionRectangeLine1->setHead(QCPLineEnding::esNone);
2928 mp_selectionRectangeLine1->setTail(QCPLineEnding::esNone);
2929 }
2930
2931 mp_selectionRectangeLine1->setVisible(true);
2932
2933 // Lower oblique line
2934 if(!m_context.msp_integrationScope->getRightMostBottomPoint(point_1))
2935 qFatal("Failed to getRightMostBottomPoint.");
2936 mp_selectionRectangeLine2->start->setCoords(point_2);
2937 mp_selectionRectangeLine2->end->setCoords(point_1);
2938 mp_selectionRectangeLine2->setVisible(true);
2939
2940 // qDebug() << "For lower oblique line, two points:" << point_2 << "--"
2941 // << point_1;
2942
2943 // Right vertical line
2944 if(!m_context.msp_integrationScope->getRightMostTopPoint(point_2))
2945 qFatal("Failed to getRightMostTopPoint.");
2946 mp_selectionRectangeLine3->start->setCoords(point_1);
2947 mp_selectionRectangeLine3->end->setCoords(point_2);
2948 mp_selectionRectangeLine3->setVisible(true);
2949
2950 // qDebug() << "For right vertical line, two points:" << point_1 << "--"
2951 // << point_2;
2952
2953 // Upper oblique line
2954 if(!m_context.msp_integrationScope->getLeftMostTopPoint(point_1))
2955 qFatal("Failed to get the LeftMostTopPoint.");
2956 mp_selectionRectangeLine4->end->setCoords(point_2);
2957 mp_selectionRectangeLine4->start->setCoords(point_1);
2958 mp_selectionRectangeLine4->setVisible(true);
2959
2960 // qDebug() << "For upper oblique line, two points:" << point_2 << "--"
2961 // << point_1;
2962}

References pappso::FLAT_ON_Y_AXIS, m_context, mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, mp_selectionRectangeLine4, and pappso::RHOMBOID_HORIZONTAL.

Referenced by updateIntegrationScopeRhomb().

◆ verticalGetGraphCoordNewPointCountPixels()

QPointF pappso::BasePlotWidget::verticalGetGraphCoordNewPointCountPixels ( int pixel_count)
virtual

Definition at line 1867 of file baseplotwidget.cpp.

1868{
1869 QPointF pixel_coordinates(
1870 xAxis->coordToPixel(m_context.m_lastCursorHoveredPoint.x()),
1871 yAxis->coordToPixel(m_context.m_lastCursorHoveredPoint.y()) + pixel_count);
1872
1873 // Now convert back to local coordinates.
1874
1875 QPointF graph_coordinates(xAxis->pixelToCoord(pixel_coordinates.x()),
1876 yAxis->pixelToCoord(pixel_coordinates.y()));
1877
1878 return graph_coordinates;
1879}

References m_context.

Referenced by verticalMoveMouseCursorCountPixels().

◆ verticalMoveMouseCursorCountPixels()

void pappso::BasePlotWidget::verticalMoveMouseCursorCountPixels ( int pixel_count)
virtual

Definition at line 1851 of file baseplotwidget.cpp.

1852{
1853
1854 QPointF graph_coord = verticalGetGraphCoordNewPointCountPixels(pixel_count);
1855
1856 QPointF pixel_coord(xAxis->coordToPixel(graph_coord.x()),
1857 yAxis->coordToPixel(graph_coord.y()));
1858
1859 // Now we need ton convert the new coordinates to the global position system
1860 // and to move the cursor to that new position. That will create an event to
1861 // move the mouse cursor.
1862
1863 moveMouseCursorPixelCoordToGlobal(pixel_coord.toPoint());
1864}
virtual QPointF verticalGetGraphCoordNewPointCountPixels(int pixel_count)

References moveMouseCursorPixelCoordToGlobal(), and verticalGetGraphCoordNewPointCountPixels().

Referenced by directionKeyPressEvent().

◆ whatIsVisibleOfTheSelectionRectangle()

SelectionDrawingLines pappso::BasePlotWidget::whatIsVisibleOfTheSelectionRectangle ( )
virtual

Definition at line 3194 of file baseplotwidget.cpp.

3195{
3196 // There are four lines that make the selection polygon. We want to know
3197 // which lines are visible.
3198
3199 int current_selection_polygon =
3200 static_cast<int>(SelectionDrawingLines::NOT_SET);
3201
3202 if(mp_selectionRectangeLine1->visible())
3203 {
3204 current_selection_polygon |=
3205 static_cast<int>(SelectionDrawingLines::TOP_LINE);
3206 // qDebug() << "current_selection_polygon:" <<
3207 // current_selection_polygon;
3208 }
3209 if(mp_selectionRectangeLine2->visible())
3210 {
3211 current_selection_polygon |=
3212 static_cast<int>(SelectionDrawingLines::RIGHT_LINE);
3213 // qDebug() << "current_selection_polygon:" <<
3214 // current_selection_polygon;
3215 }
3216 if(mp_selectionRectangeLine3->visible())
3217 {
3218 current_selection_polygon |=
3219 static_cast<int>(SelectionDrawingLines::BOTTOM_LINE);
3220 // qDebug() << "current_selection_polygon:" <<
3221 // current_selection_polygon;
3222 }
3223 if(mp_selectionRectangeLine4->visible())
3224 {
3225 current_selection_polygon |=
3226 static_cast<int>(SelectionDrawingLines::LEFT_LINE);
3227 // qDebug() << "current_selection_polygon:" <<
3228 // current_selection_polygon;
3229 }
3230
3231 // qDebug() << "returning visibility:" << current_selection_polygon;
3232
3233 return static_cast<SelectionDrawingLines>(current_selection_polygon);
3234}

References pappso::BOTTOM_LINE, pappso::LEFT_LINE, mp_selectionRectangeLine1, mp_selectionRectangeLine2, mp_selectionRectangeLine3, mp_selectionRectangeLine4, pappso::NOT_SET, pappso::RIGHT_LINE, and pappso::TOP_LINE.

Referenced by mouseReleaseHandlerLeftButton(), and yMinMaxOnXAxisCurrentRange().

◆ xAxisMeasurementSignal

void pappso::BasePlotWidget::xAxisMeasurementSignal ( const pappso::BasePlotContext & context,
bool with_delta )
signal

◆ yMinMaxOnXAxisCurrentRange() [1/2]

◆ yMinMaxOnXAxisCurrentRange() [2/2]

void pappso::BasePlotWidget::yMinMaxOnXAxisCurrentRange ( double & min,
double & max,
QCPAbstractPlottable * plottable_p = nullptr )

Member Data Documentation

◆ m_axisLabelX

QString pappso::BasePlotWidget::m_axisLabelX
protected

Definition at line 279 of file baseplotwidget.h.

Referenced by BasePlotWidget().

◆ m_axisLabelY

QString pappso::BasePlotWidget::m_axisLabelY
protected

Definition at line 280 of file baseplotwidget.h.

Referenced by BasePlotWidget().

◆ m_context

BasePlotContext pappso::BasePlotWidget::m_context
protected

Definition at line 282 of file baseplotwidget.h.

Referenced by pappso::DriftSpecTracePlotWidget::DriftSpecTracePlotWidget(), pappso::MassSpecTracePlotWidget::MassSpecTracePlotWidget(), pappso::MassSpecTracePlotWidget::MassSpecTracePlotWidget(), pappso::TicXicChromTracePlotWidget::TicXicChromTracePlotWidget(), axisDoubleClickHandler(), pappso::BaseTracePlotWidget::axisDoubleClickHandler(), axisPan(), pappso::BaseTracePlotWidget::axisPan(), axisReframe(), pappso::BaseTracePlotWidget::axisReframe(), axisRescale(), pappso::BaseTracePlotWidget::axisRescale(), axisZoom(), pappso::BaseTracePlotWidget::axisZoom(), calculateDragDeltas(), pappso::BaseColorMapPlotWidget::currentXaxisRangeIndices(), pappso::BaseColorMapPlotWidget::currentYaxisRangeIndices(), directionKeyPressEvent(), dragDirection(), drawSelectionRectangleAndPrepareZoom(), drawXScopeSpanFeatures(), drawYScopeSpanFeatures(), getContext(), horizontalGetGraphCoordNewPointCountPixels(), isVerticalDisplacementAboveThreshold(), keyPressEvent(), pappso::DriftSpecTracePlotWidget::keyPressEvent(), pappso::TicXicChromTracePlotWidget::keyPressEvent(), keyReleaseEvent(), mouseMoveHandler(), mouseMoveHandlerDraggingCursor(), mouseMoveHandlerLeftButtonDraggingCursor(), mouseMoveHandlerNotDraggingCursor(), mouseMoveHandlerRightButtonDraggingCursor(), mousePressHandler(), pappso::TicXicChromTracePlotWidget::mousePressHandler(), mousePseudoButtonKeyReleaseEvent(), mouseReleaseHandler(), pappso::TicXicChromTracePlotWidget::mouseReleaseHandler(), mouseReleaseHandlerLeftButton(), mouseReleaseHandlerRightButton(), mouseWheelHandler(), pappso::MassSpecTracePlotWidget::refreshBaseContext(), resetSelectionRectangle(), restoreAxesRangeHistory(), updateContextXandYAxisRanges(), updateIntegrationScope(), updateIntegrationScopeDrawing(), updateIntegrationScopeHorizontalRhomb(), updateIntegrationScopeRect(), updateIntegrationScopeRhomb(), updateIntegrationScopeVerticalRhomb(), and verticalGetGraphCoordNewPointCountPixels().

◆ m_desc

QString pappso::BasePlotWidget::m_desc = "NOT_SET"
protected

Description of the plot widget.

Definition at line 274 of file baseplotwidget.h.

◆ m_fileName

QString pappso::BasePlotWidget::m_fileName
protected

The name of the data file from which the mass data were read.

Definition at line 277 of file baseplotwidget.h.

◆ m_focusedBrush

QBrush pappso::BasePlotWidget::m_focusedBrush = QBrush(m_focusedColor)
protected

Color used for the background of focused plot.

Definition at line 363 of file baseplotwidget.h.

Referenced by redrawPlotBackground().

◆ m_focusedColor

QColor pappso::BasePlotWidget::m_focusedColor = QColor(Qt::transparent)
protected

Color used for the background of focused plot.

Definition at line 361 of file baseplotwidget.h.

◆ m_lastAxisRangeHistoryIndex

std::size_t pappso::BasePlotWidget::m_lastAxisRangeHistoryIndex = 0
protected

Index of the last axis range history item.

Each time the user modifies the ranges (x/y axis) during panning or zooming of the graph, the new axis ranges are stored in a axis ranges history list. This index allows to point to the last range of that history.

Definition at line 324 of file baseplotwidget.h.

Referenced by resetAxesRangeHistory(), restorePreviousAxesRangeHistory(), and updateAxesRangeHistory().

◆ m_leftMousePseudoButtonKey

int pappso::BasePlotWidget::m_leftMousePseudoButtonKey = Qt::Key_Less
protected

◆ m_mouseMoveHandlerSkipAmount

int pappso::BasePlotWidget::m_mouseMoveHandlerSkipAmount = 10
protected

How many mouse move events must be skipped *‍/.

when the data are so massive that the graph panning becomes sluggish. By default, the value is 10 events to be skipped before accounting one. The "fat data" mouse movement handler mechanism is actuated by using a keyboard key combination. There is no automatic shift between normal processing and "fat data" processing.

Definition at line 342 of file baseplotwidget.h.

Referenced by mouseMoveHandlerLeftButtonDraggingCursor().

◆ m_mouseMoveHandlerSkipCount

int pappso::BasePlotWidget::m_mouseMoveHandlerSkipCount = 0
protected

Counter to handle the "fat data" mouse move event handling.

See also
m_mouseMoveHandlerSkipAmount.

Definition at line 350 of file baseplotwidget.h.

Referenced by mouseMoveHandlerLeftButtonDraggingCursor(), and mouseReleaseHandler().

◆ m_name

QString pappso::BasePlotWidget::m_name = "NOT_SET"
protected

Name of the plot widget.

Definition at line 271 of file baseplotwidget.h.

◆ m_pen

QPen pappso::BasePlotWidget::m_pen
protected

Pen used to draw the graph and textual elements in the plot widget.

Definition at line 366 of file baseplotwidget.h.

Referenced by BasePlotWidget(), BasePlotWidget(), createAllAncillaryItems(), getPen(), pappso::BaseTracePlotWidget::setGraphData(), and setPen().

◆ m_rightMousePseudoButtonKey

int pappso::BasePlotWidget::m_rightMousePseudoButtonKey = Qt::Key_Greater
protected

◆ m_shouldTracersBeVisible

bool pappso::BasePlotWidget::m_shouldTracersBeVisible = true
protected

Tells if the tracers should be visible.

Definition at line 301 of file baseplotwidget.h.

Referenced by hideTracers(), keyReleaseEvent(), mouseMoveHandlerDraggingCursor(), mouseMoveHandlerNotDraggingCursor(), mousePressHandler(), and showTracers().

◆ m_unfocusedBrush

QBrush pappso::BasePlotWidget::m_unfocusedBrush = QBrush(m_unfocusedColor)
protected

Color used for the background of unfocused plot.

Definition at line 358 of file baseplotwidget.h.

Referenced by redrawPlotBackground().

◆ m_unfocusedColor

QColor pappso::BasePlotWidget::m_unfocusedColor = QColor("lightgray")
protected

Color used for the background of unfocused plot.

Definition at line 356 of file baseplotwidget.h.

◆ m_xAxisRangeHistory

std::vector<QCPRange *> pappso::BasePlotWidget::m_xAxisRangeHistory
protected

List of x axis ranges occurring during the panning zooming actions.

Definition at line 327 of file baseplotwidget.h.

Referenced by ~BasePlotWidget(), resetAxesRangeHistory(), restoreAxesRangeHistory(), and updateAxesRangeHistory().

◆ m_yAxisRangeHistory

std::vector<QCPRange *> pappso::BasePlotWidget::m_yAxisRangeHistory
protected

List of y axis ranges occurring during the panning zooming actions.

Definition at line 330 of file baseplotwidget.h.

Referenced by ~BasePlotWidget(), resetAxesRangeHistory(), restoreAxesRangeHistory(), and updateAxesRangeHistory().

◆ mp_hPosTracerItem

◆ mp_selectionRectangeLine1

QCPItemLine* pappso::BasePlotWidget::mp_selectionRectangeLine1 = nullptr
protected

◆ mp_selectionRectangeLine2

◆ mp_selectionRectangeLine3

◆ mp_selectionRectangeLine4

◆ mp_vEndTracerItem

◆ mp_vPosTracerItem

◆ mp_vStartTracerItem

QCPItemLine* pappso::BasePlotWidget::mp_vStartTracerItem = nullptr
protected

◆ mp_xDeltaTextItem

QCPItemText* pappso::BasePlotWidget::mp_xDeltaTextItem = nullptr
protected

Text describing the x-axis delta value during a drag operation.

Definition at line 297 of file baseplotwidget.h.

Referenced by createAllAncillaryItems(), drawSelectionRectangleAndPrepareZoom(), drawXScopeSpanFeatures(), hideAllPlotItems(), mouseReleaseHandler(), and mouseReleaseHandlerRightButton().

◆ mp_yDeltaTextItem

QCPItemText* pappso::BasePlotWidget::mp_yDeltaTextItem = nullptr
protected

The documentation for this class was generated from the following files: