SciDAVis  1.D4
QwtErrorPlotCurve.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : QwtErrorPlotCurve.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7  Description : Error bars curve
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef ERRORBARS_H
30 #define ERRORBARS_H
31 
32 #include "PlotCurve.h"
33 #include <qwt_plot.h>
34 
37 {
38 public:
40 
41  QwtErrorPlotCurve(int orientation, Table *t, const char *name);
42  QwtErrorPlotCurve(Table *t, const char *name);
43 
44  void copy(const QwtErrorPlotCurve *e);
45 
46  QwtDoubleRect boundingRect() const;
47 
48  double errorValue(int i);
49  QwtArray<double> errors(){return err;};
50  void setErrors(const QwtArray<double>&data){err=data;};
51 
52  int capLength(){return cap;};
53  void setCapLength(int t){cap=t;};
54 
55  int width(){return pen().width ();};
56  void setWidth(int w);
57 
58  QColor color(){return pen().color();};
59  void setColor(const QColor& c);
60 
61  int direction(){return type;};
62  void setDirection(int o){type = o;};
63 
64  bool xErrors();
65  void setXErrors(bool yes);
66 
67  bool throughSymbol(){return through;};
68  void drawThroughSymbol(bool yes){through=yes;};
69 
70  bool plusSide(){return plus;};
71  void drawPlusSide(bool yes){plus=yes;};
72 
73  bool minusSide(){return minus;};
74  void drawMinusSide(bool yes){minus=yes;};
75 
78  void setMasterCurve(DataCurve *c);
79 
82 
83  QString plotAssociation();
84 
85  bool updateData(Table *t, const QString& colName);
86  virtual bool loadData();
87 
88 private:
89  virtual void draw(QPainter *painter,const QwtScaleMap &xMap,
90  const QwtScaleMap &yMap, int from, int to) const;
91 
92  void drawErrorBars(QPainter *painter, const QwtScaleMap &xMap,
93  const QwtScaleMap &yMap, int from, int to) const;
94 
96  QwtArray<double> err;
97 
99  int type;
100 
102  int cap;
103 
105 
108 };
109 
110 #endif