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 ERRORBARS_H
00030 #define ERRORBARS_H
00031
00032 #include "PlotCurve.h"
00033 #include <qwt_plot.h>
00034
00036 class QwtErrorPlotCurve: public DataCurve
00037 {
00038 public:
00039 enum Orientation{Horizontal = 0, Vertical = 1};
00040
00041 QwtErrorPlotCurve(int orientation, Table *t, const char *name);
00042 QwtErrorPlotCurve(Table *t, const char *name);
00043
00044 void copy(const QwtErrorPlotCurve *e);
00045
00046 QwtDoubleRect boundingRect() const;
00047
00048 double errorValue(int i);
00049 QwtArray<double> errors(){return err;};
00050 void setErrors(const QwtArray<double>&data){err=data;};
00051
00052 int capLength(){return cap;};
00053 void setCapLength(int t){cap=t;};
00054
00055 int width(){return pen().width ();};
00056 void setWidth(int w);
00057
00058 QColor color(){return pen().color();};
00059 void setColor(const QColor& c);
00060
00061 int direction(){return type;};
00062 void setDirection(int o){type = o;};
00063
00064 bool xErrors();
00065 void setXErrors(bool yes);
00066
00067 bool throughSymbol(){return through;};
00068 void drawThroughSymbol(bool yes){through=yes;};
00069
00070 bool plusSide(){return plus;};
00071 void drawPlusSide(bool yes){plus=yes;};
00072
00073 bool minusSide(){return minus;};
00074 void drawMinusSide(bool yes){minus=yes;};
00075
00077 DataCurve* masterCurve(){return d_master_curve;};
00078 void setMasterCurve(DataCurve *c);
00079
00081 void detachFromMasterCurve(){d_master_curve->removeErrorBars(this);};
00082
00083 QString plotAssociation();
00084
00085 bool updateData(Table *t, const QString& colName);
00086 void loadData();
00087
00088 private:
00089 virtual void draw(QPainter *painter,const QwtScaleMap &xMap,
00090 const QwtScaleMap &yMap, int from, int to) const;
00091
00092 void drawErrorBars(QPainter *painter, const QwtScaleMap &xMap,
00093 const QwtScaleMap &yMap, int from, int to) const;
00094
00096 QwtArray<double> err;
00097
00099 int type;
00100
00102 int cap;
00103
00104 bool plus, minus, through;
00105
00107 DataCurve *d_master_curve;
00108 };
00109
00110 #endif