libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
basetraceplotwidget.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 "
pappsomspp/export-import-config.h
"
46
#include "
baseplotwidget.h
"
47
#include "
../../core/trace/trace.h
"
48
49
namespace
pappso
50
{
51
52
53
class
BaseTracePlotWidget
;
54
55
typedef
std::shared_ptr<BaseTracePlotWidget>
BaseTracePlotWidgetSPtr
;
56
typedef
std::shared_ptr<const BaseTracePlotWidget>
BaseTracePlotWidgetCstSPtr
;
57
58
class
PMSPP_LIB_DECL
BaseTracePlotWidget
:
public
BasePlotWidget
59
{
60
Q_OBJECT
61
62
public
:
63
enum class
PlotType
: int8_t
64
{
65
NONE = 0x00,
66
GRAPH,
67
BARS,
68
COLORMAP,
69
};
70
71
explicit
BaseTracePlotWidget
(QWidget *parent = 0);
72
explicit
BaseTracePlotWidget
(QWidget *parent,
73
const
QString &x_axis_label,
74
const
QString &y_axis_label);
75
76
virtual
~BaseTracePlotWidget
();
77
78
virtual
void
setGraphData(
int
graph_index,
79
const
std::vector<double> &keys,
80
const
std::vector<double> &values);
81
82
virtual
void
setGraphData(QCPGraph *graph_p,
83
const
std::vector<double> &keys,
84
const
std::vector<double> &values);
85
86
virtual
void
clearGraphData(
int
graph_index);
87
88
virtual
void
axisDoubleClickHandler(QCPAxis *axis,
89
QCPAxis::SelectablePart part,
90
QMouseEvent *event)
override
;
91
92
// All these need to be overridden because of some special treatment in case
93
// of Trace plots (graphs, specifically, and not color maps, for example).
94
virtual
void
axisRescale()
override
;
95
virtual
void
axisReframe()
override
;
96
virtual
void
axisZoom()
override
;
97
virtual
void
axisPan()
override
;
98
99
virtual
QCPGraph *addGraphPlot(
const
Trace
&trace,
const
QColor &color);
100
virtual
QCPBars *addBarsPlot(
const
Trace
&bars,
const
QColor &color);
101
102
virtual
bool
103
findIntegrationLowerRangeForKey(
int
index,
double
key, QCPRange &range);
104
105
std::vector<double> getValuesX(
int
index)
const
;
106
std::vector<double> getValuesY(
int
index)
const
;
107
108
QCPRange getValueRangeOnKeyRange(QCPAbstractPlottable *plottable_p,
bool
&ok);
109
QCPRange getValueRangeOnKeyRange(
int
index,
bool
&ok);
110
111
double
getYatX(
double
x, QCPGraph *graph_p);
112
// index is 0 by default, which means that if there is a single graph, then,
113
// that will be it.
114
double
getYatX(
double
x,
int
index = 0);
115
116
Trace
toTrace(
int
index,
bool
only_visible_range =
false
)
const
;
117
Trace
toTrace(
const
QCPGraph *graph_p,
bool
only_visible_range =
false
)
const
;
118
Trace
toTrace(
const
QCPRange &x_axis_range,
int
index)
const
;
119
Trace
toTrace(
const
QCPRange &x_axis_range,
const
QCPGraph *graph_p)
const
;
120
Trace
toTrace(
const
QCPRange &x_axis_range,
const
QCPBars *bars_p)
const
;
121
Trace
toTrace(
const
QCPRange &x_axis_range,
const
QCPAbstractPlottable *plottable_p)
const
;
122
Trace
toTrace(
const
QCPAbstractPlottable *plottable_p)
const
;
123
};
124
125
126
}
// namespace pappso
baseplotwidget.h
pappso::BasePlotWidget::BasePlotWidget
BasePlotWidget(QWidget *parent)
Definition
baseplotwidget.cpp:49
pappso::BaseTracePlotWidget
Definition
basetraceplotwidget.h:59
pappso::BaseTracePlotWidget::BaseTracePlotWidget
BaseTracePlotWidget(QWidget *parent=0)
Definition
basetraceplotwidget.cpp:43
pappso::BaseTracePlotWidget::PlotType
PlotType
Definition
basetraceplotwidget.h:64
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::BaseTracePlotWidgetSPtr
std::shared_ptr< BaseTracePlotWidget > BaseTracePlotWidgetSPtr
Definition
basetraceplotwidget.h:55
pappso::BaseTracePlotWidgetCstSPtr
std::shared_ptr< const BaseTracePlotWidget > BaseTracePlotWidgetCstSPtr
Definition
basetraceplotwidget.h:56
trace.h
pappsomspp
gui
plotwidget
basetraceplotwidget.h
Generated on
for libpappsomspp by
1.17.0