SciFigs/CurveBrowser.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of SciFigs.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2008-10-31
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef CURVEBROWSER_H
00029 #define CURVEBROWSER_H
00030 
00031 #include <QGpGuiTools.h>
00032 
00033 #include "ui_CurveBrowser.h"
00034 #include "SciFigsDLLExport.h"
00035 
00036 namespace SciFigs {
00037 
00038 class LineLayer;
00039 class CurveBrowserProxy;
00040 class CurveProperties;
00041 class AxisWindow;
00042 class AbstractLine;
00043 class LegendProperties;
00044 
00045 class SCIFIGS_EXPORT CurveBrowser : public QWidget, protected Ui::CurveBrowser
00046 {
00047   Q_OBJECT
00048 public:
00049   CurveBrowser(QWidget * parent=0);
00050   ~CurveBrowser();
00051 
00052   void setProxy(CurveBrowserProxy * proxy);
00053   CurveBrowserProxy * proxy() {return _proxy;}
00054   QList<CurveProperties *> curves() const;
00055   void dock(QWidget * w);
00056 
00057   QAction * addCurveAction(QString title, QString toolTip, bool editCurve);
00058   virtual void setEditable(bool e);
00059 
00060   void initLayer(LineLayer * curveLayer);
00061   void setCurrentLayer(LineLayer * curveLayer);
00062   LineLayer * currentLayer() const {return _currentLayer;}
00063   CurveProperties * addLine(AbstractLine * line);
00064 
00065   int count() const;
00066   int currentLine() const;
00067   void loadMultiColumns(QString fileName, bool lastFile, ColumnTextParser *& parser);
00068 public slots:
00069   virtual void load();
00070   void clear();
00071   void legend();
00072   void average();
00073   virtual void setLimits();
00074   void setCurveName(QString n);
00075   void showLog();
00076   void save();
00077   void remove();
00078   void resample();
00079   void cut();
00080   void smooth();
00081 private slots:
00082   void on_loadBut_clicked() {load();}
00083   void on_legendBut_clicked() {legend();}
00084   void on_clearBut_clicked();
00085   void newPickedLine(AbstractLine * line);
00086   void newPickedPoint(AbstractLine *, int);
00087   void commitLegend();
00088 signals:
00089   void curveModified();
00090 protected:
00091   static void curveRange(const QList<CurveProperties *> &list, double& min, double& max);
00092   QList<CurveProperties *> selectCurves();
00093   void closeEvent(QCloseEvent * e);
00094   virtual void loadMultiColumns(const ColumnTextParser * parser, QString fileName);
00095   void removeLine(int index);
00096 private:
00097   LineLayer * _currentLayer;
00098   int _currentCurve;
00099   CurveBrowserProxy * _proxy;
00100   LegendProperties * _legendEditor;
00101   bool _editable;
00102 };
00103 
00104 } // namespace SciFigs
00105 
00106 #endif // CURVEBROWSER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines