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-26 00022 ** Authors : 00023 ** Marc Wathelet 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef DISPERSIONFACTORY_H 00029 #define DISPERSIONFACTORY_H 00030 00031 #include "ModalFactory.h" 00032 #include "Dispersion.h" 00033 #include "QGpCoreWaveDLLExport.h" 00034 00035 namespace QGpCoreWave { 00036 00037 class EllipticityFactory; 00038 class AutocorrFactory; 00039 00040 class QGPCOREWAVE_EXPORT DispersionFactory : public ModalFactory 00041 { 00042 public: 00043 DispersionFactory(); 00044 ~DispersionFactory(); 00045 00046 Dispersion * phaseRayleigh() const {return _phaseRayleigh;} 00047 Dispersion * groupRayleigh() const {return _groupRayleigh;} 00048 Dispersion * phaseLove() const {return _phaseLove;} 00049 Dispersion * groupLove() const {return _groupLove;} 00050 00051 void validate(EllipticityFactory * ellFactory, AutocorrFactory * autocorr); 00052 bool calculate(const Seismic1DModel * model, EllipticityFactory * ellFactory); 00053 00054 virtual void setMode (const Mode& m); 00055 virtual const RealValue * mode(const Mode& m) const; 00056 virtual int storageCount() const {return 4;} 00057 inline virtual ModalStorage * storage(int storageIndex) const; 00058 protected: 00059 virtual ModalStorage * newStorage(int nModes) {return new Dispersion(nModes, x());} 00060 private: 00061 Dispersion * _phaseRayleigh; 00062 Dispersion * _groupRayleigh; 00063 Dispersion * _phaseLove; 00064 Dispersion * _groupLove; 00065 }; 00066 00067 inline ModalStorage * DispersionFactory::storage(int storageIndex) const 00068 { 00069 TRACE; 00070 switch (storageIndex) { 00071 case 1: 00072 return _groupRayleigh; 00073 case 2: 00074 return _phaseLove; 00075 case 3: 00076 return _groupLove; 00077 default: 00078 return _phaseRayleigh; 00079 } 00080 } 00081 00082 } // namespace QGpCoreWave 00083 00084 #endif // DISPERSIONFACTORY_H