DinverDCCore/TargetList2D.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: 2010-04-02
00021 **  Authors:
00022 **    Marc Wathelet (LGIT, Grenoble, France)
00023 **
00024 ***************************************************************************/
00025 
00026 #ifndef TARGETLIST2D_H
00027 #define TARGETLIST2D_H
00028 
00029 #include "TargetList.h"
00030 
00031 namespace DinverDCCore {
00032 
00033 class Param3DGroundModel;
00034 
00035 class DINVERDCCORE_EXPORT TargetList2D : public XMLClass
00036 {
00037 public:
00038   TargetList2D();
00039   TargetList2D(const TargetList2D& o);
00040   ~TargetList2D();
00041 
00042   virtual const QString& xml_tagName() const {return xmlTargetList2DTag;}
00043   static const QString xmlTargetList2DTag;
00044 
00045   void addTarget(TargetList * t);
00046 
00047   int targetCount() const {return _targets.count();}
00048   TargetList * target(int index) const {return _targets.at(index);}
00049 
00050   bool setParamProfiles(Param3DGroundModel * gm, RealSpace& ps);
00051   inline bool isPoissonRatioOk(const GroundParameter * from);
00052   double misfit(int nDimensions, bool& ok);
00053   void writeReport(ReportWriter * report) const;
00054   void humanInfo() const;
00055 protected:
00056   virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00057   virtual XMLMember xml_member(XML_MEMBER_ARGS);
00058 private:
00059   friend class DCReportBlock;
00060 
00061   void interpole(const Point& at, const Profile& p1, const Profile& p2, const Profile& p3, Profile& p);
00062 
00063   ParamProfile * _vp[3];
00064   ParamProfile * _nu[3];
00065   ParamProfile * _vs[3];
00066   ParamProfile * _rho[3];
00067   PoissonCondition * _poissonCondition[3];
00068   QHash<const ParamGroundModel *, int> _models;
00069 
00070   QVector<TargetList *> _targets;
00071 
00072   Plane _planeEngine;
00073   Profile _reportVp, _reportVs, _reportRho;
00074 };
00075 
00076 inline bool TargetList2D::isPoissonRatioOk(const GroundParameter * from)
00077 {
00078   TRACE;
00079   QHash<const ParamGroundModel *, int>::iterator it=_models.find(from->groundModel());
00080   ASSERT(it!=_models.end());
00081   PoissonCondition * pc=_poissonCondition[it.value()];
00082   if(pc) {
00083     return pc->isOk(from);
00084   } else {
00085     return true;
00086   }
00087 }
00088 
00089 } // namespace DinverDCCore
00090 
00091 #endif // TARGETLIST2D_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines