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 #ifndef XUNIQUEYCOLORLINES_H
00029 #define XUNIQUEYCOLORLINES_H
00030
00031 #include "GraphContentLayer.h"
00032 #include "SciFigsDLLExport.h"
00033
00034 namespace SciFigs {
00035
00036 class XYColorLinesProperties;
00037
00038 class SCIFIGS_EXPORT XUniqueYColorLines : public GraphContentLayer
00039 {
00040 Q_OBJECT
00041 Q_PROPERTY(double lineWeight READ lineWeight WRITE setLineWeight SCRIPTABLE true)
00042 public:
00043 XUniqueYColorLines(AxisWindow * parent=0);
00044 ~XUniqueYColorLines();
00045
00046 virtual const QString& xml_tagName() const {return xmlXUniqueYColorLinesTag;}
00047 static const QString xmlXUniqueYColorLinesTag;
00048
00049 void clear();
00050 void setPointCount(int nCurve, int nX);
00051
00052 const double * x() const {return _x;}
00053 const double * y() const {return _y;}
00054 double * x() {return _x;}
00055 double * y() {return _y;}
00056
00057 const QColor * colors() const {return _colors;}
00058 void setColors(QColor * col);
00059 void setColor(int index, const QColor& col);
00060
00061
00062 Rect boundingRect() const;
00063
00064 virtual bool trackRectangle(int, double rx1, double ry1, double rx2, double ry2, Qt::KeyboardModifiers);
00065 int curveCount() {return _curveCount;}
00066 inline void setLineWeight(double lw) {_lineWeight=lw;}
00067 double lineWeight() const {return _lineWeight;}
00068 double lineWeightMM() const {return _lineWeight*10.0;}
00069 void mulYbyX(double constant);
00070 void divYbyX(double constant);
00071
00072 virtual bool hasProperties() {return true;}
00073 virtual void addProperties(PropertyProxy * pp);
00074 virtual void removeProperties(PropertyProxy * pp);
00075 virtual void properties(PropertyWidget * w) const;
00076 virtual void setProperty(uint wid, int pid, QVariant val);
00077 public slots:
00078 void setColor(int curveIndex, int red, int green, int blue);
00079 signals:
00080 void dataSelected(int id, const QVector<int> * indexList);
00081 protected:
00082 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const;
00083
00084 int _curveCount;
00085 int _xCount;
00086 double * _x;
00087 double * _y;
00088 QColor * _colors;
00089
00090 double _lineWeight;
00091
00092 XYColorLinesProperties * _propertiesTab;
00093 protected:
00094 virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00095 virtual void xml_writeBinaryData(XML_WRITEBINARYDATA_ARGS) const;
00096 virtual bool xml_setBinaryData(XML_SETBINARYDATA_ARGS);
00097 };
00098
00099 }
00100
00101 #endif // XUNIQUEYCOLORLINES_H