libpappsomspp
Library for mass spectrometry
basecolormapplotwidget.h
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 #pragma once
27 
28 /////////////////////// StdLib includes
29 
30 
31 /////////////////////// Qt includes
32 #include <QObject>
33 #include <QString>
34 #include <QWidget>
35 #include <QBrush>
36 #include <QColor>
37 #include <QVector>
38 
39 
40 /////////////////////// QCustomPlot
41 #include <qcustomplot.h>
42 
43 
44 /////////////////////// Local includes
45 #include "../../exportinmportconfig.h"
46 #include "baseplotwidget.h"
47 #include "colormapplotconfig.h"
48 #include "../../trace/trace.h"
49 
50 
51 namespace pappso
52 {
53 
54 
55 class BaseColorMapPlotWidget;
56 
57 typedef std::shared_ptr<BaseColorMapPlotWidget> BaseColorMapPlotWidgetSPtr;
58 typedef std::shared_ptr<const BaseColorMapPlotWidget>
60 
62 {
63  Q_OBJECT;
64 
65  public:
66  explicit BaseColorMapPlotWidget(QWidget *parent,
67  const QString &x_axis_label,
68  const QString &y_axis_label);
69 
70  virtual ~BaseColorMapPlotWidget();
71 
72  virtual void
73  setColorMapPlotConfig(const ColorMapPlotConfig &color_map_config);
74  virtual const ColorMapPlotConfig &getColorMapPlotConfig();
75 
76  virtual QCPColorMap *addColorMap(
77  std::shared_ptr<std::map<double, MapTrace>> double_map_trace_map_sp,
78  const ColorMapPlotConfig color_map_plot_config,
79  const QColor &color);
80 
81  virtual void transposeAxes();
82 
83  // Change the scale of the intensity to log10 (color, z virtual axis)
84  virtual void zAxisScaleToLog10();
85  virtual void zAxisFilterLowPassPercentage(double threshold_percentage);
86  virtual void zAxisFilterHighPassPercentage(double threshold_percentage);
87 
88  virtual void zAxisDataResetToOriginal();
89 
90  DataKind xAxisDataKind() const;
91  DataKind yAxisDataKind() const;
92 
93  AxisScale axisScale(Axis axis) const;
94  AxisScale xAxisScale() const;
95  AxisScale yAxisScale() const;
96  AxisScale zAxisScale() const;
97 
98  virtual void setPlottingColor(QCPAbstractPlottable *plottable_p,
99  const QColor &new_color) override;
100  virtual QColor getPlottingColor(int index = 0) const override;
101 
102  QString dataToString();
103 
104  signals:
105 
106  protected:
107  QCPColorMapData *mpa_backupColorMapData = nullptr;
109  ColorMapPlotConfig *mpa_backupColorMapPlotConfig = nullptr;
110 };
111 
112 
113 } // namespace pappso
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
Axis
Definition: types.h:180
AxisScale
Definition: types.h:189
std::shared_ptr< const BaseColorMapPlotWidget > BaseColorMapPlotWidgetCstSPtr
DataKind
Definition: types.h:171
std::shared_ptr< BaseColorMapPlotWidget > BaseColorMapPlotWidgetSPtr