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 : 2006-09-22 00022 ** Authors : 00023 ** Marc Wathelet 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef MODALCURVE_H 00029 #define MODALCURVE_H 00030 00031 #include <QGpCoreTools.h> 00032 #include "Mode.h" 00033 #include "FactoryPoint.h" 00034 #include "QGpCoreWaveDLLExport.h" 00035 00036 namespace QGpCoreWave { 00037 00038 class ModalFactory; 00039 class Seismic1DModel; 00040 00041 class QGPCOREWAVE_EXPORT ModalCurve : public Curve<FactoryPoint>, public XMLClass 00042 { 00043 TRANSLATIONS("ModalCurve"); 00044 public: 00045 ModalCurve() {} 00046 inline ModalCurve(const ModalCurve& o); 00047 ModalCurve(int n) : Curve<FactoryPoint>(n) {} 00048 inline ModalCurve(const Curve<RealStatisticalPoint>& o); 00049 virtual ~ModalCurve(); 00050 00051 inline bool operator==(const ModalCurve& o) const; 00052 void operator=(const Curve<RealStatisticalPoint>& o); 00053 00054 virtual const QString& xml_tagName() const {return xmlModalCurveTag;} 00055 static const QString xmlModalCurveTag; 00056 00057 void clear(); 00058 void sort() {setFunction();} 00059 00060 void addMode(const Mode& m); 00061 void removeMode(int index); 00062 void linkX(const QVector<double>& x); 00063 const QList<Mode>& modes() const {return _modes;} 00064 QList<Mode>& modes() {return _modes;} 00065 bool hasMode(const Mode& m) const; 00066 int indexOf(int factoryIndex) const; 00067 00068 void setName(QString n) {_name=n;} 00069 QString name() const {return _name;} 00070 00071 void addLog(QString s) {_log+=s;} 00072 QString log() const {return _log;} 00073 00074 double misfit(int& nValues, int& nData, const ModalFactory& f, MisfitType type, double minMisfit) const; 00075 double determinantMisfit(const Seismic1DModel * m) const; 00076 protected: 00077 void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const; 00078 void xml_writeChildren(XML_WRITECHILDREN_ARGS) const; 00079 XMLMember xml_member(XML_MEMBER_ARGS); 00080 bool xml_setProperty(XML_SETPROPERTY_ARGS); 00081 private: 00082 QString _name; 00083 QList<Mode> _modes; 00084 QString _log; 00085 }; 00086 00087 inline ModalCurve::ModalCurve(const ModalCurve& o) : Curve<FactoryPoint>(o), XMLClass() 00088 { 00089 TRACE; 00090 _name=o._name; 00091 _modes=o._modes; 00092 _log=o._log; 00093 } 00094 00095 inline ModalCurve::ModalCurve(const Curve<RealStatisticalPoint>& o) : Curve<FactoryPoint>(), XMLClass() 00096 { 00097 TRACE; 00098 *this=o; 00099 } 00100 00101 inline bool ModalCurve::operator==(const ModalCurve& o) const 00102 { 00103 return _name==o._name && 00104 _modes==o._modes && 00105 _log==o._log && 00106 Curve<FactoryPoint>::operator==(o); 00107 } 00108 00109 } // namespace QGpCoreWave 00110 00111 #endif // MODALCURVE_H