gplivemodel/ModelSlider.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of gplivemodel.
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-10-13
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef MODELSLIDER_H
00028 #define MODELSLIDER_H
00029 
00030 #include <QtGui>
00031 
00032 #include <QGpCoreTools.h>
00033 #include <QGpCoreWave.h>
00034 
00035 class ModelSlider : public QWidget, public XMLClass
00036 {
00037   Q_OBJECT
00038 public:
00039   ModelSlider(QWidget * parent=0);
00040   ~ModelSlider();
00041 
00042   virtual const QString& xml_tagName() const {return xmlModelSliderTag;}
00043   static const QString xmlModelSliderTag;
00044 
00045   void setReferenceModel(GeophysicalModel * m);
00046   bool modify(GeophysicalModel * m, double p);
00047 
00048   void setTitle(const QString& t);
00049   QString title() const;
00050 
00051   void setCode(const QString& c);
00052   QString code() const {return _code;}
00053 private slots:
00054   void edit();
00055   void sliderChanged();
00056 signals:
00057   void modelChanged(GeophysicalModel * m);
00058 protected:
00059   virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00060   virtual XMLMember xml_member(XML_MEMBER_ARGS);
00061   virtual bool xml_setProperty(XML_SETPROPERTY_ARGS);
00062 private:
00063   QString _code;
00064   QLabel * _titleWidget;
00065   QSlider * _sliderWidget;
00066 
00067   GeophysicalModel * _referenceModel;
00068   GeophysicalModel::GeophysicalContext * _codeContext;
00069   ExpressionActions _codeActions;
00070 };
00071 
00072 #endif // MODELSLIDER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines