00001 /*************************************************************************** 00002 ** 00003 ** This file is part of dinver. 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-26 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (ULg, Liège, Belgium) 00024 ** Marc Wathelet (LGIT, Grenoble, France) 00025 ** 00026 ***************************************************************************/ 00027 00028 #ifndef NAModelsPlot_H 00029 #define NAModelsPlot_H 00030 00031 #include <QGpCoreTools.h> 00032 #include <SciFigs.h> 00033 #include "PSViewer.h" 00034 00035 class PSViewer; 00036 class TabNAModelsPlot; 00037 00038 class NAModelsPlot : public GraphContentLayer 00039 { 00040 Q_OBJECT 00041 Q_PROPERTY(double dotDiameter READ dotDiameter WRITE setDotDiameter) 00042 public: 00043 NAModelsPlot(AxisWindow * parent=0); 00044 ~NAModelsPlot(); 00045 00046 virtual const QString& xml_tagName() const; 00047 static const QString xmlNAModelsPlotTag; 00048 00049 virtual Rect boundingRect() const; 00050 virtual void setParent(GraphContent * parent); 00051 00052 void setParamX(int px); 00053 void setParamY(int py); 00054 int paramX() const {return _paramX;} 00055 int paramY() const {return _paramY;} 00056 // Diameter of point on plot (in cm) 00057 double dotDiameter() const {return _size;} 00058 // Change diameter of point on plot (in cm) 00059 void setDotDiameter (double d) {_size=d;} 00060 // Diameter of point on plot (in cm) 00061 double dotDiameterMM() const {return _size*10.0;} 00062 // Change diameter of point on plot (in cm) 00063 void setDotDiameterMM (double d) {_size=d*0.1;} 00064 00065 virtual bool hasProperties() {return true;} 00066 virtual void addProperties(PropertyProxy * pp); 00067 virtual void removeProperties(PropertyProxy * pp); 00068 virtual void properties(PropertyWidget * w) const; 00069 virtual void setProperty(uint wid, int pid, QVariant val); 00070 protected: 00071 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const; 00072 00073 mutable PSViewer * _psViewer; 00074 int _paramX, _paramY; 00075 double _size; 00076 static uint _tab; 00077 00078 bool saveParameters() const; 00079 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const; 00080 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const; 00081 virtual void xml_writeBinaryData(XML_WRITEBINARYDATA_ARGS) const; 00082 virtual XMLMember xml_member(XML_MEMBER_ARGS); 00083 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS); 00084 private: 00085 void paramValue(double& x, double& y, double& misfit, ModelThreadList::const_iterator it) const; 00086 }; 00087 00088 #endif