Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
SpectrumWidget.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-2017.
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: Timo Sachsenberg $
32 // $Authors: Marc Sturm $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_VISUAL_SPECTRUMWIDGET_H
36 #define OPENMS_VISUAL_SPECTRUMWIDGET_H
37 
38 // OpenMS_GUI config
39 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
40 
41 //OpenMS
42 #include <OpenMS/CONCEPT/Types.h>
46 
47 class QGridLayout;
48 class QScrollBar;
49 class QCloseEvent;
50 class QMimeData;
51 
52 namespace OpenMS
53 {
54 
55  class AxisWidget;
56 
74  class OPENMS_GUI_DLLAPI SpectrumWidget :
75  public QWidget,
77  {
78  Q_OBJECT
79 
80 public:
83 
91 
93  SpectrumWidget(const Param & preferences, QWidget * parent = 0);
95  virtual ~SpectrumWidget();
96 
104  {
105  return canvas_;
106  }
107 
109  {
110  return canvas_;
111  }
112 
114  virtual inline AxisWidget * xAxis()
115  {
116  return x_axis_;
117  }
118 
120  virtual inline AxisWidget * yAxis()
121  {
122  return y_axis_;
123  }
124 
126  Int getActionMode() const;
127 
129  virtual bool isLegendShown() const;
130 
132  virtual void showLegend(bool show);
133 
135  void setIntensityMode(SpectrumCanvas::IntensityModes mode);
136 
138  virtual void hideAxes();
139 
141  virtual void saveAsImage();
142 
144  virtual Int getWindowId();
145 
147  virtual void setWindowId(Int window_id);
148 signals:
150  void sendStatusMessage(std::string, OpenMS::UInt);
152  void sendCursorStatus(double mz = -1.0, double rt = -1.0);
154  void aboutToBeDestroyed(int window_id);
156  void openPreferences();
158  void dropReceived(const QMimeData * data, QWidget * source, int id);
159 
160 public slots:
162  void showStatistics();
164  void showIntensityDistribution();
166  void showMetaDistribution(const String & name);
168  void updateAxes();
177  void updateHScrollbar(float min, float disp_min, float disp_max, float max);
186  void updateVScrollbar(float min, float disp_min, float disp_max, float max);
188  virtual void showGoToDialog() = 0;
190  void changeLegendVisibility();
191 
192 protected:
194 
195  void closeEvent(QCloseEvent * e);
197 
204  void setCanvas_(SpectrumCanvas * canvas, UInt row = 0, UInt col = 2);
206  virtual void intensityModeChange_();
208  virtual Math::Histogram<> createIntensityDistribution_() const = 0;
210  virtual Math::Histogram<> createMetaDistribution_(const String & name) const = 0;
212  virtual void recalculateAxes_() = 0;
214  void correctAreaToObeyMinMaxRanges_(SpectrumCanvas::AreaType& area);
215 
217 
218  void dragEnterEvent(QDragEnterEvent * event);
219  void dragMoveEvent(QDragMoveEvent * event);
220  void dropEvent(QDropEvent * event);
222 
226  QGridLayout * grid_;
232  QScrollBar * x_scrollbar_;
234  QScrollBar * y_scrollbar_;
235 
237  };
238 }
239 
240 #endif
SpectrumCanvas * canvas()
Returns a pointer to canvas object.
Definition: SpectrumWidget.h:103
A more convenient string class.
Definition: String.h:57
Widget that represents an axis of a graph.
Definition: AxisWidget.h:64
virtual AxisWidget * yAxis()
Returns a pointer to the y-axis axis widget.
Definition: SpectrumWidget.h:120
A container for features.
Definition: FeatureMap.h:94
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
Base class for visualization canvas classes.
Definition: SpectrumCanvas.h:96
QGridLayout * grid_
Main layout.
Definition: SpectrumWidget.h:226
virtual AxisWidget * xAxis()
Returns a pointer to the x-axis axis widget.
Definition: SpectrumWidget.h:114
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
SpectrumCanvas * canvas() const
Definition: SpectrumWidget.h:108
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
AxisWidget * x_axis_
Horizontal axis.
Definition: SpectrumWidget.h:230
QScrollBar * y_scrollbar_
Vertical scrollbar.
Definition: SpectrumWidget.h:234
Base class for spectrum widgets.
Definition: SpectrumWidget.h:74
Representation of a histogram.
Definition: Histogram.h:64
LayerData::ExperimentType ExperimentType
Main data type (experiment)
Definition: SpectrumWidget.h:85
Int window_id_
Definition: SpectrumWidget.h:236
ExperimentType::SpectrumType SpectrumType
Spectrum type.
Definition: SpectrumWidget.h:89
LayerData::FeatureMapType FeatureMapType
Main data type (features)
Definition: SpectrumWidget.h:87
SpectrumCanvas * canvas_
Pointer to the canvas widget.
Definition: SpectrumWidget.h:224
Management and storage of parameters / INI files.
Definition: Param.h:75
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:82
Widgets that are placed into an EnhancedTabBar must implement this interface.
Definition: EnhancedTabBarWidgetInterface.h:52
AxisWidget * y_axis_
Vertical axis.
Definition: SpectrumWidget.h:228
IntensityModes
Display modes of intensity.
Definition: SpectrumCanvas.h:143
int Int
Signed integer type.
Definition: Types.h:103
QScrollBar * x_scrollbar_
Horizontal scrollbar.
Definition: SpectrumWidget.h:232

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:04 using doxygen 1.8.13