OpenMS
Painter1DBase.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2023.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Chris Bielow $
32 // $Authors: Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
39 
40 
41 class QPainter;
42 class QPenStyle;
43 
44 namespace OpenMS
45 {
46  class LayerData1DBase;
47  class LayerData1DChrom;
48  class LayerData1DIonMobility;
49  class LayerData1DPeak;
50  class Plot1DCanvas;
51 
55  class OPENMS_GUI_DLLAPI Painter1DBase : public PainterBase
56  {
57  public:
58  virtual ~Painter1DBase() = default;
59 
67  virtual void paint(QPainter* painter, Plot1DCanvas* canvas, int layer_index) = 0;
68 
69  void drawAnnotations_(const LayerData1DBase* layer, QPainter& painter, Plot1DCanvas* canvas) const;
70  };
71 
76  class OPENMS_GUI_DLLAPI Painter1DPeak : public Painter1DBase
77  {
78  public:
81 
83  void paint(QPainter*, Plot1DCanvas* canvas, int layer_index) override;
84 
85  protected:
87  void drawMZAtInterestingPeaks_(QPainter& painter, Plot1DCanvas* canvas, MSSpectrum::ConstIterator v_begin, MSSpectrum::ConstIterator v_end) const;
88 
90  };
91 
96  class OPENMS_GUI_DLLAPI Painter1DChrom : public Painter1DBase
97  {
98  public:
101 
103  void paint(QPainter*, Plot1DCanvas* canvas, int layer_index) override;
104 
105  protected:
107  };
108 
113  class OPENMS_GUI_DLLAPI Painter1DIonMobility : public Painter1DBase
114  {
115  public:
118 
120  void paint(QPainter*, Plot1DCanvas* canvas, int layer_index) override;
121 
122  protected:
124  };
125 
126 } // namespace OpenMS
Base class for all 1D layers, a special case of LayerData.
Definition: LayerData1DBase.h:54
Definition: LayerData1DChrom.h:43
Definition: LayerData1DIonMobility.h:44
Definition: LayerData1DPeak.h:44
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:136
A base class for painting all items from a data layer (as supported by class derived from here) onto ...
Definition: Painter1DBase.h:56
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:97
void paint(QPainter *, Plot1DCanvas *canvas, int layer_index) override
Implementation of base class.
const LayerData1DChrom * layer_
the data to paint
Definition: Painter1DBase.h:106
Painter1DChrom(const LayerData1DChrom *parent)
C'tor which remembers the layer to paint.
Painter1D for mobilograms.
Definition: Painter1DBase.h:114
void paint(QPainter *, Plot1DCanvas *canvas, int layer_index) override
Implementation of base class.
const LayerData1DIonMobility * layer_
the data to paint
Definition: Painter1DBase.h:123
Painter1DIonMobility(const LayerData1DIonMobility *parent)
C'tor which remembers the layer to paint.
Painter1D for spectra.
Definition: Painter1DBase.h:77
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:89
Painter1DPeak(const LayerData1DPeak *parent)
C'tor which remembers the layer to paint.
An empty base class with some static convenience functions.
Definition: PainterBase.h:65
Canvas for visualization of one or several spectra.
Definition: Plot1DCanvas.h:321
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48