mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
b5aac29cea
To enable rudimentary theming, collect all colors in a new theme class. The class has to be passed down to the various items. In general the items save a reference to the them in the constructor. Alternatively, they might also just query the StatsView everytime they need to access a color. For now, it's hard the say what is preferred: a reference per item or a function call per invokation? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
30 lines
645 B
C++
30 lines
645 B
C++
// A regression line and confidence area
|
|
#ifndef REGRESSION_H
|
|
#define REGRESSION_H
|
|
|
|
#include "chartitem.h"
|
|
|
|
class StatsAxis;
|
|
class StatsTheme;
|
|
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();
|
|
void setFeatures(bool regression, bool confidence);
|
|
private:
|
|
const StatsTheme &theme; // Initialized once in constructor
|
|
StatsAxis *xAxis, *yAxis;
|
|
regression_data reg;
|
|
bool regression, confidence;
|
|
};
|
|
|
|
#endif
|