00001 /*************************************************************************** 00002 ** 00003 ** This file is part of QGpCompatibility. 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 : 2004-10-21 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (ULg, Liège, Belgium) 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef COMPATMODALFREQUENCY_H 00029 #define COMPATMODALFREQUENCY_H 00030 00031 #include <QGpCoreTools.h> 00032 #include "QGpCompatibilityDLLExport.h" 00033 00034 namespace QGpCompatibility { 00035 00036 class QGPCOMPATIBILITY_EXPORT CompatModalFrequency: public QVector<double>, public XMLClass 00037 { 00038 TRANSLATIONS( "CompatModalFrequency" ); 00039 public: 00040 CompatModalFrequency(); 00041 virtual ~CompatModalFrequency() {}; 00042 00043 virtual const QString& xml_tagName() const {return xmlModalFrequencyTag;} 00044 static const QString xmlModalFrequencyTag; 00045 00046 void operator=(CompatModalFrequency& o); 00047 00048 virtual void setNModes(int nm)=0; 00049 void setNRayleighModes(int nRm) {_nRayleighModes=nRm;} 00050 virtual void setNOmegas(int nf) {resize(nf);} 00051 00052 virtual int nModes() const=0; 00053 int nRayleighModes() const {return _nRayleighModes;} 00054 int nLoveModes() const {return nModes()-_nRayleighModes;} 00055 int nOmegas() const {return count();} 00056 00057 void insertOmegas(const CompatModalFrequency& samples); 00058 virtual void addRayleighModes(int nNewModes)=0; 00059 void addLoveModes(int nNewModes); 00060 00061 double& omega(int iOmega) {return operator[] (iOmega);} 00062 const double& omega(int iOmega) const {return operator[] (iOmega);} 00063 00064 void setFrequencies(QVector<double>& values); 00065 QVector<double> * frequencies() const; 00066 bool isSameOmegas(const CompatModalFrequency& o) const; 00067 protected: 00068 int _nRayleighModes; 00069 protected: 00070 virtual void insertInvalidAt(int i)=0; 00071 virtual void addInvalid()=0; 00072 00073 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const; 00074 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS); 00075 virtual XMLMember xml_member(XML_MEMBER_ARGS); 00076 }; 00077 00078 QGPCOMPATIBILITY_EXPORT QDataStream& operator<< (QDataStream& s, const CompatModalFrequency& p); 00079 QGPCOMPATIBILITY_EXPORT QDataStream& operator>> (QDataStream& s, CompatModalFrequency& p); 00080 00081 } // namespace QGpCompatibility 00082 00083 #endif // COMPATMODALFREQUENCY_H