diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-27 13:46:10 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-27 13:46:10 (GMT) |
commit | bac92dbd0ecb7b9535b9acbcd019c88ff9981b4a (patch) | |
tree | 3e02392a80d53d54e289328d478922328e32fb4e /src/mainwin.cc | |
parent | e502fab71d998c0bd025512c0c3884a1117479d1 (diff) | |
parent | 546ed1690486443e6780c1509626de8758a73498 (diff) |
Merge branch 'master' into color-priority
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 24 |
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]); } } |