-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.h
More file actions
43 lines (32 loc) · 1.13 KB
/
mainwindow.h
File metadata and controls
43 lines (32 loc) · 1.13 KB
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "library/exprtk.hpp"
#include <memory>
#include <functional>
namespace Ui {
class MainWindow;
}
class GraphWidget;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void handlePushButtonClicked();
private:
Ui::MainWindow *ui;
GraphWidget *graphWidget = nullptr;
void setupGraphWidget();
bool isXofYGraph(const QString &expr) const;
QString prepareExpression(const QString &expr) const;
void setupGraphFunction(const QString &expr, bool isXofY);
std::shared_ptr<exprtk::expression<double>> compileExpression(const QString &expr,
const QString &varName,
std::shared_ptr<double> varPtr) const;
std::function<double(double)> createFunction(std::shared_ptr<exprtk::expression<double>> exprPtr,
std::shared_ptr<double> varPtr) const;
};
#endif // MAINWINDOW_H