QGpCompatibility/CompatModalCurves.h
Go to the documentation of this file.
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 COMPATMODALCURVES_H
00029 #define COMPATMODALCURVES_H
00030 
00031 #include <QGpCoreTools.h>
00032 #include "CompatDataPoint.h"
00033 #include "QGpCompatibilityDLLExport.h"
00034 
00035 namespace QGpCompatibility {
00036 
00037 typedef QVector<CompatVDataPointVector> CompatModalDataVector;
00038 
00039 class QGPCOMPATIBILITY_EXPORT CompatModalCurves :
00040       protected CompatModalDataVector, public XMLClass
00041 {
00042 public:
00043   virtual ~CompatModalCurves() {}
00044 
00045   void operator=(const CompatModalCurves& o);
00046 
00047   virtual void setNModes(int nm);
00048   void setNOmegas(int nf);
00049 
00050   int nModes() const {return count();}
00051   int nOmegas() const {return (nModes() > 0) ? ( *this) [ 0 ].count() : 0;}
00052 
00053   CompatVDataPointVector& mode(int imode) {return operator[] (imode);}
00054   const CompatVDataPointVector& mode(int imode) const {return operator[] (imode);}
00055 
00056   void setInvalidValue(double val) {_invalidValue=val;}
00057   const double& invalidValue() const {return _invalidValue;}
00058 
00059   void resetValues();
00060   void resetValues(int im);
00061   int validValues(int im) const;
00062 
00063   void addInvalid();
00064   void insertInvalidAt(int i);
00065   void insertModes(int atMode, int nNewModes);
00066   
00067   QVector<double> * meanVector(int im) const;
00068   QVector<double> * stddevVector(int im) const;
00069   QVector<double> * weightVector(int im) const;
00070 protected:
00071   double _invalidValue;
00072 protected:
00073   CompatVDataPointVector invalidMode();
00074 
00075   virtual const QString& xml_tagName() const {return xmlModalCurvesTag;}
00076   static const QString xmlModalCurvesTag;
00077   virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00078   virtual XMLMember xml_member(XML_MEMBER_ARGS);
00079 };
00080 
00081 QGPCOMPATIBILITY_EXPORT QDataStream& operator<< (QDataStream& s, const CompatModalCurves& p);
00082 QGPCOMPATIBILITY_EXPORT QDataStream& operator>> (QDataStream& s, CompatModalCurves& p);
00083 
00084 } // namespace QGpCompatibility
00085 
00086 #endif // COMPATMODALCURVES_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines