summaryrefslogtreecommitdiff
path: root/MainWindow.h
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-09 14:25:09 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-09 14:25:09 (GMT)
commit1a3769d5952b09c5cf1a6864bdf1925b380d8042 (patch)
tree6e2316450ff7c673dba14491f52f1a96aa847a00 /MainWindow.h
parentc8baf2b227a23b1361a4fa160ef1c183ef24f431 (diff)
Extracted MainWindow.h from openscad.h, moved GUI definition to MainWindow.ui. NB! This is not thoroughly tested yet
git-svn-id: http://svn.clifford.at/openscad/trunk@155 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'MainWindow.h')
-rw-r--r--MainWindow.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/MainWindow.h b/MainWindow.h
new file mode 100644
index 0000000..39609cd
--- /dev/null
+++ b/MainWindow.h
@@ -0,0 +1,114 @@
+#ifndef MAINWINDOW_H_
+#define MAINWINDOW_H_
+
+#include <QMainWindow>
+#include "ui_MainWindow.h"
+#include "openscad.h"
+
+class MainWindow : public QMainWindow, public Ui::MainWindow
+{
+ Q_OBJECT
+
+public:
+ static QPointer<MainWindow> current_win;
+
+ QString filename;
+ class Highlighter *highlighter;
+
+ QTimer *animate_timer;
+ double tval, fps, fsteps;
+
+ Context root_ctx;
+ AbstractModule *root_module;
+ AbstractNode *absolute_root_node;
+ CSGTerm *root_raw_term;
+ CSGTerm *root_norm_term;
+ CSGChain *root_chain;
+#ifdef ENABLE_CGAL
+ CGAL_Nef_polyhedron *root_N;
+ bool recreate_cgal_ogl_p;
+ void *cgal_ogl_p;
+#endif
+
+ QVector<CSGTerm*> highlight_terms;
+ CSGChain *highlights_chain;
+ QVector<CSGTerm*> background_terms;
+ CSGChain *background_chain;
+ AbstractNode *root_node;
+ QString last_compiled_doc;
+ bool enableOpenCSG;
+
+ MainWindow(const char *filename = 0);
+ ~MainWindow();
+
+private slots:
+ void updatedFps();
+ void updateTVal();
+
+private:
+ void load();
+ void maybe_change_dir();
+ void find_root_tag(AbstractNode *n);
+ void compile(bool procevents);
+
+private slots:
+ void actionNew();
+ void actionOpen();
+ void actionSave();
+ void actionSaveAs();
+ void actionReload();
+
+private slots:
+ void editIndent();
+ void editUnindent();
+ void editComment();
+ void editUncomment();
+ void pasteViewportTranslation();
+ void pasteViewportRotation();
+
+private slots:
+ void actionReloadCompile();
+ void actionCompile();
+#ifdef ENABLE_CGAL
+ void actionRenderCGAL();
+#endif
+ void actionDisplayAST();
+ void actionDisplayCSGTree();
+ void actionDisplayCSGProducts();
+ void actionExportSTLorOFF(bool stl_mode);
+ void actionExportSTL();
+ void actionExportOFF();
+
+public:
+ void viewModeActionsUncheck();
+
+public slots:
+#ifdef ENABLE_OPENCSG
+ void viewModeOpenCSG();
+#endif
+#ifdef ENABLE_CGAL
+ void viewModeCGALSurface();
+ void viewModeCGALGrid();
+#endif
+ void viewModeThrownTogether();
+ void viewModeShowEdges();
+ void viewModeShowAxes();
+ void viewModeShowCrosshairs();
+ void viewModeAnimate();
+ void viewAngleTop();
+ void viewAngleBottom();
+ void viewAngleLeft();
+ void viewAngleRight();
+ void viewAngleFront();
+ void viewAngleBack();
+ void viewAngleDiagonal();
+ void viewCenter();
+ void viewPerspective();
+ void viewOrthogonal();
+ void animateUpdateDocChanged();
+ void animateUpdate();
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dropEvent(QDropEvent *event);
+};
+
+#endif
contact: Jan Huwald // Impressum