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

SpectrumWidget.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Timo Sachsenberg $
00032 // $Authors: Marc Sturm $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_VISUAL_SPECTRUMWIDGET_H
00036 #define OPENMS_VISUAL_SPECTRUMWIDGET_H
00037 
00038 //OpenMS
00039 #include <OpenMS/CONCEPT/Types.h>
00040 #include <OpenMS/MATH/STATISTICS/Histogram.h>
00041 #include <OpenMS/VISUAL/SpectrumCanvas.h>
00042 #include <OpenMS/VISUAL/EnhancedTabBarWidgetInterface.h>
00043 
00044 class QGridLayout;
00045 class QScrollBar;
00046 class QCloseEvent;
00047 class QMimeData;
00048 
00049 namespace OpenMS
00050 {
00051 
00052   class AxisWidget;
00053 
00071   class OPENMS_GUI_DLLAPI SpectrumWidget :
00072     public QWidget,
00073     public EnhancedTabBarWidgetInterface
00074   {
00075     Q_OBJECT
00076 
00077 public:
00080 
00082     typedef LayerData::ExperimentType ExperimentType;
00084     typedef LayerData::FeatureMapType FeatureMapType;
00086     typedef ExperimentType::SpectrumType SpectrumType;
00088 
00090     SpectrumWidget(const Param & preferences, QWidget * parent = 0);
00092     virtual ~SpectrumWidget();
00093 
00100     SpectrumCanvas * canvas()
00101     {
00102       return canvas_;
00103     }
00104 
00105     SpectrumCanvas * canvas() const
00106     {
00107       return canvas_;
00108     }
00109 
00111     virtual inline AxisWidget * xAxis()
00112     {
00113       return x_axis_;
00114     }
00115 
00117     virtual inline AxisWidget * yAxis()
00118     {
00119       return y_axis_;
00120     }
00121 
00123     Int getActionMode() const;
00124 
00126     virtual bool isLegendShown() const;
00127 
00129     virtual void showLegend(bool show);
00130 
00132     void setIntensityMode(SpectrumCanvas::IntensityModes mode);
00133 
00135     virtual void hideAxes();
00136 
00138     virtual void saveAsImage();
00139 
00141     virtual Int getWindowId();
00142 
00144     virtual void setWindowId(Int window_id);
00145 signals:
00147     void sendStatusMessage(std::string, OpenMS::UInt);
00149     void sendCursorStatus(double mz = -1.0, double rt = -1.0);
00151     void aboutToBeDestroyed(int window_id);
00153     void openPreferences();
00155     void dropReceived(const QMimeData * data, QWidget * source, int id);
00156 
00157 public slots:
00159     void showStatistics();
00161     void showIntensityDistribution();
00163     void showMetaDistribution(const String & name);
00165     void updateAxes();
00174     void updateHScrollbar(float min, float disp_min, float disp_max, float max);
00183     void updateVScrollbar(float min, float disp_min, float disp_max, float max);
00185     virtual void showGoToDialog() = 0;
00187     void changeLegendVisibility();
00188 
00189 protected:
00191 
00192     void closeEvent(QCloseEvent * e);
00194 
00201     void setCanvas_(SpectrumCanvas * canvas, UInt row = 0, UInt col = 2);
00203     virtual void intensityModeChange_();
00205     virtual Math::Histogram<> createIntensityDistribution_() const = 0;
00207     virtual Math::Histogram<> createMetaDistribution_(const String & name) const = 0;
00209     virtual void recalculateAxes_() = 0;
00210 
00212 
00213     void dragEnterEvent(QDragEnterEvent * event);
00214     void dragMoveEvent(QDragMoveEvent * event);
00215     void dropEvent(QDropEvent * event);
00217 
00219     SpectrumCanvas * canvas_;
00221     QGridLayout * grid_;
00223     AxisWidget * y_axis_;
00225     AxisWidget * x_axis_;
00227     QScrollBar * x_scrollbar_;
00229     QScrollBar * y_scrollbar_;
00230 
00231     Int window_id_;
00232   };
00233 }
00234 
00235 #endif

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:45 using doxygen 1.7.1