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/projection.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/projection.cc')
-rw-r--r-- | src/projection.cc | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/src/projection.cc b/src/projection.cc index 75aaf44..fa45ff3 100644 --- a/src/projection.cc +++ b/src/projection.cc @@ -32,6 +32,7 @@ #include "dxftess.h" #include "polyset.h" #include "export.h" +#include "progress.h" #include <sys/types.h> #include <sys/stat.h> @@ -95,17 +96,6 @@ void register_builtin_projection() #ifdef ENABLE_CGAL -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(); -} - PolySet *ProjectionNode::render_polyset(render_mode_e rm) const { QString key = mk_cache_id(); @@ -116,24 +106,6 @@ PolySet *ProjectionNode::render_polyset(render_mode_e rm) const print_messages_push(); - QTime t; - QProgressDialog *pd = NULL; - - if (rm == RENDER_OPENCSG) - { - PRINT_NOCACHE("Processing uncached projection body..."); - QApplication::processEvents(); - - t.start(); - 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); - } - CGAL_Nef_polyhedron N; N.dim = 3; foreach(AbstractNode *v, this->children) { @@ -142,13 +114,6 @@ PolySet *ProjectionNode::render_polyset(render_mode_e rm) const N.p3 += v->render_cgal_nef_polyhedron().p3; } - if (rm == RENDER_OPENCSG) { - 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 = new PolySet(); ps->convexity = this->convexity; ps->is2d = true; |