QGpCoreWave/RefractionCurve.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpCoreWave.
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-11-02
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef REFRACTIONCURVE_H
00029 #define REFRACTIONCURVE_H
00030 
00031 #include <QGpCoreTools.h>
00032 #include "QGpCoreWaveDLLExport.h"
00033 #include "FactoryPoint.h"
00034 
00035 namespace QGpCoreWave {
00036 
00037 class RefractionFactory;
00038 
00039 class QGPCOREWAVE_EXPORT RefractionCurve : public Curve<FactoryPoint>, public XMLClass
00040 {
00041 public:
00042   RefractionCurve() {_source=0.0;}
00043   inline RefractionCurve(const RefractionCurve& o);
00044   RefractionCurve(int n) : Curve<FactoryPoint>(n) {_source=0.0;}
00045   virtual ~RefractionCurve() {}
00046 
00047   inline bool operator==(const RefractionCurve& o) const;
00048 
00049   virtual const QString& xml_tagName() const {return xmlRefractionCurveTag;}
00050   static const QString xmlRefractionCurveTag;
00051 
00052   void clear();
00053   void sort() {setFunction();}
00054 
00055   void setName(QString n) {_name=n;}
00056   QString name() const {return _name;}
00057 
00058   void addLog(QString s) {_log+=s;}
00059   QString log() const {return _log;}
00060 
00061   void setSource(double s) {_source=s;}
00062   double source() const {return _source;}
00063 
00064   void linkSource(const QVector<double>& xSrc);
00065   void linkReceivers(const QVector<double>& xRec);
00066 
00067   double misfit(int& nValues, int& nData, const RefractionFactory& f, MisfitType type, double minMisfit) const;
00068 protected:
00069   void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00070   void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00071   XMLMember xml_member(XML_MEMBER_ARGS);
00072   bool xml_setProperty(XML_SETPROPERTY_ARGS);
00073 private:
00074   QString _name;
00075   QString _log;
00076   double _source;
00077   int _sourceIndex;
00078 };
00079 
00080 inline RefractionCurve::RefractionCurve(const RefractionCurve& o) : Curve<FactoryPoint>(o), XMLClass()
00081 {
00082   TRACE;
00083   _name=o._name;
00084   _log=o._log;
00085   _source=o._source;
00086 }
00087 
00088 inline bool RefractionCurve::operator==(const RefractionCurve& o) const
00089 {
00090   return _name==o._name &&
00091          _log==o._log &&
00092          _source==o._source &&
00093          Curve<FactoryPoint>::operator==(o);
00094 }
00095 
00096 } // namespace QGpCoreWave
00097 
00098 #endif // REFRACTIONCURVE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines