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 : 2006-01-13 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (LGIT, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef FKHISTOGRAMWIDGET_H 00028 #define FKHISTOGRAMWIDGET_H 00029 00030 #include <QGpCoreTools.h> 00031 #include <SciFigs.h> 00032 00033 #include "ui_HistogramWidget.h" 00034 #include "StatGridAnalyser.h" 00035 #include "MaxEntryList.h" 00036 00037 class HistogramWidget : public QWidget, public Ui::HistogramWidget 00038 { 00039 Q_OBJECT 00040 public: 00041 HistogramWidget(MaxEntryList * maxList, QWidget * parent=0); 00042 ~HistogramWidget(); 00043 00044 bool loadMax(QString fileName); 00045 bool select(bool scaleTypeForced, SamplingOption scaleType); 00046 void initGrid(int nValueClasses, double minValueHisto, double maxValueHisto, SamplingOption ySampling); 00047 void fillGrid(); 00048 MaxEntryList * maxEntryList() {return _maxList;} 00049 void toStream(QTextStream& s, int curveIndex); 00050 public slots: 00051 void show(); 00052 void addMeanCurve(); 00053 void addMedianCurve(); 00054 void addModeCurve(); 00055 private slots: 00056 void on_gridFilter_clicked(); 00057 void on_gridSmooth_clicked(); 00058 void on_closeButton_clicked(); 00059 void on_saveButton_clicked(); 00060 void unselectValue(double frequency, double minValue, double maxValue); 00061 void selectAll(double frequency); 00062 void adjustCurve(); 00063 protected: 00064 virtual void closeEvent(QCloseEvent *e); 00065 private: 00066 AxisWindow * graph(); 00067 bool isLogScale(); 00068 void addCurve(const Curve<RealStatisticalPoint>& c); 00069 void setLimits(); 00070 void normalizeGrid(IrregularGrid2D& grid); 00071 00072 MaxEntryList * _maxList; 00073 StatGridAnalyser * _statWidget; 00074 IrregularGrid2DPlot * _gridLayer; 00075 CurveBrowser * _curves; 00076 }; 00077 00078 #endif // FKHISTOGRAMWIDGET_H