QGpCoreWave/Mode.h
Go to the documentation of this file.
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 MODE_H
00029 #define MODE_H
00030 
00031 #include <QGpCoreTools.h>
00032 #include "QGpCoreWaveDLLExport.h"
00033 
00034 namespace QGpCoreWave {
00035 
00036 class QGPCOREWAVE_EXPORT Mode : public XMLClass
00037 {
00038   TRANSLATIONS("Mode");
00039 public:
00040   enum Polarisation {Vertical=1, Radial=2, Rayleigh=3, Transverse=4, Love=5};
00041   enum Slowness {Phase=0, Group=1};
00042 
00043   inline Mode();
00044   inline Mode(Slowness s, Polarisation p, int index);
00045   inline Mode(Polarisation p, int ringIndex, int index);
00046   inline Mode(const Mode& o);
00047 
00048   virtual const QString& xml_tagName() const {return xmlModeTag;}
00049   static const QString xmlModeTag;
00050 
00051   bool operator==(const Mode& o) const;
00052 
00053   void setPolarisation(Polarisation p) {_polarisation=p;}
00054   void setPolarisation(QString p);
00055   Polarisation polarisation() const {return _polarisation;}
00056   QString polarisationString() const;
00057 
00058   void setSlowness(Slowness s) {_slowness=s;}
00059   void setSlowness(QString s);
00060   Slowness slowness() const {return _slowness;}
00061   QString slownessString() const;
00062 
00063   void setRingIndex(int i) {_ringIndex=i;}
00064   int ringIndex() const {return _ringIndex;}
00065 
00066   void setIndex(int i) {_index=i;}
00067   int index() const {return _index;}
00068   QString indexString() const;
00069   QString toString() const;
00070 protected:
00071   void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00072   XMLMember xml_member(XML_MEMBER_ARGS);
00073   bool xml_setProperty(XML_SETPROPERTY_ARGS);
00074 private:
00075   Slowness _slowness;
00076   Polarisation _polarisation;
00077   int _ringIndex;
00078   int _index;
00079 };
00080 
00081 inline Mode::Mode()
00082 {
00083   TRACE;
00084   _polarisation=Rayleigh;
00085   _slowness=Phase;
00086   _ringIndex=0;
00087   _index=0;
00088 }
00089 
00090 inline Mode::Mode(Polarisation p, int ringIndex, int index)
00091 {
00092   TRACE;
00093   _polarisation=p;
00094   _slowness=Phase;
00095   _ringIndex=ringIndex;
00096   _index=index;
00097 }
00098 
00099 inline Mode::Mode(Slowness s, Polarisation p, int index)
00100 {
00101   TRACE;
00102   _polarisation=p;
00103   _slowness=s;
00104   _ringIndex=0;
00105   _index=index;
00106 }
00107 
00108 inline Mode::Mode(const Mode& o) : XMLClass()
00109 {
00110   TRACE;
00111   _polarisation=o._polarisation;
00112   _slowness=o._slowness;
00113   _ringIndex=o._ringIndex;
00114   _index=o._index;
00115 }
00116 
00117 inline bool Mode::operator==(const Mode& o) const
00118 {
00119   TRACE;
00120   return _polarisation==o._polarisation &&
00121          _slowness==o._slowness &&
00122          _ringIndex==o._ringIndex &&
00123          _index==o._index;
00124 }
00125 
00126 } // namespace QGpCoreWave
00127 
00128 #endif // MODE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines