OpenMS
Loading...
Searching...
No Matches
Painter2DBase.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Chris Bielow $
6// $Authors: Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
12
17
18#include <vector>
19
20class QPainter;
21class QPenStyle;
22class QPoint;
23
24namespace OpenMS
25{
26 class ConsensusFeature;
27 class LayerDataChrom;
28 class LayerDataConsensus;
29 class LayerDataFeature;
30 class LayerDataIdent;
31 class LayerDataIonMobility;
32 class LayerDataPeak;
33 struct PeakIndex;
34 class Plot2DCanvas;
35
36
40 class OPENMS_GUI_DLLAPI Painter2DBase : public PainterBase
41 {
42 public:
43 virtual ~Painter2DBase() = default;
44
52 virtual void paint(QPainter* painter, Plot2DCanvas* canvas, int layer_index) = 0;
53
62 virtual void highlightElement(QPainter* painter, Plot2DCanvas* canvas, const PeakIndex element);
63
64 protected:
73 static void paintConvexHull_(QPainter& painter, Plot2DCanvas* canvas, const ConvexHull2D& hull, bool has_identifications);
74
83 static void paintConvexHulls_(QPainter& painter, Plot2DCanvas* canvas, const std::vector<ConvexHull2D>& hulls, bool has_identifications);
84
85 static void paintPeptideIDs_(QPainter* painter, Plot2DCanvas* canvas, const IPeptideIds::PepIds& ids, int layer_index);
86 };
87
92 class OPENMS_GUI_DLLAPI Painter2DPeak : public Painter2DBase
93 {
94 public:
97
98 void paint(QPainter*, Plot2DCanvas* canvas, int layer_index) override;
99
100 protected:
101 void paintAllIntensities_(QPainter& painter, Plot2DCanvas* canvas, Size layer_index, double pen_width);
102
115 void paintMaximumIntensities_(QPainter& painter, Plot2DCanvas* canvas, Size layer_index, Size rt_pixel_count, Size mz_pixel_count);
116
117
121 void paintPrecursorPeaks_(QPainter& painter, Plot2DCanvas* canvas);
123 };
124
129 class OPENMS_GUI_DLLAPI Painter2DChrom : public Painter2DBase
130 {
131 public:
134
135 void paint(QPainter* painter, Plot2DCanvas* canvas, int layer_index) override;
136
137 protected:
139 };
140
145 class OPENMS_GUI_DLLAPI Painter2DIonMobility : public Painter2DBase
146 {
147 public:
150
151 void paint(QPainter* painter, Plot2DCanvas* canvas, int layer_index) override;
152
153 protected:
155 };
156
161 class OPENMS_GUI_DLLAPI Painter2DFeature : public Painter2DBase
162 {
163 public:
166
167 void paint(QPainter*, Plot2DCanvas* canvas, int layer_index) override;
168
169 void highlightElement(QPainter* painter, Plot2DCanvas* canvas, const PeakIndex element) override;
170
171 protected:
175 void paintTraceConvexHulls_(QPainter* painter, Plot2DCanvas* canvas);
176
180 void paintFeatureConvexHulls_(QPainter* painter, Plot2DCanvas* canvas);
181
183 };
184
189 class OPENMS_GUI_DLLAPI Painter2DConsensus : public Painter2DBase
190 {
191 public:
194
195 void paint(QPainter*, Plot2DCanvas* canvas, int layer_index) override;
196
197 void highlightElement(QPainter* painter, Plot2DCanvas* canvas, const PeakIndex element) override;
198
199 protected:
207 void paintConsensusElements_(QPainter* painter, Plot2DCanvas* canvas, Size layer_index);
208
217 void paintConsensusElement_(QPainter* painter, Plot2DCanvas* canvas, Size layer_index, const ConsensusFeature& cf);
218
226 bool isConsensusFeatureVisible_(const Plot2DCanvas* canvas, const ConsensusFeature& cf, Size layer_index);
227
229 };
230
234 class OPENMS_GUI_DLLAPI Painter2DIdent : public Painter2DBase
235 {
236 public:
239
241 void paint(QPainter*, Plot2DCanvas* canvas, int layer_index) override;
242
243 protected:
245 };
246
247} // namespace OpenMS
A consensus feature spanning multiple LC-MS/MS experiments.
Definition ConsensusFeature.h:45
Definition ConvexHull2D.h:49
Class that stores the data for one layer of type Chromatogram.
Definition LayerDataChrom.h:24
Class that stores the data for one layer of type ConsensusMap.
Definition LayerDataConsensus.h:24
Class that stores the data for one layer of type FeatureMap.
Definition LayerDataFeature.h:23
Class that stores the data for one layer of type PeptideIdentifications.
Definition LayerDataIdent.h:23
Class that stores the data for one layer of type IonMobility.
Definition LayerDataIonMobility.h:28
Class that stores the data for one layer of type PeakMap.
Definition LayerDataPeak.h:29
A base class for painting all items from a data layer (as supported by class derived from here) onto ...
Definition Painter2DBase.h:41
virtual void paint(QPainter *painter, Plot2DCanvas *canvas, int layer_index)=0
Paints items using the given painter onto the canvas.
virtual ~Painter2DBase()=default
static void paintConvexHull_(QPainter &painter, Plot2DCanvas *canvas, const ConvexHull2D &hull, bool has_identifications)
Paints a convex hull.
virtual void highlightElement(QPainter *painter, Plot2DCanvas *canvas, const PeakIndex element)
Emphasize a certain element (e.g. feature), e.g. when mouse hovering. By default, nothing is highligh...
static void paintPeptideIDs_(QPainter *painter, Plot2DCanvas *canvas, const IPeptideIds::PepIds &ids, int layer_index)
static void paintConvexHulls_(QPainter &painter, Plot2DCanvas *canvas, const std::vector< ConvexHull2D > &hulls, bool has_identifications)
Paints convex hulls.
Painter2D for chromatograms.
Definition Painter2DBase.h:130
void paint(QPainter *painter, Plot2DCanvas *canvas, int layer_index) override
Paints items using the given painter onto the canvas.
const LayerDataChrom * layer_
the data to paint
Definition Painter2DBase.h:138
Painter2DChrom(const LayerDataChrom *parent)
C'tor which remembers the layer to paint.
Painter2D for ConsensusFeatures.
Definition Painter2DBase.h:190
void paintConsensusElement_(QPainter *painter, Plot2DCanvas *canvas, Size layer_index, const ConsensusFeature &cf)
Paints one consensus element of a consensus features layer.
const LayerDataConsensus * layer_
the data to paint
Definition Painter2DBase.h:228
Painter2DConsensus(const LayerDataConsensus *parent)
C'tor which remembers the layer to paint.
void paintConsensusElements_(QPainter *painter, Plot2DCanvas *canvas, Size layer_index)
Paints the consensus elements of a consensus features layer.
void paint(QPainter *, Plot2DCanvas *canvas, int layer_index) override
Paints items using the given painter onto the canvas.
bool isConsensusFeatureVisible_(const Plot2DCanvas *canvas, const ConsensusFeature &cf, Size layer_index)
checks if any element of a consensus feature is currently visible.
void highlightElement(QPainter *painter, Plot2DCanvas *canvas, const PeakIndex element) override
Emphasize a certain element (e.g. feature), e.g. when mouse hovering. By default, nothing is highligh...
Painter2D for Features.
Definition Painter2DBase.h:162
void paintTraceConvexHulls_(QPainter *painter, Plot2DCanvas *canvas)
Paints convex hulls (one for each mass trace) of a features layer.
Painter2DFeature(const LayerDataFeature *parent)
C'tor which remembers the layer to paint.
const LayerDataFeature * layer_
the data to paint
Definition Painter2DBase.h:182
void paint(QPainter *, Plot2DCanvas *canvas, int layer_index) override
Paints items using the given painter onto the canvas.
void highlightElement(QPainter *painter, Plot2DCanvas *canvas, const PeakIndex element) override
Emphasize a certain element (e.g. feature), e.g. when mouse hovering. By default, nothing is highligh...
void paintFeatureConvexHulls_(QPainter *painter, Plot2DCanvas *canvas)
Paints the convex hulls (one for each feature) of a features layer.
Painter2D for Identifications.
Definition Painter2DBase.h:235
const LayerDataIdent * layer_
the data to paint
Definition Painter2DBase.h:244
Painter2DIdent(const LayerDataIdent *parent)
C'tor which remembers the layer to paint.
void paint(QPainter *, Plot2DCanvas *canvas, int layer_index) override
Implementation of base class.
Painter2D for ion mobilograms.
Definition Painter2DBase.h:146
void paint(QPainter *painter, Plot2DCanvas *canvas, int layer_index) override
Paints items using the given painter onto the canvas.
const LayerDataIonMobility * layer_
the data to paint
Definition Painter2DBase.h:154
Painter2DIonMobility(const LayerDataIonMobility *parent)
C'tor which remembers the layer to paint.
Painter2D for spectra.
Definition Painter2DBase.h:93
void paintMaximumIntensities_(QPainter &painter, Plot2DCanvas *canvas, Size layer_index, Size rt_pixel_count, Size mz_pixel_count)
Paints maximum intensity of individual peaks.
void paintPrecursorPeaks_(QPainter &painter, Plot2DCanvas *canvas)
Paints the locations where MS2 scans where triggered.
void paintAllIntensities_(QPainter &painter, Plot2DCanvas *canvas, Size layer_index, double pen_width)
Painter2DPeak(const LayerDataPeak *parent)
C'tor which remembers the layer to paint.
const LayerDataPeak * layer_
the data to paint
Definition Painter2DBase.h:122
void paint(QPainter *, Plot2DCanvas *canvas, int layer_index) override
Paints items using the given painter onto the canvas.
An empty base class with some static convenience functions.
Definition PainterBase.h:38
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Canvas for 2D-visualization of peak map, feature map and consensus map data.
Definition Plot2DCanvas.h:46
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Index of a peak or feature.
Definition PeakIndex.h:25