-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathalgorithmInterface.hpp
More file actions
46 lines (40 loc) · 1.14 KB
/
algorithmInterface.hpp
File metadata and controls
46 lines (40 loc) · 1.14 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
44
45
46
#ifndef ALGORITHMINTERFACE_HPP
#define ALGORITHMINTERFACE_HPP
#include <QObject>
#include <QVector>
#include <QPoint>
#include <QStandardItemModel>
#include "mainscene.hpp"
class QIcon;
class AlgorithmInterface : public QObject
{
Q_OBJECT
public:
explicit AlgorithmInterface(MainScene *sc, QObject *parent = 0) :
QObject(parent), mScene(sc), mCalculationTable() {}
virtual ~AlgorithmInterface() {}
virtual QStandardItemModel *calculationTable() { return mCalculationTable; }
virtual void execute(QVector<QPoint> &args) = 0;
virtual void doStep() = 0;
virtual QIcon icon() const = 0;
virtual QString name() const = 0;
virtual QString tooltip() const = 0;
virtual void setScene(MainScene *scene) { mScene = scene; }
virtual bool eventFilter(QObject *obj, QEvent *event)
{
return false;
}
public slots:
void activate()
{
mScene->installEventFilter(this);
emit algorithmActivated();
}
protected:
MainScene *mScene;
QStandardItemModel *mCalculationTable;
signals:
void error(QString errString);
void algorithmActivated();
};
#endif // ALGORITHMINTERFACE_HPP