summaryrefslogtreecommitdiff
path: root/src/MainWindow.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-25 22:00:30 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-25 22:00:30 (GMT)
commit7c48b345b12981085bf6741208893a8206d77578 (patch)
treedec80733c559903f6c463a3827e4bf2e2cea562e /src/MainWindow.h
parent3e64e63b0113a99666ad68aa3e82bb7b80324d9b (diff)
Perform CGAL evaluation in a separate thread. First steps towards better GUI responsiveness and parallelization
Diffstat (limited to 'src/MainWindow.h')
-rw-r--r--src/MainWindow.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/MainWindow.h b/src/MainWindow.h
index 0f2a922..577209f 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -9,6 +9,7 @@
#include "Tree.h"
#include "memory.h"
#include <vector>
+#include <QMutex>
class MainWindow : public QMainWindow, public Ui::MainWindow
{
@@ -67,9 +68,7 @@ private slots:
void updateTVal();
void setFileName(const QString &filename);
void setFont(const QString &family, uint size);
-#ifdef USE_PROGRESSWIDGET
void showProgress();
-#endif
private:
void openFile(const QString &filename);
@@ -80,9 +79,7 @@ private:
bool maybeSave();
bool checkModified();
QString dumpCSGTree(AbstractNode *root);
- static void consoleOutput(const std::string &msg, void *userdata) {
- static_cast<MainWindow*>(userdata)->console->append(QString::fromStdString(msg));
- }
+ static void consoleOutput(const std::string &msg, void *userdata);
void loadViewSettings();
void loadDesignSettings();
@@ -110,6 +107,7 @@ private slots:
void actionCompile();
#ifdef ENABLE_CGAL
void actionRenderCGAL();
+ void actionRenderCGALDone(class CGAL_Nef_polyhedron *);
#endif
void actionDisplayAST();
void actionDisplayCSGTree();
@@ -163,6 +161,13 @@ public slots:
void actionReloadCompile();
void checkAutoReload();
void autoReloadSet(bool);
+
+private:
+ static void report_func(const class AbstractNode*, void *vp, int mark);
+
+ class ProgressWidget *progresswidget;
+ class CGALWorker *cgalworker;
+ QMutex consolemutex;
};
class GuiLocker
@@ -175,6 +180,8 @@ public:
gui_locked--;
}
static bool isLocked() { return gui_locked > 0; }
+ static void lock() { gui_locked++; }
+ static void unlock() { gui_locked--; }
private:
static unsigned int gui_locked;
contact: Jan Huwald // Impressum