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-20 00022 ** Authors : 00023 ** Marc Wathelet 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef REFRACTIONFACTORY_H 00029 #define REFRACTIONFACTORY_H 00030 00031 #include <QGpCoreTools.h> 00032 #include "QGpCoreWaveDLLExport.h" 00033 00034 namespace QGpCoreWave { 00035 00036 class RefractionDippingModel; 00037 class RefractionCurve; 00038 00039 class QGPCOREWAVE_EXPORT RefractionFactory 00040 { 00041 TRANSLATIONS("RefractionFactory"); 00042 public: 00043 RefractionFactory(); 00044 ~RefractionFactory(); 00045 00046 int sourceCount() const {return _sources.count();} 00047 int receiverCount() const {return _receivers.count();} 00048 const QVector<double>& sources() const {return _sources;} 00049 const QVector<double>& receivers() const {return _receivers;} 00050 const RealValue * source(int index) const {return _travelTimes + index * _receivers.count();} 00051 00052 void setX(const QList<RefractionCurve>& curves); 00053 void linkX(QList<RefractionCurve>& curves) const; 00054 double xLeft() const {return _receivers.first();} 00055 double xRight() const {return _receivers.last();} 00056 00057 bool calculate(RefractionDippingModel * model); 00058 00059 void writeReport(QDataStream& s) const; 00060 void readReport(QDataStream& s); 00061 void toStream(int sourceIndex, QTextStream& sOut) const; 00062 private: 00063 QVector<double> _sources; 00064 QVector<double> _receivers; 00065 RealValue * _travelTimes; 00066 }; 00067 00068 inline uint qHash(const double& key) 00069 { 00070 return qHash(static_cast<const quint64&>(key) ); 00071 } 00072 00073 } // namespace QGpCoreWave 00074 00075 #endif // REFRACTIONFACTORY_H