00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2002-2009 Marc Wathelet. All rights reserved. 00004 ** 00005 ** This file is part of build_array. 00006 ** 00007 ** This file may be distributed and/or modified under the terms of the 00008 ** GNU General Public License version 2 or 3 as published by the Free 00009 ** Software Foundation and appearing in the file LICENSE.GPL included 00010 ** in the packaging of this file. 00011 ** 00012 ** This file is distributed in the hope that it will be useful, but WITHOUT 00013 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00015 ** more details. 00016 ** 00017 ** See http://www.geopsy.org for more information. 00018 ** 00019 ** Created: 2006-03-27 00020 ** Authors: 00021 ** Marc Wathelet (LGIT, Grenoble, France) 00022 ** 00023 ***************************************************************************/ 00024 00025 #ifndef RESPONSESIMULATOR_H 00026 #define RESPONSESIMULATOR_H 00027 00028 #include <SciFigs.h> 00029 #include <ArrayCore.h> 00030 00031 #include "SourceParameters.h" 00032 #include "MediumParameters.h" 00033 #include "ui_Simulator.h" 00034 00035 class FKArrayMap; 00036 00037 class Simulator : public QWidget, public Ui::Simulator 00038 { 00039 Q_OBJECT 00040 public: 00041 Simulator(QWidget * parent=0, Qt::WFlags fl=0); 00042 ~Simulator(); 00043 00044 void init(const QVector<Point2D>& array); 00045 void setKmax(double kmax); 00046 protected slots: 00047 void setWaveModel(); 00048 void on_frequencyEdit_valueChanged(double f); 00049 void on_attenuationEdit_valueChanged(double q); 00050 void on_attenuationButton_toggled(bool checked); 00051 void on_gridSizeEdit_valueChanged(double k); 00052 void on_addSource_clicked(); 00053 void on_removeSource_clicked(); 00054 void setSource(QModelIndex topLeft,QModelIndex bottomRight); 00055 void setAllSources(); 00056 void displaySource(int index); 00057 void setKmax(); 00058 private: 00059 void setSource(int iSrc); 00060 void updateMap(); 00061 virtual void resizeEvent(QResizeEvent *); 00062 00063 QList<SourceParameters> _sources; 00064 MediumParameters _medium; 00065 00066 FKArrayMap * _fkmap; 00067 00068 LiveGridLayer * _gridLayer; 00069 CircleViewer * _velocityLayer; 00070 LineLayer * _azimuthLayer; 00071 CircleMask * _kLayer; 00072 00073 QTimer _kmaxTimer; 00074 KmaxSolver * _kmaxSolver; 00075 }; 00076 00077 #endif // RESPONSESIMULATOR_H