DinverDCCore/ParamGroundModel.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of DinverDCCore.
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-18
00021 **  Authors:
00022 **    Marc Wathelet
00023 **    Marc Wathelet (ULg, Liège, Belgium)
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef ParamGroundModel_H
00029 #define ParamGroundModel_H
00030 
00031 #include <DinverCore.h>
00032 #include <QGpCoreWave.h>
00033 
00034 #include "DinverDCCoreDLLExport.h"
00035 
00036 namespace DinverDCCore {
00037 
00038 class ParamProfile;
00039 class ParamLayer;
00040 class GroundParameter;
00041 
00042 typedef QList<ParamProfile *> ProfileList;
00043 
00044 class DINVERDCCORE_EXPORT ParamGroundModel : public XMLClass
00045 {
00046   TRANSLATIONS("ParamGroundModel")
00047 public:
00048   ParamGroundModel();
00049   ParamGroundModel(const ParamGroundModel& o);
00050   ParamGroundModel(Seismic1DModel * m);
00051   virtual ~ParamGroundModel();
00052 
00053   void setCustomConditions(const QString& t) {_customConditions.setText(t);}
00054   const ParamSpaceScript& customConditions() const {return _customConditions;}
00055 
00056   int nProfiles() const {return _profiles.count();}
00057   ParamProfile * profile(int index) {return _profiles[index];}
00058   ParamProfile * find(QString shortName);
00059 
00060   bool toParameters(RealSpace& ps) const;
00061   void insertLayer(ParamProfile * profile, int at, ParamLayer * layer);
00062   void addProfile(ParamProfile * profile) {_profiles.append(profile);}
00063   void removeProfile(ParamProfile * profile);
00064   void initFinalProfiles();
00065   void updateFinalProfiles(const GroundParameter * from=0);
00066   bool isEmpty();
00067   bool hasGradient() const;
00068 
00069   void setDepthLinks();
00070 
00071   const Point& position() const {return _position;}
00072   void setPosition(const Point& p) {_position=p;}
00073 protected:
00074   virtual const QString& xml_tagName() const {return xmlParamGroundModelTag;}
00075   static const QString xmlParamGroundModelTag;
00076   virtual void xml_writeProperties(XML_WRITECHILDREN_ARGS) const;
00077   virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00078   virtual XMLMember xml_member(XML_MEMBER_ARGS);
00079   virtual bool xml_setProperty(XML_SETPROPERTY_ARGS);
00080   virtual void xml_polish(XML_POLISH_ARGS);
00081 private:
00082   ProfileList _profiles;
00083   ParamSpaceScript _customConditions;
00084 
00085   void resampleProfiles();
00086 
00087   // Position
00088   Point _position;
00089 };
00090 
00091 } // namespace DinverDCCore
00092 
00093 #endif // PARAMGROUNDMODEL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines