-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.h
More file actions
47 lines (38 loc) · 979 Bytes
/
plot.h
File metadata and controls
47 lines (38 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "mainwindow.h"
using std::string;
using std::cout;
#ifndef PLOT_H
#define PLOT_H
class Plots;
class Plot : QCustomPlot
{
friend class Plots;
friend class CustomParser;
private:
// plot can have multiple functions, so we give each one of them an ID
// when we add a function to the plot, we encrease this value by 1
int ID = 0;
// the size (in px) of each plot element in UI
static const int size = 360;
// the number of partitions we divide the interval (x from ... to ...)
static const int partitions = 720;
QVector<double> X, Y;
string var = "x";
// x
double from = -5;
double to = 5;
// y
double minVal = -1;
double maxVal = 1;
bool autoValues = true; // minValue & maxValue are being computed while parsing
double lineWidth = 2;
QString xLabel = "";
QString yLabel = "";
QColor color = Colors::get(QString("blue"));
void mousePressEvent(QMouseEvent*);
public:
Plot();
virtual ~Plot(void) {}
void draw();
};
#endif // PLOT_H