gphistogram/HistogramWidget.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of gphistogram.
00004 **
00005 **  This file may be distributed and/or modified under the terms of the
00006 **  GNU General Public License version 2 or 3 as published by the Free
00007 **  Software Foundation and appearing in the file LICENSE.GPL included
00008 **  in the packaging of this file.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00013 **  more details.
00014 **
00015 **  You should have received a copy of the GNU General Public License
00016 **  along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 **
00018 **  See http://www.geopsy.org for more information.
00019 **
00020 **  Created : 2008-12-18
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef HISTOGRAMWIDGET_H
00028 #define HISTOGRAMWIDGET_H
00029 
00030 #include <SciFigs.h>
00031 
00032 #include "ui_HistogramWidget.h"
00033 
00034 class Histogram2D;
00035 
00036 class HistogramWidget : public QWidget, private Ui::HistogramWidget
00037 {
00038   Q_OBJECT
00039 public:
00040   HistogramWidget(QWidget * parent=0);
00041   ~HistogramWidget();
00042 
00043   void setHistogram(Histogram2D * hist);
00044 private slots:
00045   void on_xScroll_valueChanged();
00046   void setBand(double min, double max);
00047   void nextX() {shortcutEvents(NextX);}
00048   void nextXReject() {shortcutEvents(NextXReject);}
00049   void previousX() {shortcutEvents(PreviousX);}
00050   void previousXReject() {shortcutEvents(PreviousXReject);}
00051   void increaseLowLimit() {shortcutEvents(IncreaseLowLimit);}
00052   void increaseHighLimit() {shortcutEvents(IncreaseHighLimit);}
00053   void decreaseLowLimit() {shortcutEvents(DecreaseLowLimit);}
00054   void decreaseHighLimit() {shortcutEvents(DecreaseHighLimit);}
00055   void on_rejectBut_clicked();
00056   void on_undoBut_clicked();
00057   void on_rejectAllBut_clicked();
00058   void on_undoAllBut_clicked();
00059   void adjustCurve();
00060   void addMeanCurve();
00061   void addMedianCurve();
00062   void addModeCurve();
00063 protected:
00064   void closeEvent(QCloseEvent * e);
00065 private:
00066   enum Shortcuts {NextX, NextXReject,
00067                    PreviousX, PreviousXReject,
00068                    IncreaseLowLimit, IncreaseHighLimit,
00069                    DecreaseLowLimit, DecreaseHighLimit};
00070   void shortcutEvents(Shortcuts s);
00071   void saveBand(int ix, double min, double max);
00072   Point2D restoreBand(int ix);
00073   void addCurve(const Curve<RealStatisticalPoint>& c);
00074 
00075   QString _xUnit, _yUnit;
00076 
00077   Histogram2D * _hist;
00078   IrregularGrid2DPlot * _histogramLayer;
00079 
00080   ParallelBands * _densityBandLayer;
00081   LineLayer * _densityCurveLayer;
00082   ParallelBands * _cumulativeBandLayer;
00083   LineLayer * _cumulativeCurveLayer;
00084   int _lastX;
00085 };
00086 
00087 #endif // HISTOGRAMWIDGET_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines