Debian Codegraph @

MainWindow.h

raw symbols SCIP
1 /***************************************************************************
2 * This file is part of Robocut. *
3 * Copyright (C) 2010 Tim Hutt <[email protected]> *
4 * Copyright (C) 2010 Markus Schulz <[email protected]> *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
20 ***************************************************************************/
21
22 #pragma once
23
24 #include <QMainWindow>
25
26 #include <QGraphicsScene>
27 #include <QTimer>
28 #include <QGraphicsItem>
29
30 #include "CutDialog.h"
31
32 namespace Ui
33 {
34 class MainWindow;
35 }
36
37 class MainWindow : public QMainWindow
38 {
39 Q_OBJECT
40
41 public:
42 MainWindow(QWidget *parent = 0);
43 ~MainWindow();
44
45 private:
46 Ui::MainWindow *ui;
47
48 // The cutting paths that were loaded from the SVG.
49 QList<QPolygonF> paths;
50
51 // For displaying the cuts.
52 QGraphicsScene* scene;
53
54 // The dialog that asks what settings to use. We keep this around and reuse it as necessary.
55 CutDialog* cutDialog;
56
57 // The directory that the last file was opened from.
58 QString lastOpenDir;
59
60 // Timer for the cutting animation.
61 QTimer* animationTimer;
62 // The circle that marks where the cutter blade is.
63 QGraphicsItem* cutMarker;
64 // Cut marker progress.
65 int cutMarkerPath; // Current path.
66 int cutMarkerLine; // Current line in path
67 double cutMarkerDistance; // Current distance along edge.
68
69 QSizeF mediaSize;
70
71 QString filename;
72
73 public:
74 int sortFlag;
75 int tspFlag;
76 int cutFlag;
77 char *fileValue;
78
79 private slots:
80 void on_actionZoom_Out_triggered();
81 void on_actionZoom_In_triggered();
82 void on_actionReset_triggered();
83 void on_actionAnimate_toggled(bool animate);
84 void on_actionManual_triggered();
85 void on_actionCut_triggered();
86 void on_actionExit_triggered();
87 void on_actionAbout_triggered();
88 void on_actionOpen_triggered();
89 void on_actionReload_triggered();
90 void on_actionIdentify_triggered();
91
92 // Advance the cutting animation frame.
93 void animate();
94
95 private:
96 // Use empty string to indicate no file is loaded.
97 void setFileLoaded(QString filename);
98 bool eventFilter(QObject *o, QEvent *e);
99 void loadFile();
100 };