subsurface/stats/regressionitem.h
Berthold Stoeger 2eebae13dd stats: break out common QtQuick part of the code
Move most of the QtQuick code to its own directory, so that it
can be reused in the future for the chart.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:35:04 +02:00

29 lines
653 B
C++

// A regression line and confidence area
#ifndef REGRESSION_H
#define REGRESSION_H
#include "chartitem.h"
class StatsAxis;
class StatsTheme;
struct regression_data {
double a,b;
double res2, r2, sx2, xavg;
int n;
};
class RegressionItem : public ChartPixmapItem {
public:
RegressionItem(ChartView &view, const StatsTheme &theme, regression_data data, StatsAxis *xAxis, StatsAxis *yAxis);
~RegressionItem();
void updatePosition();
void setFeatures(bool regression, bool confidence);
private:
const StatsTheme &theme; // Initialized once in constructor
StatsAxis *xAxis, *yAxis;
regression_data reg;
bool regression, confidence;
};
#endif