-
Notifications
You must be signed in to change notification settings - Fork 2
/
relaxation.h
40 lines (35 loc) · 942 Bytes
/
relaxation.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
#ifndef RELAXATION_H
#define RELAXATION_H
#include <QObject>
class QTimer;
class Locus;
class Relaxation : public QObject {
Q_OBJECT
public:
explicit Relaxation(uint32_t xSize, uint32_t ySize,
QObject *parent = nullptr);
~Relaxation();
void copyLocuses(std::vector<Locus> *locuses);
void generateLocuses();
virtual void relax();
public slots:
virtual void startRelaxation(int32_t repeat = -1);
virtual void stopRelaxation();
void play();
signals:
void sendSpace(uint32_t *space, uint32_t width, uint32_t height);
void finishRelax();
protected:
uint32_t m_xSize;
uint32_t m_ySize;
uint32_t *m_space;
QTimer *m_timer;
int32_t m_repeat;
std::vector<Locus> m_locuses;
void drawSpace();
void gatherPoints();
void gatherPointsFast();
virtual uint32_t dist(Locus &locus, uint32_t x, uint32_t y);
virtual bool drawLocusEdge(Locus *locus, uint32_t len);
};
#endif // RELAXATION_H