-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderworker.h
70 lines (52 loc) · 1.84 KB
/
renderworker.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef RENDERWORKER_H
#define RENDERWORKER_H
#include <mapcraftercore/config/configsections/map.h>
#include <mapcraftercore/config/mapcrafterconfig.h>
#include <mapcraftercore/renderer/manager.h>
#include <QObject>
using namespace mapcrafter;
class QtObjectProgressHandler : public QObject, public util::AbstractOutputProgressHandler {
Q_OBJECT
public:
virtual void setMax(int max);
virtual void setValue(int value);
virtual void update(double percentage, double average_speed, int eta);
signals:
void maxChanged(int max);
void valueChanged(int value);
void statsChanged(double percentage, double average_speed, int eta);
};
class RenderWorker : public QObject
{
Q_OBJECT
public:
explicit RenderWorker(QObject *parent = 0);
~RenderWorker();
void setConfig(const config::MapcrafterConfig& config);
void setRenderManager(renderer::RenderManager* manager);
void setThreadCount(int thread_count);
signals:
void scanWorldsFinished();
void labelMapsProgressChanged(QString string);
void progressMapsMaxChanged(int max);
void progressMapsValueChanged(int value);
void labelTilesProgressLeftChanged(QString string);
void labelTilesProgressCenterChanged(QString string);
void labelTilesProgressRightChanged(QString string);
void progressTilesMaxChanged(int max);
void progressTilesValueChanged(int value);
void renderMapsFinished();
public slots:
void scanWorlds();
void renderMaps();
protected slots:
void handleTilesProgressMaxChanged(int max);
void handleTilesProgressValueChanged(int value);
void handleTilesProgressStatsChanged(double percentage, double average_speed, int eta);
protected:
config::MapcrafterConfig config;
renderer::RenderManager* manager;
int thread_count;
QtObjectProgressHandler* qt_progress;
};
#endif // RENDERWORKER_H