00001 /*************************************************************************** 00002 ** 00003 ** This file is part of dinverdc. 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-31 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (LGIT, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef PARAMPROFILEWIDGET_H 00028 #define PARAMPROFILEWIDGET_H 00029 00030 #include <DinverCore.h> 00031 #include <DinverDCCore.h> 00032 #include "ui_ParamProfileWidget.h" 00033 00034 class ParamLayerWidget; 00035 class ParamGroundModelWidget; 00036 00037 class ParamProfileWidget : public QWidget, public Ui::ParamProfileWidget 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 ParamProfileWidget(ParamGroundModelWidget * parent=0, Qt::WFlags fl=0); 00043 ~ParamProfileWidget(); 00044 00045 ParamLayerWidget * createLayer(); 00046 ParamProfile * paramProfile(); 00047 QList<ParamLayerWidget *> layers(); 00048 QList<ParamLayerWidget *> interfaces(); 00049 00050 int nLayers() const {return _nLayers;} 00051 00052 ParamProfile::Type type() {return _type;} 00053 const QString & shortName() {return _shortName;} 00054 const QString & unit() {return _unit;} 00055 double defaultMinimum() const {return _defaultMinimum;} 00056 double defaultMaximum() const {return _defaultMaximum;} 00057 SimpleCondition::Type defaultCondition() const {return _defaultCondition;} 00058 void setEditable(bool e); 00059 public slots: 00060 void setParam(QString shortName, QString longName, QString unit, double defaultMinimum, double defaultMaximum, 00061 ParamProfile::Type type, SimpleCondition::Type defaultCondition); 00062 ParamLayerWidget * addLayer(); 00063 void deleteLayer(); 00064 void deleteAllLayers(); 00065 void setLayerIndex(); 00066 void moveUp_clicked(); 00067 void moveDown_clicked(); 00068 void unselectAll(); 00069 void setDHLinks(QList<ParamLayerWidget *> layerList); 00070 void setFrom(ParamProfile * p); 00071 void setLinksFrom(ParamProfile * p); 00072 signals: 00073 void sizeChanged(); 00074 void rangeEdited(); 00075 void updateDHLinks(); 00076 protected: 00077 ParamGroundModelWidget * _groundModel; 00078 int _nLayers; 00079 00080 QVBoxLayout * _frameLayout; 00081 double _defaultMinimum, _defaultMaximum; 00082 QString _shortName; 00083 QString _unit; 00084 QString _longName; 00085 SimpleCondition::Type _defaultCondition; 00086 ParamProfile::Type _type; 00087 }; 00088 00089 #endif // QTBPARAMPROFILEWIDGET_H