libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
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 <cstddef>
42#include <qcustomplot.h>
43
44
45/////////////////////// Local includes
47#include "baseplotwidget.h"
48#include "colormapplotconfig.h"
51
52
53namespace pappso
54{
55
56
58
59typedef std::shared_ptr<BaseColorMapPlotWidget> BaseColorMapPlotWidgetSPtr;
60typedef std::shared_ptr<const BaseColorMapPlotWidget>
62
64{
65 Q_OBJECT;
66
67 public:
68 explicit BaseColorMapPlotWidget(QWidget *parent);
69 explicit BaseColorMapPlotWidget(QWidget *parent,
70 const QString &x_axis_label,
71 const QString &y_axis_label);
72
74
75 virtual void
76 setColorMapPlotConfig(const ColorMapPlotConfig &color_map_config);
79
80 virtual QCPColorMap *addColorMap(
81 std::shared_ptr<std::map<double, MapTrace>> double_map_trace_map_sp,
82 const ColorMapPlotConfig color_map_plot_config,
83 const QColor &color);
84
85 virtual QCPColorMap *
86 addColorMap(const TimsFrame &tims_frame,
87 const ColorMapPlotConfig color_map_plot_config,
88 const QColor &color);
89
90 virtual void transposeAxes();
91
92 // Change the scale of the intensity to log10 (color, z virtual axis)
93 virtual void zAxisScaleToLog10();
94 virtual void zAxisFilterLowPassPercentage(double threshold_percentage);
95
96 /** @brief fix maximum value for the intensity
97 */
98 virtual void zAxisFilterLowPassThreshold(double threshold);
99
100 virtual void zAxisFilterHighPassPercentage(double threshold_percentage);
101
102 virtual void zAxisDataResetToOriginal();
103
106
111
112 virtual void setPlottingColor(QCPAbstractPlottable *plottable_p,
113 const QColor &new_color) override;
114 virtual QColor getPlottingColor(int index = 0) const override;
115
116 void dataTo3ColString(QString &data_string);
117 void dataToMatrixString(QString &data_string, bool detailed = false);
118
119 void currentXaxisRangeIndices(int &lower, int &upper);
120 void currentYaxisRangeIndices(int &lower, int &upper);
121
122 signals:
123
124 protected:
125 QCPColorMapData *mpa_origColorMapData = nullptr;
126
129};
130
131
132} // namespace pappso
void dataToMatrixString(QString &data_string, bool detailed=false)
void currentYaxisRangeIndices(int &lower, int &upper)
virtual QColor getPlottingColor(int index=0) const override
ColorMapPlotConfig * mpa_origColorMapPlotConfig
void dataTo3ColString(QString &data_string)
virtual void zAxisFilterLowPassThreshold(double threshold)
fix maximum value for the intensity
const ColorMapPlotConfig * getOrigColorMapPlotConfig()
void currentXaxisRangeIndices(int &lower, int &upper)
virtual void setColorMapPlotConfig(const ColorMapPlotConfig &color_map_config)
virtual void setPlottingColor(QCPAbstractPlottable *plottable_p, const QColor &new_color) override
virtual const ColorMapPlotConfig & getColorMapPlotConfig()
virtual QCPColorMap * addColorMap(std::shared_ptr< std::map< double, MapTrace > > double_map_trace_map_sp, const ColorMapPlotConfig color_map_plot_config, const QColor &color)
Enums::AxisScale axisScale(Enums::Axis axis) const
virtual void zAxisFilterHighPassPercentage(double threshold_percentage)
virtual void zAxisFilterLowPassPercentage(double threshold_percentage)
BasePlotWidget(QWidget *parent)
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const BaseColorMapPlotWidget > BaseColorMapPlotWidgetCstSPtr
std::shared_ptr< BaseColorMapPlotWidget > BaseColorMapPlotWidgetSPtr