max2curve/StatGridAnalyser.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of max2curve.
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 : 2005-10-27
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef STATGRIDANALYSER_H
00028 #define STATGRIDANALYSER_H
00029 
00030 #include <SciFigs.h>
00031 #include <QGpCoreTools.h>
00032 
00033 #include "ui_StatGridAnalyser.h"
00034 
00035 class StatGridAnalyser : public QWidget, public Ui::StatGridAnalyser
00036 {
00037   Q_OBJECT
00038 
00039 public:
00040   StatGridAnalyser(QWidget* parent=0, Qt::WFlags fl=0);
00041   ~StatGridAnalyser();
00042 
00043   void setUnits(const QString& u) {_units=u;}
00044   void setGrid(IrregularGrid2DPlot * grid, Axis * valueAxis);
00045 public slots:
00046   void gridChanged();
00047   void on_freqScroll_valueChanged(int);
00048   void on_rejectBut_clicked();
00049   void on_undoBut_clicked();
00050   void on_rejectAllBut_clicked();
00051   void on_undoAllBut_clicked();
00052   void setBand(double min, double max);
00053 private:
00054   enum Shortcuts {NextFrequency, NextFrequencyReject,
00055                    PreviousFrequency, PreviousFrequencyReject,
00056                    IncreaseLowLimit, IncreaseHighLimit,
00057                    DecreaseLowLimit, DecreaseHighLimit};
00058 private slots:
00059   void nextFrequency() {shortcutEvents(NextFrequency);}
00060   void nextFrequencyReject() {shortcutEvents(NextFrequencyReject);}
00061   void previousFrequency() {shortcutEvents(PreviousFrequency);}
00062   void previousFrequencyReject() {shortcutEvents(PreviousFrequencyReject);}
00063   void increaseLowLimit() {shortcutEvents(IncreaseLowLimit);}
00064   void increaseHighLimit() {shortcutEvents(IncreaseHighLimit);}
00065   void decreaseLowLimit() {shortcutEvents(DecreaseLowLimit);}
00066   void decreaseHighLimit() {shortcutEvents(DecreaseHighLimit);}
00067 signals:
00068   void reject(double frequency, double minVel, double maxVel);
00069   void undo(double frequency);
00070   void newMean();
00071   void newMedian();
00072   void newMode();
00073 private:
00074   void setRejectBand(int nextFreq);
00075   virtual void closeEvent(QCloseEvent *e) {e->ignore();}
00076   void shortcutEvents(Shortcuts s);
00077 
00078   IrregularGrid2DPlot * _grid;
00079   Axis * _valueAxis;
00080   QString _units;
00081   int _lastFreq;
00082   QVector< QPair<double, double> > _bands;
00083   ParallelBands * _partitionBandLayer;
00084   LineLayer * _partitionCurveLayer;
00085   ParallelBands * _densityBandLayer;
00086   LineLayer * _densityCurveLayer;
00087 };
00088 
00089 #endif // QTBSTATGRIDANALYSER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines