max2curve/MaxEntryList.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of max2curve.
00004 **
00005 **  This file may be distributed and/or modified under the terms of the
00006 **  GNU General Public License version 2 or 3 as published by the Free
00007 **  Software Foundation and appearing in the file LICENSE.GPL included
00008 **  in the packaging of this file.
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 General Public License for
00013 **  more details.
00014 **
00015 **  You should have received a copy of the GNU General Public License
00016 **  along with this program. If not, see <http://www.gnu.org/licenses/>.
00017 **
00018 **  See http://www.geopsy.org for more information.
00019 **
00020 **  Created : 2007-05-29
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef MAXENTRYLIST_H
00028 #define MAXENTRYLIST_H
00029 
00030 #include <QGpCoreTools.h>
00031 
00032 #include "MaxEntry.h"
00033 
00034 class MaxEntryList : public QList<MaxEntry *>
00035 {
00036   TRANSLATIONS("MaxEntryList")
00037 public:
00038   MaxEntryList() {_type=Undefined;}
00039   ~MaxEntryList();
00040 
00041   enum Type {Undefined, FK, SPAC, TFA, CURVE};
00042 
00043   Type type() const {return _type;}
00044   void setType(Type t) {_type=t;}
00045 
00046   bool load(QString fileName);
00047   bool save(QString fileName);
00048   void toStream(QTextStream& s);
00049 
00050   RealStatisticalValue meanValue(double x, SamplingOption ySampling) const;
00051   int count(double x) const;
00052   int count( ) const {return QList<MaxEntry *>::count();}
00053 
00054   void unselectValue(double x, double minSlowness, double maxSlowness);
00055   void selectAll(double x);
00056   void selectAll();
00057 
00058   void rejectValue(double minValue, double maxValue);
00059 
00060   IrregularGrid2D initGrid(int nValues, double minValue, double maxValue, SamplingOption ySampling);
00061   void fillGrid(IrregularGrid2D& grid);
00062 
00063   void rejectPower(double relativeFactor, double absoluteFactor);
00064   void unselectPower(double relativeFactor, double absoluteFactor);
00065   void unselectWavenumber(double minWavenumber, double maxWavenumber);
00066   void keepRing(int ringIndex);
00067   void keepComponent(int componentIndex);
00068   void rejectAmplitudeVerticalFactor(double factor);
00069   void rejectAmplitudeVerticalAbsolute(double ampZ);
00070   void rejectAmplitudeHorizontalAbsolute(double ampH);
00071   void rejectLowerDelays(double minDelay);
00072   void rejectHigherDelays(double maxDelay);
00073   void rejectNPeaksPerMinute(double nppm);
00074   void rejectNPeaksPerFrequency(int npf);
00075   void rejectDelay(double delay);
00076   void unselectAmplitude(double factor);
00077   void rejectTime(double min, double max);
00078 private:
00079   static bool lessThan(const MaxEntry * e1, const MaxEntry * e2) {return *e1 < *e2;}
00080   void minPowerVectors(QMap<double,double>& minRelPow, QMap<double,double>& minAbsPow,
00081                        double relativeFactor, double absoluteFactor);
00082   void minAmplitudeVectors(QMap<double,double>& minVAmplitude, double factor);
00083   QList<double> xSamples() const;
00084 
00085   Type _type;
00086 };
00087 
00088 #endif // MAXENTRYLIST_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines