OpenMS
Painter1DBase.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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 
13 
14 
15 class QPainter;
16 class QPenStyle;
17 
18 namespace OpenMS
19 {
20  class LayerData1DBase;
21  class LayerData1DChrom;
22  class LayerData1DIonMobility;
23  class LayerData1DPeak;
24  class Plot1DCanvas;
25 
29  class OPENMS_GUI_DLLAPI Painter1DBase : public PainterBase
30  {
31  public:
32  virtual ~Painter1DBase() = default;
33 
41  virtual void paint(QPainter* painter, Plot1DCanvas* canvas, int layer_index) = 0;
42 
43  void drawAnnotations_(const LayerData1DBase* layer, QPainter& painter, Plot1DCanvas* canvas) const;
44  };
45 
50  class OPENMS_GUI_DLLAPI Painter1DPeak : public Painter1DBase
51  {
52  public:
55 
57  void paint(QPainter*, Plot1DCanvas* canvas, int layer_index) override;
58 
59  protected:
61  void drawMZAtInterestingPeaks_(QPainter& painter, Plot1DCanvas* canvas, MSSpectrum::ConstIterator v_begin, MSSpectrum::ConstIterator v_end) const;
62 
64  };
65 
70  class OPENMS_GUI_DLLAPI Painter1DChrom : public Painter1DBase
71  {
72  public:
75 
77  void paint(QPainter*, Plot1DCanvas* canvas, int layer_index) override;
78 
79  protected:
81  };
82 
87  class OPENMS_GUI_DLLAPI Painter1DIonMobility : public Painter1DBase
88  {
89  public:
92 
94  void paint(QPainter*, Plot1DCanvas* canvas, int layer_index) override;
95 
96  protected:
98  };
99 
100 } // namespace OpenMS
Base class for all 1D layers, a special case of LayerData.
Definition: LayerData1DBase.h:28
Definition: LayerData1DChrom.h:17
Definition: LayerData1DIonMobility.h:18
Definition: LayerData1DPeak.h:18
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:110
A base class for painting all items from a data layer (as supported by class derived from here) onto ...
Definition: Painter1DBase.h:30
void drawAnnotations_(const LayerData1DBase *layer, QPainter &painter, Plot1DCanvas *canvas) const
virtual ~Painter1DBase()=default
virtual void paint(QPainter *painter, Plot1DCanvas *canvas, int layer_index)=0
Paints items using the given painter onto the canvas.
Painter1D for chromatograms.
Definition: Painter1DBase.h:71
void paint(QPainter *, Plot1DCanvas *canvas, int layer_index) override
Implementation of base class.
const LayerData1DChrom * layer_
the data to paint
Definition: Painter1DBase.h:80
Painter1DChrom(const LayerData1DChrom *parent)
C'tor which remembers the layer to paint.
Painter1D for mobilograms.
Definition: Painter1DBase.h:88
void paint(QPainter *, Plot1DCanvas *canvas, int layer_index) override
Implementation of base class.
const LayerData1DIonMobility * layer_
the data to paint
Definition: Painter1DBase.h:97
Painter1DIonMobility(const LayerData1DIonMobility *parent)
C'tor which remembers the layer to paint.
Painter1D for spectra.
Definition: Painter1DBase.h:51
void paint(QPainter *, Plot1DCanvas *canvas, int layer_index) override
Implementation of base class.
void drawMZAtInterestingPeaks_(QPainter &painter, Plot1DCanvas *canvas, MSSpectrum::ConstIterator v_begin, MSSpectrum::ConstIterator v_end) const
annotate up to 10 interesting peaks in the range vbegin to vend with their m/z values (using deisotop...
const LayerData1DPeak * layer_
the data to paint
Definition: Painter1DBase.h:63
Painter1DPeak(const LayerData1DPeak *parent)
C'tor which remembers the layer to paint.
An empty base class with some static convenience functions.
Definition: PainterBase.h:39
Canvas for visualization of one or several spectra.
Definition: Plot1DCanvas.h:295
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22