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-2013.
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
39 #include <OpenMS/CONCEPT/Types.h>
43 
44 class QGridLayout;
45 class QScrollBar;
46 class QCloseEvent;
47 class QMimeData;
48 
49 namespace OpenMS
50 {
51 
52  class AxisWidget;
53 
71  class OPENMS_GUI_DLLAPI SpectrumWidget :
72  public QWidget,
74  {
75  Q_OBJECT
76 
77 public:
80 
88 
90  SpectrumWidget(const Param & preferences, QWidget * parent = 0);
92  virtual ~SpectrumWidget();
93 
101  {
102  return canvas_;
103  }
104 
106  {
107  return canvas_;
108  }
109 
111  virtual inline AxisWidget * xAxis()
112  {
113  return x_axis_;
114  }
115 
117  virtual inline AxisWidget * yAxis()
118  {
119  return y_axis_;
120  }
121 
123  Int getActionMode() const;
124 
126  virtual bool isLegendShown() const;
127 
129  virtual void showLegend(bool show);
130 
132  void setIntensityMode(SpectrumCanvas::IntensityModes mode);
133 
135  virtual void hideAxes();
136 
138  virtual void saveAsImage();
139 
141  virtual Int getWindowId();
142 
144  virtual void setWindowId(Int window_id);
145 signals:
147  void sendStatusMessage(std::string, OpenMS::UInt);
149  void sendCursorStatus(double mz = -1.0, double rt = -1.0);
151  void aboutToBeDestroyed(int window_id);
153  void openPreferences();
155  void dropReceived(const QMimeData * data, QWidget * source, int id);
156 
157 public slots:
159  void showStatistics();
161  void showIntensityDistribution();
163  void showMetaDistribution(const String & name);
165  void updateAxes();
174  void updateHScrollbar(float min, float disp_min, float disp_max, float max);
183  void updateVScrollbar(float min, float disp_min, float disp_max, float max);
185  virtual void showGoToDialog() = 0;
187  void changeLegendVisibility();
188 
189 protected:
191 
192  void closeEvent(QCloseEvent * e);
194 
201  void setCanvas_(SpectrumCanvas * canvas, UInt row = 0, UInt col = 2);
203  virtual void intensityModeChange_();
205  virtual Math::Histogram<> createIntensityDistribution_() const = 0;
207  virtual Math::Histogram<> createMetaDistribution_(const String & name) const = 0;
209  virtual void recalculateAxes_() = 0;
210 
212 
213  void dragEnterEvent(QDragEnterEvent * event);
214  void dragMoveEvent(QDragMoveEvent * event);
215  void dropEvent(QDropEvent * event);
217 
221  QGridLayout * grid_;
227  QScrollBar * x_scrollbar_;
229  QScrollBar * y_scrollbar_;
230 
232  };
233 }
234 
235 #endif
SpectrumCanvas * canvas() const
Definition: SpectrumWidget.h:105
SpectrumCanvas * canvas()
Returns a pointer to canvas object.
Definition: SpectrumWidget.h:100
A more convenient string class.
Definition: String.h:56
Widget that represents an axis of a graph.
Definition: AxisWidget.h:61
virtual AxisWidget * yAxis()
Returns a pointer to the y-axis axis widget.
Definition: SpectrumWidget.h:117
A container for features.
Definition: FeatureMap.h:111
Base class for visualization canvas classes.
Definition: SpectrumCanvas.h:94
QGridLayout * grid_
Main layout.
Definition: SpectrumWidget.h:221
virtual AxisWidget * xAxis()
Returns a pointer to the x-axis axis widget.
Definition: SpectrumWidget.h:111
AxisWidget * x_axis_
Horizontal axis.
Definition: SpectrumWidget.h:225
QScrollBar * y_scrollbar_
Vertical scrollbar.
Definition: SpectrumWidget.h:229
Base class for spectrum widgets.
Definition: SpectrumWidget.h:71
Representation of a histogram.
Definition: Histogram.h:64
LayerData::ExperimentType ExperimentType
Main data type (experiment)
Definition: SpectrumWidget.h:82
Int window_id_
Definition: SpectrumWidget.h:231
ExperimentType::SpectrumType SpectrumType
Spectrum type.
Definition: SpectrumWidget.h:86
LayerData::FeatureMapType FeatureMapType
Main data type (features)
Definition: SpectrumWidget.h:84
SpectrumCanvas * canvas_
Pointer to the canvas widget.
Definition: SpectrumWidget.h:219
Management and storage of parameters / INI files.
Definition: Param.h:69
Representation of a mass spectrometry experiment.
Definition: MSExperiment.h:68
Widgets that are placed into an EnhancedTabBar must implement this interface.
Definition: EnhancedTabBarWidgetInterface.h:47
AxisWidget * y_axis_
Vertical axis.
Definition: SpectrumWidget.h:223
IntensityModes
Display modes of intensity.
Definition: SpectrumCanvas.h:141
int Int
Signed integer type.
Definition: Types.h:100
QScrollBar * x_scrollbar_
Horizontal scrollbar.
Definition: SpectrumWidget.h:227

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:21 using doxygen 1.8.5