summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index a169ab1..1b90b60 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -45,6 +45,7 @@
#include "ProgressWidget.h"
#endif
#include "ThrownTogetherRenderer.h"
+#include "csgtermnormalizer.h"
#include <QMenu>
#include <QTime>
@@ -782,15 +783,8 @@ void MainWindow::compileCSG(bool procevents)
if (procevents)
QApplication::processEvents();
- this->root_norm_term = this->root_raw_term;
-
- // CSG normalization
- while (1) {
- shared_ptr<CSGTerm> n = CSGTerm::normalize(this->root_norm_term);
- if (this->root_norm_term == n) break;
- this->root_norm_term = n;
- }
-
+ CSGTermNormalizer normalizer;
+ this->root_norm_term = normalizer.normalize(this->root_raw_term);
assert(this->root_norm_term);
root_chain = new CSGChain();
@@ -804,11 +798,7 @@ void MainWindow::compileCSG(bool procevents)
highlights_chain = new CSGChain();
for (unsigned int i = 0; i < highlight_terms.size(); i++) {
- while (1) {
- shared_ptr<CSGTerm> n = CSGTerm::normalize(highlight_terms[i]);
- if (highlight_terms[i] == n) break;
- highlight_terms[i] = n;
- }
+ highlight_terms[i] = normalizer.normalize(highlight_terms[i]);
highlights_chain->import(highlight_terms[i]);
}
}
@@ -821,11 +811,7 @@ void MainWindow::compileCSG(bool procevents)
background_chain = new CSGChain();
for (unsigned int i = 0; i < background_terms.size(); i++) {
- while (1) {
- shared_ptr<CSGTerm> n = CSGTerm::normalize(background_terms[i]);
- if (background_terms[i] == n) break;
- background_terms[i] = n;
- }
+ background_terms[i] = normalizer.normalize(background_terms[i]);
background_chain->import(background_terms[i]);
}
}
contact: Jan Huwald // Impressum