GeopsyCore/DuplicateRays.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of GeopsyCore.
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: 2010-05-03
00022 **  Authors:
00023 **    Marc Wathelet (LGIT, Grenoble, France)
00024 **
00025 ***************************************************************************/
00026 
00027 #ifndef DUPLICATERAYS_H
00028 #define DUPLICATERAYS_H
00029 
00030 #include "MetaData.h"
00031 #include "Signal.h"
00032 #include "GeopsyCoreDLLExport.h"
00033 
00034 namespace GeopsyCore {
00035 
00036 class SubSignalPool;
00037 
00038 class GEOPSYCORE_EXPORT DuplicateRays : public MetaData
00039 {
00040 public:
00041   DuplicateRays() {_sig=0; _rays=0; _id=0;}
00042   DuplicateRays(const DuplicateRays& o) : MetaData(o) {_sig=o._sig; _rays=o._rays; _id=o._id;}
00043 
00044   virtual const QString& xml_tagName() const {return xmlDuplicateRaysTag;}
00045   static const QString xmlDuplicateRaysTag;
00046 
00047   virtual void setId(int id) const {_id=id;}
00048   virtual int id() const {return _id;}
00049   static int staticId() {return _id;}
00050 
00051   void setSignal(Signal * s) {_sig=s;}
00052   Signal * signal() const {return _sig;}
00053 
00054   void setRays(SubSignalPool * r) {_rays=r;}
00055   SubSignalPool * rays() const {return _rays;}
00056 
00057   virtual bool isStored() {return false;}
00058   virtual bool isReadOnly(int) {return true;}
00059 
00060   virtual QStringList subNames() const;
00061   virtual QStringList indexList(int subId) const;
00062   virtual int count(int subId) const;
00063   virtual bool hasIndex(int subId) const;
00064   virtual bool hasIndex(int subId, const QString& index) const;
00065   virtual QString name(int subId, const QString& index) const;
00066   virtual QString baseName(int subId) const;
00067   virtual QString title(int subId, const QString& index) const;
00068   virtual Number::Type numberType(int subId) const;
00069   virtual QVariant data(int subId, const QString& index) const;
00070 
00071   virtual MetaData * clone() const {return new DuplicateRays(*this);}
00072   virtual const MetaData * defaultValue() const {return &_defaultValue;}
00073 private:
00074   double average(const QString& name) const;
00075   double standardDeviation(const QString& name) const;
00076 
00077   Signal * _sig;
00078   SubSignalPool * _rays;
00079   static int _id;
00080   static DuplicateRays _defaultValue;
00081   static QStringList _names;
00082 };
00083 
00084 } // namespace GeopsyCore
00085 
00086 #endif // DUPLICATERAYS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines