-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparametricfunction.h
49 lines (32 loc) · 1.1 KB
/
parametricfunction.h
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
48
49
#ifndef PARAMETRICFUNCTION_H
#define PARAMETRICFUNCTION_H
#include <QString>
#include <QPoint>
#include <QDebug>
#include <abstractfunction.h>
#include <rpn_utility.h>
#include <defines.h>
class ParametricFunction : public AbstractFunction
{
Q_OBJECT
public:
explicit ParametricFunction(const QString &id, const QString &_x_formula, const QString &_y_formula, const QPointF bornes, QWidget *parent = nullptr);
~ParametricFunction();
virtual inline QString getFormula() const { return QString("Parametric %1 %2 %3 [%4;%5]").arg(id, x_formula, y_formula, QString::number(bornes.x()), QString::number(bornes.y()) ); }
std::pair<unsigned, QPointF*> getPoints(float min, float max);
static AbstractFunction* loadFunction(const QString&input, QWidget* parent = nullptr);
public slots :
void changeX();
void changeY();
private :
float getOnePoint(float x);
void setPoints();
QPointF* points;
QString x_formula;
QString y_formula;
QPointF bornes;
QVBoxLayout* layout;
QLineEdit* x_equation;
QLineEdit* y_equation;
};
#endif // PARAMETRICFUNCTION_H