#1567 background and highlight objects were not cleared between renders

This commit is contained in:
Marius Kintel 2016-01-25 01:25:49 -05:00
parent aee6119f00
commit 1c01100db7

View file

@ -1191,24 +1191,30 @@ void MainWindow::compileCSG(bool procevents)
PRINTB("Compiling highlights (%d CSG Trees)...", highlight_terms.size());
if (procevents) QApplication::processEvents();
highlights_products.reset(new CSGProducts());
this->highlights_products.reset(new CSGProducts());
for (unsigned int i = 0; i < highlight_terms.size(); i++) {
shared_ptr<CSGNode> nterm = normalizer.normalize(highlight_terms[i]);
highlights_products->import(nterm);
this->highlights_products->import(nterm);
}
}
else {
this->highlights_products.reset();
}
const std::vector<shared_ptr<CSGNode> > &background_terms = csgrenderer.getBackgroundNodes();
if (background_terms.size() > 0) {
PRINTB("Compiling background (%d CSG Trees)...", background_terms.size());
if (procevents) QApplication::processEvents();
background_products.reset(new CSGProducts());
this->background_products.reset(new CSGProducts());
for (unsigned int i = 0; i < background_terms.size(); i++) {
shared_ptr<CSGNode> nterm = normalizer.normalize(background_terms[i]);
background_products->import(nterm);
this->background_products->import(nterm);
}
}
else {
this->background_products.reset();
}
if (this->root_products &&
(this->root_products->size() >