diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-09 13:48:09 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-02-09 13:48:09 (GMT) |
commit | c7b9a49c15f10ee76258f735ff66c1ed32e64c51 (patch) | |
tree | ebc9ef37dc44c0eed9c144441f5f763c381fdb08 /src/render.cc | |
parent | 66ac9239767dd2151e61a11bc3fb9605c2a4d917 (diff) |
Cleaned up progress handling, implemented cancel function. Needs more testing
git-svn-id: http://svn.clifford.at/openscad/trunk@420 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/render.cc')
-rw-r--r-- | src/render.cc | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/render.cc b/src/render.cc index 27a9aa5..1081f5b 100644 --- a/src/render.cc +++ b/src/render.cc @@ -32,6 +32,7 @@ #include "csgterm.h" #include "builtin.h" #include "printutils.h" +#include "progress.h" #ifdef ENABLE_CGAL # include "cgal.h" #endif @@ -124,17 +125,6 @@ CGAL_Nef_polyhedron RenderNode::render_cgal_nef_polyhedron() const return N; } -static void report_func(const class AbstractNode*, void *vp, int mark) -{ - QProgressDialog *pd = (QProgressDialog*)vp; - int v = (int)((mark*100.0) / progress_report_count); - pd->setValue(v < 100 ? v : 99); - QString label; - label.sprintf("Rendering Polygon Mesh using CGAL (%d/%d)", mark, progress_report_count); - pd->setLabelText(label); - QApplication::processEvents(); -} - CSGTerm *RenderNode::render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const { QString key = mk_cache_id(); @@ -162,20 +152,10 @@ CSGTerm *RenderNode::render_csg_term(double m[20], QVector<CSGTerm*> *highlights QTime t; t.start(); - QProgressDialog *pd = new QProgressDialog("Rendering Polygon Mesh using CGAL...", QString(), 0, 100); - pd->setValue(0); - pd->setAutoClose(false); - pd->show(); - QApplication::processEvents(); - - progress_report_prep((AbstractNode*)this, report_func, pd); N = this->render_cgal_nef_polyhedron(); - progress_report_fin(); int s = t.elapsed() / 1000; PRINTF_NOCACHE("..rendering time: %d hours, %d minutes, %d seconds", s / (60*60), (s / 60) % 60, s % 60); - - delete pd; } PolySet *ps = NULL; |