Cleanup, added animation, dialogs, view transformations.
[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         QList<QPolygonF> paths;
29
30         QGraphicsScene* scene;
31
32         CutDialog* cutDialog;
33
34         QString lastOpenDir;
35
36         QTimer* animationTimer;
37
38         QGraphicsItem* cutMarker;
39         // Cut marker progress.
40         int cutMarkerPath; // Current path.
41         int cutMarkerLine; // Current line in path
42         double cutMarkerDistance; // Current distance along edge.
43
44 private slots:
45         void on_actionZoom_Out_triggered();
46         void on_actionZoom_In_triggered();
47         void on_actionReset_triggered();
48         void on_actionAnimate_toggled(bool animate);
49         void on_actionManual_triggered();
50         void on_actionCut_triggered();
51         void on_actionExit_triggered();
52         void on_actionAbout_triggered();
53         void on_actionOpen_triggered();
54
55         // Advance the cutting animation frame.
56         void animate();
57 };
58
59 #endif // MAINWINDOW_H