Cleaned up. First release I think after testing.
[robocut:robocut-for-portrait.git] / MainWindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtGui/QMainWindow>
5
6 #include <QGraphicsScene>
7 #include <QTimer>
8 #include <QGraphicsItem>
9
10 #include "CutDialog.h"
11
12 namespace Ui
13 {
14         class MainWindow;
15 }
16
17 class MainWindow : public QMainWindow
18 {
19         Q_OBJECT
20
21 public:
22         MainWindow(QWidget *parent = 0);
23         ~MainWindow();
24
25 private:
26         Ui::MainWindow *ui;
27
28         // The cutting paths that were loaded from the SVG.
29         QList<QPolygonF> paths;
30
31         // For displaying the cuts.
32         QGraphicsScene* scene;
33
34         // The dialog that asks what settings to use. We keep this around and reuse it as necessary.
35         CutDialog* cutDialog;
36
37         // The directory that the last file was opened from.
38         QString lastOpenDir;
39
40         // Timer for the cutting animation.
41         QTimer* animationTimer;
42         // The circle that marks where the cutter blade is.
43         QGraphicsItem* cutMarker;
44         // Cut marker progress.
45         int cutMarkerPath; // Current path.
46         int cutMarkerLine; // Current line in path
47         double cutMarkerDistance; // Current distance along edge.
48
49 private slots:
50         void on_actionZoom_Out_triggered();
51         void on_actionZoom_In_triggered();
52         void on_actionReset_triggered();
53         void on_actionAnimate_toggled(bool animate);
54         void on_actionManual_triggered();
55         void on_actionCut_triggered();
56         void on_actionExit_triggered();
57         void on_actionAbout_triggered();
58         void on_actionOpen_triggered();
59
60         // Advance the cutting animation frame.
61         void animate();
62 };
63
64 #endif // MAINWINDOW_H