-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgcodeview.h
81 lines (59 loc) · 1.75 KB
/
gcodeview.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
71
72
73
74
75
76
77
78
79
80
81
#ifndef GCODEVIEW_H
#define GCODEVIEW_H
#include <QtGui/QApplication>
#include <QGLWidget>
#include "gcode.h"
#include "arcball.h"
#include "mgl/regioner.h"
class GcodeView : public QGLWidget
{
Q_OBJECT // must include this if you use Qt signals/slots
public slots:
void animationUpdate();
public:
GcodeView(QWidget *parent);
void loadSliceData(const mgl::Tomograph &tomograph,
const mgl::RegionList ®ions,
const std::vector<mgl::SliceData> &sliceData);
void loadSliceData(const mgl::LayerLoops& layerloops,
const mgl::RegionList& regions,
const mgl::Grid& grid,
const mgl::LayerPaths& layerpaths);
void loadModel(QString filename);
void exportModel (QString filename, void *progress);
bool hasModel();
void setupViewport(int width, int height);
void resetView();
void zoom(float amount);
void panX(float amount);
void panY(float amount);
void setMaximumVisibleLayer(int layer);
void setMinimumVisibleLayer(int layer);
void toggleRoofs(bool v);
void toggleFLoors(bool v);
void toggleLoops(bool v);
void toggleSurfs(bool v);
void toggleInfills(bool v);
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
void paintGLgcode();
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);
void mouseDoubleClickEvent(QMouseEvent event);
public:
gcodeModel model;
private:
Arcball arcball;
// TODO: Must this be dynamic?
QTimer* animationTimer;
float scale;
float pan_x;
float pan_y;
int maxVisibleLayer;
int minVisibleLayer;
};
#endif // GCODEVIEW_H