Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef XYCOLORLINES_H
00030 #define XYCOLORLINES_H
00031
00032 #include <QGpGuiTools.h>
00033
00034 #include "GraphicObject.h"
00035 #include "GraphContentLayer.h"
00036
00037 namespace SciFigs {
00038
00039 class XYColorLinesProperties;
00040
00041 class SCIFIGS_EXPORT XYColorLines : public GraphContentLayer
00042 {
00043 Q_OBJECT
00044 Q_PROPERTY(double lineWeight READ lineWeight WRITE setLineWeight SCRIPTABLE true)
00045 public:
00046 XYColorLines(AxisWindow * parent=0, bool autoDelete=false);
00047 ~XYColorLines();
00048
00049 virtual const QString& xml_tagName() const {return xmlXYColorLinesTag;}
00050 static const QString xmlXYColorLinesTag;
00051
00052 Point2D * points() {return _points;}
00053 const Point2D * points() const {return _points;}
00054
00055 const QColor * colors() const {return _colors;}
00056 void setColors(QColor * col);
00057 void setColor(int index, const QColor& col);
00058
00059 int curveCount() {return _curveCount;}
00060 void setPointCount(int nPoints, int nCurves, int * pointCounts);
00061 void setPointCount(int nPoints, const QVector<int>& pointCounts);
00062 void setPoints(const QVector<Point2D>& points);
00063
00064
00065 Rect boundingRect() const;
00066
00067 virtual bool trackRectangle(int, double rx1, double ry1, double rx2, double ry2, Qt::KeyboardModifiers);
00068
00069 void setLineWeight (double lw);
00070 double lineWeight() const {return _lineWeight;}
00071 double lineWeightMM() const {return _lineWeight*10.0;}
00072
00073 void mulYbyX(double constant);
00074 void divYbyX(double constant);
00075
00076 virtual bool hasProperties() {return true;}
00077 virtual void addProperties(PropertyProxy * pp);
00078 virtual void removeProperties(PropertyProxy * pp);
00079 virtual void properties(PropertyWidget * w) const;
00080 virtual void setProperty(uint wid, int pid, QVariant val);
00081
00082 static uint _tab;
00083
00084 static void saveBinaryColorVector(QDataStream& s, const QColor * colors, int count);
00085 static void restoreBinaryColorVector(QDataStream& s, QColor *& colors, int count, XMLContext * context);
00086 public slots:
00087 void setColor(int curveIndex, int red, int green, int blue);
00088 signals:
00089 void dataSelected(int id, const QVector<int> * indexList);
00090 protected:
00091 void clear();
00092 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const;
00093
00094 bool _autoDelete;
00095 int _curveCount;
00096 int * _pointCounts;
00097 Point2D * _points;
00098 QColor * _colors;
00099
00100 double _lineWeight;
00101
00102 XYColorLinesProperties * _propertiesTab;
00103 protected:
00104 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00105 virtual void xml_writeBinaryData(XML_WRITEBINARYDATA_ARGS) const;
00106 virtual bool xml_setBinaryData(XML_SETBINARYDATA_ARGS);
00107 virtual bool xml_setBinaryData200411(XML_SETBINARYDATA_ARGS);
00108 };
00109
00110 }
00111
00112 #endif // XYCOLORLINES_H