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-25 00022 ** Authors : 00023 ** Marc Wathelet 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef AUTOCORRRING_H 00029 #define AUTOCORRRING_H 00030 00031 #include <QGpCoreTools.h> 00032 00033 #include "FactoryPoint.h" 00034 #include "QGpCoreWaveDLLExport.h" 00035 00036 namespace QGpCoreWave { 00037 00038 class QGPCOREWAVE_EXPORT AutocorrRing : public XMLClass 00039 { 00040 public: 00041 inline AutocorrRing(); 00042 inline AutocorrRing(const AutocorrRing& o); 00043 inline AutocorrRing(double rMin, double rMax); 00044 00045 inline AutocorrRing& operator=(const AutocorrRing& o); 00046 inline bool operator==(const AutocorrRing& o) const; 00047 inline bool operator<(const AutocorrRing& o) const; 00048 00049 virtual const QString& xml_tagName() const {return xmlAutocorrRingTag;} 00050 static const QString xmlAutocorrRingTag; 00051 00052 inline void setRadii(double rMin, double rMax); 00053 double minRadius() const {return _minRadius;} 00054 double maxRadius() const {return _maxRadius;} 00055 protected: 00056 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const; 00057 virtual XMLMember xml_member(XML_MEMBER_ARGS); 00058 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS); 00059 private: 00060 double _minRadius, _maxRadius; 00061 }; 00062 00063 inline AutocorrRing::AutocorrRing() 00064 : XMLClass() 00065 { 00066 _minRadius=1.0; 00067 _maxRadius=2.0; 00068 } 00069 00070 inline AutocorrRing::AutocorrRing(const AutocorrRing& o) 00071 : XMLClass() 00072 { 00073 setRadii(o.minRadius(), o.maxRadius()); 00074 } 00075 00076 inline AutocorrRing::AutocorrRing(double rMin, double rMax) 00077 : XMLClass() 00078 { 00079 setRadii(rMin, rMax); 00080 } 00081 00082 inline AutocorrRing& AutocorrRing::operator=(const AutocorrRing& o) 00083 { 00084 TRACE; 00085 _minRadius=o._minRadius; 00086 _maxRadius=o._maxRadius; 00087 return *this; 00088 } 00089 00090 inline bool AutocorrRing::operator==(const AutocorrRing& o) const 00091 { 00092 TRACE; 00093 return _minRadius==o._minRadius && _maxRadius==o._maxRadius; 00094 } 00095 00096 inline bool AutocorrRing::operator<(const AutocorrRing& o) const 00097 { 00098 TRACE; 00099 return _minRadius<o._minRadius || (_minRadius==o._minRadius && _maxRadius<o._maxRadius); 00100 } 00101 00102 inline void AutocorrRing::setRadii(double rMin, double rMax) 00103 { 00104 if(rMin < rMax) { 00105 _minRadius=rMin; 00106 _maxRadius=rMax; 00107 } else { 00108 _maxRadius=rMin; 00109 _minRadius=rMax; 00110 } 00111 } 00112 00113 } // namespace QGpCoreWave 00114 00115 #endif // AUTOCORRRING_H