OpenMS
Plot3DCanvas.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: Timo Sachsenberg$
6 // $Authors: Cornelia Friedle $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
14 // OpenMS
17 
18 
19 class QPainter;
20 class QOpenGLWidget;
21 class QResizeEvent;
22 
23 namespace OpenMS
24 {
25  class Plot3DOpenGLCanvas;
26 
40  class OPENMS_GUI_DLLAPI Plot3DCanvas :
41  public PlotCanvas
42  {
43  Q_OBJECT
44 
45  friend class Plot3DOpenGLCanvas;
46 
47 public:
48 
50  Plot3DCanvas(const Param & preferences, QWidget * parent = nullptr);
52  ~Plot3DCanvas() override;
53 
56  {
57  SHADE_FLAT = 0,
58  SHADE_SMOOTH = 1
59  };
60 
63 
65 
66  void resizeEvent(QResizeEvent * e) override;
67  void contextMenuEvent(QContextMenuEvent * e) override;
69  bool isLegendShown() const;
72  void showLegend(bool);
75 
76  // docu in base class
77  void showCurrentLayerPreferences() override;
78 
79 signals:
80 
83 
84 public slots:
85 
86  // Docu in base class
87  void activateLayer(Size layer_index) override;
88  // Docu in base class
89  void removeLayer(Size layer_index) override;
90  // Docu in base class
91  void updateLayer(Size i) override;
92  // Docu in base class
93  void intensityModeChange_() override;
94 
95 protected slots:
96 
99 
100 protected:
101  // Docu in base class
102  bool finishAdding_() override;
103 
104  // Reimplementation in order to update the OpenGL widget
105  void update_(const char * caller_name = nullptr) override;
106 
109 
112  };
113 
114 } //namespace
A gradient of multiple colors and arbitrary distances between colors.
Definition: MultiGradient.h:42
Management and storage of parameters / INI files.
Definition: Param.h:44
Canvas for 3D-visualization of peak map data.
Definition: Plot3DCanvas.h:42
~Plot3DCanvas() override
Destructor.
bool finishAdding_() override
Method that is called when a new layer has been added.
void removeLayer(Size layer_index) override
void currentLayerParamtersChanged_()
Reacts on changed layer parameters.
void showCurrentPeaksAs2D()
Requests to display all spectra in 2D plot.
void showCurrentLayerPreferences() override
Shows the preferences dialog of the active layer.
bool legend_shown_
whether the legend is shown or not
Definition: Plot3DCanvas.h:108
void intensityModeChange_() override
void activateLayer(Size layer_index) override
void updateLayer(Size i) override
void update_(const char *caller_name=nullptr) override
Updates the displayed data.
void contextMenuEvent(QContextMenuEvent *e) override
Plot3DCanvas(const Param &preferences, QWidget *parent=nullptr)
Constructor.
Plot3DOpenGLCanvas * openglwidget() const
returns the Plot3DOpenGLcanvas
void showLegend(bool)
Shows/hides the legend.
ShadeModes
Different shade modes.
Definition: Plot3DCanvas.h:56
Plot3DOpenGLCanvas * openglcanvas_
pointer to the SpectrumOpenGLCanvas implementation
Definition: Plot3DCanvas.h:74
MultiGradient linear_gradient_
stores the linear color gradient for non-log modes
Definition: Plot3DCanvas.h:111
void resizeEvent(QResizeEvent *e) override
OpenGL Canvas for 3D-visualization of map data.
Definition: Plot3DOpenGLCanvas.h:36
Base class for visualization canvas classes.
Definition: PlotCanvas.h:120
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22