aboutsummaryrefslogtreecommitdiffstats
path: root/stats/regressionitem.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-15 18:39:14 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-20 08:47:18 +0100
commit20088576604a3159cc9891bcfea888c15b096a96 (patch)
tree244e1996c21adb6071346d754e5ac401d726aa15 /stats/regressionitem.h
parentfaf3e7079ddd680ab0e53a27a7ddc0d863792117 (diff)
downloadsubsurface-20088576604a3159cc9891bcfea888c15b096a96.tar.gz
statistics: render regression item using QSGNode
Render the confidence area and the regression line into a pixmap and show that using a QSGNode. It is unclear whether it is preferred to do it this way or to triangulate the confidence area into triangles to be drawn by the shader. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/regressionitem.h')
-rw-r--r--stats/regressionitem.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/stats/regressionitem.h b/stats/regressionitem.h
new file mode 100644
index 000000000..607317d08
--- /dev/null
+++ b/stats/regressionitem.h
@@ -0,0 +1,26 @@
+// A regression line and confidence area
+#ifndef REGRESSION_H
+#define REGRESSION_H
+
+#include "chartitem.h"
+
+class StatsAxis;
+class StatsView;
+
+struct regression_data {
+ double a,b;
+ double res2, r2, sx2, xavg;
+ int n;
+};
+
+class RegressionItem : public ChartPixmapItem {
+public:
+ RegressionItem(StatsView &view, regression_data data, StatsAxis *xAxis, StatsAxis *yAxis);
+ ~RegressionItem();
+ void updatePosition();
+private:
+ StatsAxis *xAxis, *yAxis;
+ regression_data reg;
+};
+
+#endif