libpappsomspp
Library for mass spectrometry
basetraceplotwidget.cpp
Go to the documentation of this file.
1 /* This code comes right from the msXpertSuite software project.
2  *
3  * msXpertSuite - mass spectrometry software suite
4  * -----------------------------------------------
5  * Copyright(C) 2009,...,2018 Filippo Rusconi
6  *
7  * http://www.msxpertsuite.org
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  *
22  * END software license
23  */
24 
25 
26 /////////////////////// StdLib includes
27 #include <vector>
28 
29 
30 /////////////////////// Qt includes
31 #include <QVector>
32 
33 
34 /////////////////////// Local includes
35 #include "basetraceplotwidget.h"
36 #include "../../exception/exceptionnotpossible.h"
37 #include "../../pappsoexception.h"
38 
39 
40 namespace pappso
41 {
42 
43 
45  : BasePlotWidget(parent)
46 {
47 }
48 
49 
51  const QString &x_axis_label,
52  const QString &y_axis_label)
53  : BasePlotWidget(parent, x_axis_label, y_axis_label)
54 {
55 }
56 
57 
58 //! Destruct \c this BaseTracePlotWidget instance.
59 /*!
60 
61  The destruction involves clearing the history, deleting all the axis range
62  history items for x and y axes.
63 
64 */
66 {
67 }
68 
69 
70 void
72  const std::vector<double> &keys,
73  const std::vector<double> &values)
74 {
75  QCPGraph *graph_p = graph(graph_index);
76 
77  if(graph_p == nullptr)
78  qFatal("Programming error.");
79 
80  return setGraphData(graph_p, keys, values);
81 }
82 
83 
84 void
86  const std::vector<double> &keys,
87  const std::vector<double> &values)
88 {
89  if(graph_p == nullptr)
90  qFatal("Pointer cannot be nullptr.");
91 
92  // Version that is now deprecated (20200924)
93  // graph_p->setData(QVector<double>::fromStdVector(keys),
94  // QVector<double>::fromStdVector(values));
95 
96  QVector<double> key_qvector;
97  QVector<double> value_qvector;
98 
99 #pragma GCC warning "Filippo Rusconi: Please check if the bug was fixed in Qt"
100 
101 #if 0
102  // Now replace the graph's data. Note that the data are
103  // inherently sorted (true below).
104 
105  // The begin() -- end() ranges constructor did not work as of
106  // Qt 5.14.2 this day: 20200721
107 
108  key_qvector =
109  QVector(keys.begin(),
110  keys.end());
111  value_qvector =
112  QVector(values.begin(),
113  values.end());
114 #endif
115 
116  for(auto &value : keys)
117  key_qvector.push_back(value);
118 
119  for(auto &value : values)
120  value_qvector.push_back(value);
121 
122  graph_p->setData(key_qvector, value_qvector, true);
123 
124  graph_p->setPen(m_pen);
125 
126  rescaleAxes();
128  replot();
129 }
130 
131 
132 void
134 {
135  QCPGraph *graph_p = graph(graph_index);
136 
137  if(graph_p == nullptr)
138  qFatal("Programming error.");
139 
140  graph_p->data().clear();
141 
142  rescaleAxes();
144  replot();
145 }
146 
147 
148 QCPGraph *
149 BaseTracePlotWidget::addTrace(const pappso::Trace &trace, const QColor &color)
150 {
151  // qDebug();
152 
153  if(!color.isValid())
154  throw PappsoException(
155  QString("The color to be used for the plot graph is invalid."));
156 
157  // This seems to be unpleasant.
158  // setFocus();
159 
160  QCPGraph *graph_p = addGraph();
161 
162  // Now depracated as of 20200924
163  //graph_p->setData(QVector<double>::fromStdVector(trace.xValues()),
164  //QVector<double>::fromStdVector(trace.yValues()));
165 
166  QVector<double> key_qvector;
167  QVector<double> value_qvector;
168 
169 #pragma GCC warning "Filippo Rusconi: Please check if the bug was fixed in Qt"
170 
171 #if 0
172  // Now replace the graph's data. Note that the data are
173  // inherently sorted (true below).
174 
175  // The begin() -- end() ranges constructor did not work as of
176  // Qt 5.14.2 this day: 20200721
177 
178  key_qvector =
179  QVector(trace.xValues().begin(),
180  .trace.xValues()end());
181  value_qvector =
182  QVector(trace.yValues().begin(),
183  trace.yValues().end());
184 #endif
185 
186  for(auto &value : trace.xValues())
187  key_qvector.push_back(value);
188 
189  for(auto &value : trace.yValues())
190  value_qvector.push_back(value);
191 
192  graph_p->setData(key_qvector, value_qvector, true);
193 
194  QPen pen = graph()->pen();
195  pen.setColor(color);
196  graph()->setPen(pen);
197 
198  // Connect the signal of selection change so that we can re-emit it for the
199  // widget that is using *this widget.
200 
201  connect(graph_p,
202  static_cast<void (QCPAbstractPlottable::*)(bool)>(
203  &QCPAbstractPlottable::selectionChanged),
204  [this, graph_p]() {
205  emit plottableSelectionChangedSignal(graph_p, graph_p->selected());
206  });
207 
208  // Rescaling the axes is actually unpleasant if there are more than one
209  // graph in the plot widget and that we are adding one. So only, rescale if
210  // the number of graphs is == 1, that is we are adding the first one.
211 
212  if(graphCount() == 1)
213  {
214  rescaleAxes();
216  }
217 
218  replot();
219 
220  return graph_p;
221 }
222 
223 
224 //! Find a minimal integration range starting at an existing data point
225 /*!
226 
227  If the user clicks onto a plot at a location that is not a true data point,
228  get a data range that begins at the preceding data point and that ends at
229  the clicked location point.
230 
231 */
232 bool
234  double key,
235  QCPRange &range)
236 {
237 
238  // Given a key double value, we want to know what is the range that will
239  // frame correctly the key double value if that key value is not exactly
240  // the one of a point of the trace.
241 
242  // First of all get the keys of the graph.
243 
244  QCPGraph *theGraph = graph(index);
245 
246  if(theGraph == nullptr)
247  throw ExceptionNotPossible(
248  "basetraceplotwidget.cpp @ indIntegrationLowerRangeForKey() -- ERROR "
249  "theGraph cannot be nullptr.");
250 
251  // QCPGraphDataContainer is a typedef QCPDataContainer<QCPGraphData> and
252  // QCPDataContainer< DataType > is a Class Template. So in this context,
253  // DataType is QCPGraphData.
254  // QCPGraphData is the data point, that is the (key,value) pair.
255  QSharedPointer<QCPGraphDataContainer> graph_data_container_p =
256  theGraph->data();
257 
258  QCPDataRange dataRange = graph_data_container_p->dataRange();
259 
260  if(!dataRange.isValid())
261  return false;
262 
263  if(!dataRange.size())
264  return false;
265 
266  if(dataRange.size() > 1)
267  {
268  double firstKey = graph_data_container_p->at(dataRange.begin())->key;
269  double lastKey = graph_data_container_p->at(dataRange.end())->key;
270 
271  // There is one check to be done: the user might erroneously set the mouse
272  // cursor beyond the last point of the graph. If that is the case, then
273  // upper key needs to be that very point. All we need to do is return the
274  // lower key, that is the pre-last key of the keys list. No need to
275  // iterate in the keys list.
276 
277  if(key > lastKey)
278  {
279  // No need to search for the key in the keys, just get the lower key
280  // immediately, that is, the key that is one slot left the last key.
281  range.lower = graph_data_container_p->at(dataRange.end() - 2)->key;
282  range.upper = graph_data_container_p->at(dataRange.end() - 1)->key;
283 
284  return true;
285  }
286 
287  // Likewise, if the cursor is set left of the first plot point, then that
288  // will be the lower range point. All we need is to provide the upper
289  // range point as the second point of the plot.
290 
291  if(key < firstKey)
292  {
293  range.lower = firstKey;
294  range.upper = graph_data_container_p->at(dataRange.begin() + 1)->key;
295 
296  return true;
297  }
298 
299  // Finally the generic case where the user point to any point *in* the
300  // graph.
301 
302  range.lower =
303  graph_data_container_p->findBegin(key, /*expandedRange*/ true)->key;
304  range.upper =
305  std::prev(graph_data_container_p->findEnd(key, /*expandedRange*/ true))
306  ->key;
307 
308  return true;
309  }
310 
311  return false;
312 }
313 
314 
315 std::vector<double>
316 BaseTracePlotWidget::getValuesX(int graph_index) const
317 {
318  std::vector<double> keys;
319 
320  QCPGraph *graph_p = graph(graph_index);
321 
322  if(graph_p == nullptr)
323  qFatal("Programming error.");
324 
325  QSharedPointer<QCPGraphDataContainer> graph_data_container_p =
326  graph_p->data();
327 
328  // Iterate in the keys
329  auto beginIt = graph_data_container_p->begin();
330  auto endIt = graph_data_container_p->end();
331 
332  for(auto iter = beginIt; iter != endIt; ++iter)
333  keys.push_back(iter->key);
334 
335  return keys;
336 }
337 
338 
339 std::vector<double>
340 BaseTracePlotWidget::getValuesY(int graph_index) const
341 {
342  std::vector<double> values;
343 
344  QCPGraph *graph_p = graph(graph_index);
345 
346  if(graph_p == nullptr)
347  qFatal("Programming error.");
348 
349  QSharedPointer<QCPGraphDataContainer> graph_data_container_p =
350  graph_p->data();
351 
352  // Iterate in the values
353  auto beginIt = graph_data_container_p->begin();
354  auto endIt = graph_data_container_p->end();
355 
356  for(auto iter = beginIt; iter != endIt; ++iter)
357  values.push_back(iter->key);
358 
359  return values;
360 }
361 
362 
363 QCPRange
364 BaseTracePlotWidget::getValueRangeOnKeyRange(QCPAbstractPlottable *plottable_p,
365  bool &ok)
366 {
367 
368  // The X axis range is set. But we want to find for that X axis range the
369  // min and max Y values. This function is useful when the user asks that
370  // while changing the X axis range, the trace be always in full scale on the
371  // Y axis.
372 
373  QCPRange key_range(xAxis->range().lower, xAxis->range().upper);
374 
375  if(plottable_p != nullptr)
376  {
377 
378  return plottable_p->getValueRange(ok, QCP::SignDomain::sdBoth, key_range);
379  }
380  else
381  {
382 
383  // How many graphs are currently plotted in this plot widget ?
384  int graph_count = graphCount();
385 
386  // Iterate in each graph and get the y max value. Then compare with the
387  // largest one and update if necessary. Store the pointer to the graph
388  // that has a larger y value. At the end of the iteration, it will be
389  // the winner.
390 
391  double temp_min_value = std::numeric_limits<double>::max();
392  double temp_max_value = std::numeric_limits<double>::min();
393 
394  bool found_range = false;
395 
396  for(int iter = 0; iter < graph_count; ++iter)
397  {
398  QCPGraph *plottable_p = graph(iter);
399 
400  QCPRange value_range =
401  plottable_p->getValueRange(ok, QCP::SignDomain::sdBoth, key_range);
402 
403  if(ok)
404  found_range = true;
405 
406  if(value_range.lower < temp_min_value)
407  temp_min_value = value_range.lower;
408  if(value_range.upper > temp_max_value)
409  temp_max_value = value_range.upper;
410  }
411 
412  // At this point return the range.
413 
414  ok = found_range;
415  return QCPRange(temp_min_value, temp_max_value);
416  }
417 }
418 
419 
420 QCPRange
422 {
423 
424  // The X axis range is set. But we want to find for that X axis range the
425  // min and max Y values. This function is useful when the user asks that
426  // while changing the X axis range, the trace be always in full scale on the
427  // Y axis.
428 
429  QCPAbstractPlottable *plottable_p = plottable(index);
430 
431  if(plottable_p == nullptr)
432  qFatal("Programming error.");
433 
434  return getValueRangeOnKeyRange(plottable_p, ok);
435 }
436 
437 
438 double
439 BaseTracePlotWidget::getYatX(double x, QCPGraph *graph_p)
440 {
441  if(graph_p == nullptr)
442  qFatal("Programming error.");
443 
444  QCPItemTracer tracer(this);
445  tracer.setGraph(graph_p);
446  tracer.setInterpolating(true);
447  tracer.setGraphKey(x);
448  tracer.updatePosition();
449 
450  return tracer.position->value();
451 }
452 
453 
454 double
455 BaseTracePlotWidget::getYatX(double x, int index)
456 {
457  QCPGraph *graph_p = graph(index);
458 
459  if(graph_p == nullptr)
460  qFatal("Programming error.");
461 
462  return getYatX(x, graph_p);
463 }
464 
465 
466 void
468  QCPAxis *axis,
469  [[maybe_unused]] QCPAxis::SelectablePart part,
470  QMouseEvent *event)
471 {
472 
473  m_context.keyboardModifiers = QGuiApplication::queryKeyboardModifiers();
474 
475  if(m_context.keyboardModifiers & Qt::ControlModifier)
476  {
477 
478  // If the Ctrl modifiers is active, then both axes are to be reset. Also
479  // the histories are reset also.
480 
481  rescaleAxes();
483  }
484  else
485  {
486  // Only the axis passed as parameter is to be rescaled.
487  // Reset the range of that axis to the max view possible, but for the y
488  // axis check if the Shift keyboard key is pressed. If so the full scale
489  // should be calculated only on the data in the current x range.
490 
491  if(axis->orientation() == Qt::Vertical)
492  {
493  if(m_context.keyboardModifiers & Qt::ShiftModifier)
494  {
495 
496  // In this case, we want to make a rescale of the Y axis such
497  // that it displays full scale the data in the current X axis
498  // range only.
499 
500  bool ok = false;
501 
502  QCPRange value_range = getValueRangeOnKeyRange(nullptr, ok);
503 
504  yAxis->setRange(value_range);
505  }
506  else
507  axis->rescale();
508  }
509  else
510  axis->rescale();
511 
513 
514  event->accept();
515  }
516 
517  // The double-click event does not cancel the mouse press event. That is, if
518  // left-double-clicking, at the end of the operation the button still
519  // "pressed". We need to remove manually the button from the pressed buttons
520  // context member.
521 
522  m_context.pressedMouseButtons ^= event->button();
523 
525 
527 
528  replot();
529 }
530 
531 
532 void
534 {
535  double xLower = xAxis->range().lower;
536  double xUpper = xAxis->range().upper;
537 
538  // Get the current y lower/upper range.
539  double yLower = yAxis->range().lower;
540  double yUpper = yAxis->range().upper;
541 
542  // This function is called only when the user has clicked on the x/y axis or
543  // when the user has dragged the left mouse button with the Ctrl key
544  // modifier. The m_context.wasClickOnXAxis is then simulated in the mouse
545  // move handler. So we need to test which axis was clicked-on.
546 
548  {
549 
550  // We are changing the range of the X axis.
551 
552  // What is the x delta ?
553  double xDelta =
555 
556  // If xDelta is < 0, the we were dragging from right to left, we are
557  // compressing the view on the x axis, by adding new data to the right
558  // hand size of the graph. So we add xDelta to the upper bound of the
559  // range. Otherwise we are uncompressing the view on the x axis and
560  // remove the xDelta from the upper bound of the range. This is why we
561  // have the
562  // '-'
563  // and not '+' below;
564 
565  // qDebug() << "Setting xaxis:" << xLower << "--" << xUpper - xDelta;
566 
567  xAxis->setRange(xLower, xUpper - xDelta);
568 
569 
570  // Old version
571  // if(xDelta < 0)
572  //{
573  //// The dragging operation was from right to left, we are enlarging
574  //// the range (thus, we are unzooming the view, since the widget
575  //// always has the same size).
576 
577  // xAxis->setRange(xLower, xUpper + fabs(xDelta));
578  //}
579  // else
580  //{
581  //// The dragging operation was from left to right, we are reducing
582  //// the range (thus, we are zooming the view, since the widget
583  //// always has the same size).
584 
585  // xAxis->setRange(xLower, xUpper - fabs(xDelta));
586  //}
587 
588  // We may either leave the scale of the Y axis as is (default) or
589  // the user may want an automatic scale of the Y axis such that the
590  // data displayed in the new X axis range are full scale on the Y
591  // axis. For this, the Shift modifier key should be pressed.
592 
593  if(m_context.keyboardModifiers & Qt::ShiftModifier)
594  {
595 
596  // In this case, we want to make a rescale of the Y axis such that
597  // it displays full scale the data in the current X axis range only.
598 
599  bool ok = false;
600 
601  QCPRange value_range = getValueRangeOnKeyRange(nullptr, ok);
602 
603  yAxis->setRange(value_range);
604  }
605  // else, do leave the Y axis range unchanged.
606  }
607  // End of
608  // if(m_context.wasClickOnXAxis)
609  else // that is, if(m_context.wasClickOnYAxis)
610  {
611  // We are changing the range of the Y axis.
612 
613  // What is the y delta ?
614  double yDelta =
616 
617  // See above for an explanation of the computation.
618 
619  yAxis->setRange(yLower, yUpper - yDelta);
620 
621  // Old version
622  // if(yDelta < 0)
623  //{
624  //// The dragging operation was from top to bottom, we are enlarging
625  //// the range (thus, we are unzooming the view, since the widget
626  //// always has the same size).
627 
628  // yAxis->setRange(yLower, yUpper + fabs(yDelta));
629  //}
630  // else
631  //{
632  //// The dragging operation was from bottom to top, we are reducing
633  //// the range (thus, we are zooming the view, since the widget
634  //// always has the same size).
635 
636  // yAxis->setRange(yLower, yUpper - fabs(yDelta));
637  //}
638  }
639  // End of
640  // else // that is, if(m_context.wasClickOnYAxis)
641 
642  // Update the context with the current axes ranges
643 
645 
647 
648  replot();
649 }
650 
651 
652 void
654 {
655 
656  // double sorted_start_drag_point_x =
657  // std::min(m_context.startDragPoint.x(), m_context.currentDragPoint.x());
658 
659  // xAxis->setRange(sorted_start_drag_point_x,
660  // sorted_start_drag_point_x + fabs(m_context.xDelta));
661 
662  xAxis->setRange(
664 
665  // Note that the y axis should be rescaled from current lower value to new
666  // upper value matching the y-axis position of the cursor when the mouse
667  // button was released.
668 
669  yAxis->setRange(
670  xAxis->range().lower,
672 
673  // qDebug() << "xaxis:" << xAxis->range().lower << "-" <<
674  // xAxis->range().upper
675  //<< "yaxis:" << yAxis->range().lower << "-" << yAxis->range().upper;
676 
677  // If the shift modifier key is pressed, then the user want the y axis
678  // to be full scale.
679  if(m_context.keyboardModifiers & Qt::ShiftModifier)
680  {
681 
682  bool ok = false;
683 
684  QCPRange value_range = getValueRangeOnKeyRange(nullptr, ok);
685 
686  yAxis->setRange(value_range);
687  }
688  // else do nothing, let the y axis range as is.
689 
691 
694 
695  replot();
696 }
697 
698 
699 void
701 {
702 
703  // Use the m_context.xRegionRangeStart/End values, but we need to sort the
704  // values before using them, because now we want to really have the lower x
705  // value. Simply craft a QCPRange that will swap the values if lower is not
706  // < than upper QCustomPlot calls this normalization).
707 
708  xAxis->setRange(
710 
711  // If the shift modifier key is pressed, then the user want the y axis
712  // to be full scale.
713  if(m_context.keyboardModifiers & Qt::ShiftModifier)
714  {
715 
716  bool ok = false;
717 
718  QCPRange value_range = getValueRangeOnKeyRange(nullptr, ok);
719 
720  yAxis->setRange(value_range);
721  }
722  else
723  yAxis->setRange(
725 
727 
730 
731  replot();
732 }
733 
734 void
736 {
738  {
739  xAxis->setRange(m_context.xRange.lower - m_context.xDelta,
740  m_context.xRange.upper - m_context.xDelta);
741 
742  // If the shift modifier key is pressed, then the user want the y axis
743  // to be full scale.
744  if(m_context.keyboardModifiers & Qt::ShiftModifier)
745  {
746 
747  bool ok = false;
748 
749  QCPRange value_range = getValueRangeOnKeyRange(nullptr, ok);
750 
751  yAxis->setRange(value_range);
752  }
753  // else nothing to do we do not change the y axis scale.
754  }
755 
757  {
758  yAxis->setRange(m_context.yRange.lower - m_context.yDelta,
759  m_context.yRange.upper - m_context.yDelta);
760  }
761 
763 
764  // We cannot store the new ranges in the history, because the pan operation
765  // involved a huge quantity of micro-movements elicited upon each mouse move
766  // cursor event so we would have a huge history.
767  // updateAxesRangeHistory();
768 
769  // Now that the contex has the right range values, we can emit the
770  // signal that will be used by this plot widget users, typically to
771  // abide by the x/y range lock required by the user.
772 
774 
775  replot();
776 }
777 
778 
781 {
782  QCPGraph *graph_p = graph(index);
783 
784  return toTrace(graph_p);
785 }
786 
787 
789 BaseTracePlotWidget::toTrace(const QCPGraph *graph_p) const
790 {
791  if(graph_p == nullptr)
792  qFatal("Programming error. Pointer cannot be nullptr.");
793 
794  pappso::Trace trace;
795 
796  QSharedPointer<QCPGraphDataContainer> graph_data_container_p =
797  graph_p->data();
798 
799  // Iterate in the keys
800  auto beginIt = graph_data_container_p->begin();
801  auto endIt = graph_data_container_p->end();
802 
803  for(auto iter = beginIt; iter != endIt; ++iter)
804  trace.push_back(pappso::DataPoint(iter->key, iter->value));
805 
806  return trace;
807 }
808 
809 
811 BaseTracePlotWidget::toTrace(const QCPRange &x_axis_range, int index) const
812 {
813  QCPGraph *graph_p = graph(index);
814 
815  if(graph_p == nullptr)
816  qFatal("Programming error.");
817 
818  return toTrace(x_axis_range, graph_p);
819 }
820 
821 
823 BaseTracePlotWidget::toTrace(const QCPRange &x_axis_range,
824  const QCPGraph *graph_p) const
825 {
826 
827  // Make a Trace with the data in the range.
828  Trace data_trace;
829 
830  QSharedPointer<QCPGraphDataContainer> graph_data_container_sp;
831 
832  graph_data_container_sp = graph_p->data();
833 
834  // Grab the iterator to the start to the x axis range
835  auto beginIt = graph_data_container_sp->findBegin(x_axis_range.lower,
836  /*expandedRange*/ true);
837  // Grab the iterator to the end of the axis range
838  auto endIt = graph_data_container_sp->findEnd(x_axis_range.upper,
839  /*expandedRange*/ true);
840 
841  for(auto iter = beginIt; iter != endIt; ++iter)
842  data_trace.push_back(DataPoint(iter->key, iter->value));
843 
844  return data_trace;
845 }
846 
847 
848 } // namespace pappso
pappso::BaseTracePlotWidget::addTrace
virtual QCPGraph * addTrace(const pappso::Trace &trace, const QColor &color)
Definition: basetraceplotwidget.cpp:149
pappso::BasePlotContext::xRegionRangeStart
double xRegionRangeStart
Definition: baseplotwidget.h:104
pappso::BasePlotWidget::updateAxesRangeHistory
virtual void updateAxesRangeHistory()
Create new axis range history items and append them to the history.
Definition: baseplotwidget.cpp:393
pappso::BasePlotContext::pressedMouseButtons
Qt::MouseButtons pressedMouseButtons
Definition: baseplotwidget.h:121
pappso::BasePlotWidget::m_pen
QPen m_pen
Pen used to draw the graph and textual elements in the plot widget.
Definition: baseplotwidget.h:392
pappso::BasePlotContext::currentDragPoint
QPointF currentDragPoint
Definition: baseplotwidget.h:82
pappso::BasePlotWidget
Definition: baseplotwidget.h:136
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks
Definition: aa.cpp:39
pappso::BaseTracePlotWidget::getValuesY
std::vector< double > getValuesY(int index) const
Definition: basetraceplotwidget.cpp:340
pappso::BaseTracePlotWidget::getValueRangeOnKeyRange
QCPRange getValueRangeOnKeyRange(QCPAbstractPlottable *plottable_p, bool &ok)
Definition: basetraceplotwidget.cpp:364
basetraceplotwidget.h
pappso::BasePlotContext::xRange
QCPRange xRange
Definition: baseplotwidget.h:86
pappso::BasePlotContext::wasClickOnXAxis
bool wasClickOnXAxis
Definition: baseplotwidget.h:93
pappso::BaseTracePlotWidget::axisReframe
virtual void axisReframe() override
Definition: basetraceplotwidget.cpp:653
pappso::DataPoint
Definition: datapoint.h:21
pappso::PeptideIonCter::y
@ y
pappso::ExceptionNotPossible
Definition: exceptionnotpossible.h:32
pappso::BasePlotWidget::updateContextRanges
virtual void updateContextRanges()
Definition: baseplotwidget.cpp:2225
pappso::BasePlotWidget::plottableSelectionChangedSignal
void plottableSelectionChangedSignal(QCPAbstractPlottable *plottable_p, bool selected)
pappso::BasePlotContext::keyboardModifiers
Qt::KeyboardModifiers keyboardModifiers
Definition: baseplotwidget.h:116
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:132
pappso::BaseTracePlotWidget::BaseTracePlotWidget
BaseTracePlotWidget(QWidget *parent=0)
Definition: basetraceplotwidget.cpp:44
pappso::BaseTracePlotWidget::toTrace
pappso::Trace toTrace(int index) const
Definition: basetraceplotwidget.cpp:780
pappso::BasePlotContext::yRegionRangeStart
double yRegionRangeStart
Definition: baseplotwidget.h:107
pappso::BasePlotContext::yRange
QCPRange yRange
Definition: baseplotwidget.h:87
pappso::BaseTracePlotWidget::getValuesX
std::vector< double > getValuesX(int index) const
Definition: basetraceplotwidget.cpp:316
pappso::BasePlotWidget::resetAxesRangeHistory
virtual void resetAxesRangeHistory()
Definition: baseplotwidget.cpp:366
pappso::BaseTracePlotWidget::axisRescale
virtual void axisRescale() override
RANGE-related functions.
Definition: basetraceplotwidget.cpp:533
pappso::BasePlotContext::wasClickOnYAxis
bool wasClickOnYAxis
Definition: baseplotwidget.h:94
pappso::BaseTracePlotWidget::axisZoom
virtual void axisZoom() override
Definition: basetraceplotwidget.cpp:700
pappso::Trace::xValues
std::vector< pappso_double > xValues() const
Definition: trace.cpp:544
pappso::BasePlotContext::xRegionRangeEnd
double xRegionRangeEnd
Definition: baseplotwidget.h:105
pappso::BaseTracePlotWidget::clearGraphData
virtual void clearGraphData(int graph_index)
Definition: basetraceplotwidget.cpp:133
pappso::BaseTracePlotWidget::setGraphData
virtual void setGraphData(int graph_index, const std::vector< double > &keys, const std::vector< double > &values)
Definition: basetraceplotwidget.cpp:71
pappso::BaseTracePlotWidget::~BaseTracePlotWidget
virtual ~BaseTracePlotWidget()
Destruct this BaseTracePlotWidget instance.
Definition: basetraceplotwidget.cpp:65
pappso::BasePlotContext::yDelta
double yDelta
Definition: baseplotwidget.h:111
pappso::BasePlotContext::yRegionRangeEnd
double yRegionRangeEnd
Definition: baseplotwidget.h:108
pappso::BaseTracePlotWidget::axisDoubleClickHandler
virtual void axisDoubleClickHandler(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event) override
Definition: basetraceplotwidget.cpp:467
pappso::Trace::yValues
std::vector< pappso_double > yValues() const
Definition: trace.cpp:558
pappso::BasePlotContext::xDelta
double xDelta
Definition: baseplotwidget.h:110
pappso::BaseTracePlotWidget::getYatX
double getYatX(double x, QCPGraph *graph_p)
Definition: basetraceplotwidget.cpp:439
pappso::BaseTracePlotWidget::findIntegrationLowerRangeForKey
virtual bool findIntegrationLowerRangeForKey(int index, double key, QCPRange &range)
Find a minimal integration range starting at an existing data point.
Definition: basetraceplotwidget.cpp:233
pappso::BasePlotContext::startDragPoint
QPointF startDragPoint
Definition: baseplotwidget.h:81
pappso::BasePlotWidget::m_context
BasePlotContext m_context
Definition: baseplotwidget.h:312
pappso::BaseTracePlotWidget::axisPan
virtual void axisPan() override
Definition: basetraceplotwidget.cpp:735
pappso::PappsoException
Definition: pappsoexception.h:42
pappso::BasePlotWidget::plotRangesChangedSignal
void plotRangesChangedSignal(const BasePlotContext &context)