Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

SpectrumWidget.h (Maintainer: Marc Sturm)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework 
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Marc Sturm $
00025 // --------------------------------------------------------------------------
00026 
00027 #ifndef OPENMS_VISUAL_SPECTRUMWIDGET_H
00028 #define OPENMS_VISUAL_SPECTRUMWIDGET_H
00029 
00030 //OpenMS
00031 #include <OpenMS/CONCEPT/Types.h>
00032 #include <OpenMS/MATH/STATISTICS/Histogram.h>
00033 #include <OpenMS/VISUAL/SpectrumCanvas.h>
00034 
00035 class QGridLayout;
00036 class QScrollBar;
00037 
00038 namespace OpenMS
00039 {
00040 
00041   class AxisWidget;
00042   
00060   class SpectrumWidget 
00061     : public QWidget
00062   {
00063     Q_OBJECT
00064 
00065     public:
00067       SpectrumWidget(const Param& preferences, QWidget* parent = 0);
00069       ~SpectrumWidget();
00070       
00077       SpectrumCanvas* canvas()
00078       { 
00079         return canvas_; 
00080       }
00081       
00083       inline AxisWidget* xAxis() 
00084       { 
00085         return x_axis_; 
00086       }
00087       
00089       inline AxisWidget* yAxis() 
00090       { 
00091         return y_axis_; 
00092       }
00093       
00095       Int getActionMode() const;
00096   
00098       void setActionMode(SpectrumCanvas::ActionModes mode);
00099       
00101       virtual bool isLegendShown() const;
00102   
00104       virtual void showLegend(bool show);
00105   
00107       void setIntensityMode(SpectrumCanvas::IntensityModes mode);
00108   
00110       void hideAxes();
00111       
00113       Int window_id;
00114       
00115     signals:
00117       void modesChanged(QWidget*);
00119       void sendStatusMessage(std::string, OpenMS::UInt);
00121       void sendCursorStatus(double mz=-1.0, double intens=-1.0, double rt=-1.0);
00123       void aboutToBeDestroyed(int window_id);
00125       void openPreferences();
00126         
00127     public slots:
00129       void showStatistics();
00131       void showIntensityDistribution();
00133       void updateAxes();
00142       void updateHScrollbar(float min, float disp_min, float disp_max, float max);
00151       void updateVScrollbar(float min, float disp_min, float disp_max, float max);
00153       virtual void showGoToDialog() = 0;
00155       void changeLegendVisibility();
00156       
00157     protected:
00164       void setCanvas_(SpectrumCanvas* canvas, UInt row=0, UInt col=2);
00166       virtual void intensityModeChange_();
00168       virtual Math::Histogram<UInt,float> createIntensityDistribution_() = 0;
00170       virtual void recalculateAxes_() = 0;
00171       
00173       SpectrumCanvas* canvas_;
00175       QGridLayout* grid_;
00177       AxisWidget* y_axis_;
00179       AxisWidget* x_axis_;
00181       QScrollBar* x_scrollbar_;
00183       QScrollBar* y_scrollbar_;
00184   };
00185 }
00186 
00187 #endif

Generated Tue Apr 1 15:36:38 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1