mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
faf3e7079d
commit
2008857660
6 changed files with 124 additions and 75 deletions
26
stats/regressionitem.h
Normal file
26
stats/regressionitem.h
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue