From 6409f0e35412b3b13329bb207e260b7d28640b0f Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Tue, 4 Jun 2013 21:52:03 -0400 Subject: More frequent progress updates, progress updates also for CSG evaluation Conflicts: src/ProgressWidget.ui diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc index a6b654c..71cf149 100644 --- a/src/CSGTermEvaluator.cc +++ b/src/CSGTermEvaluator.cc @@ -115,6 +115,7 @@ Response CSGTermEvaluator::visit(State &state, const AbstractPolyNode &node) if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, ps, node.modinst, node); + node.progress_report(); } } this->stored_term[node.index()] = t1; @@ -178,6 +179,7 @@ Response CSGTermEvaluator::visit(State &state, const RenderNode &node) shared_ptr ps; if (this->psevaluator) { ps = this->psevaluator->getPolySet(node, true); + node.progress_report(); } if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, @@ -201,6 +203,7 @@ Response CSGTermEvaluator::visit(State &state, const CgaladvNode &node) if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, ps, node.modinst, node); + node.progress_report(); } this->stored_term[node.index()] = t1; addToParent(state, node); diff --git a/src/mainwin.cc b/src/mainwin.cc index 9c427cf..b4c1ed5 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -462,12 +462,12 @@ void MainWindow::showProgress() void MainWindow::report_func(const class AbstractNode*, void *vp, int mark) { MainWindow *thisp = static_cast(vp); - int v = (int)((mark*100.0) / progress_report_count); - int percent = v < 100 ? v : 99; - - if (percent > thisp->progresswidget->value()) { + int v = (int)((mark*1000.0) / progress_report_count); + int permille = v < 1000 ? v : 999; + printf("Progress: %d\n", permille); + if (permille > thisp->progresswidget->value()) { QMetaObject::invokeMethod(thisp->progresswidget, "setValue", Qt::QueuedConnection, - Q_ARG(int, percent)); + Q_ARG(int, permille)); QApplication::processEvents(); } -- cgit v0.10.1