diff options
Diffstat (limited to 'src/CSGTermEvaluator.cc')
-rw-r--r-- | src/CSGTermEvaluator.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc index dafa6a6..ebea89c 100644 --- a/src/CSGTermEvaluator.cc +++ b/src/CSGTermEvaluator.cc @@ -86,11 +86,11 @@ Response CSGTermEvaluator::visit(State &state, const AbstractIntersectionNode &n } static CSGTerm *evaluate_csg_term_from_ps(const State &state, - vector<CSGTerm*> &highlights, - vector<CSGTerm*> &background, - PolySet *ps, - const ModuleInstantiation *modinst, - const AbstractNode &node) + vector<CSGTerm*> &highlights, + vector<CSGTerm*> &background, + const shared_ptr<PolySet> &ps, + const ModuleInstantiation *modinst, + const AbstractNode &node) { std::stringstream stream; stream << node.name() << node.index(); @@ -108,10 +108,12 @@ Response CSGTermEvaluator::visit(State &state, const AbstractPolyNode &node) { if (state.isPostfix()) { CSGTerm *t1 = NULL; - PolySet *ps = node.evaluate_polyset(AbstractPolyNode::RENDER_OPENCSG, this->psevaluator); - if (ps) { - t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, - ps, node.modinst, node); + if (this->psevaluator) { + shared_ptr<PolySet> ps = this->psevaluator->getPolySet(node, true); + if (ps) { + t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, + ps, node.modinst, node); + } } this->stored_term[node.index()] = t1; addToParent(state, node); @@ -182,10 +184,9 @@ Response CSGTermEvaluator::visit(State &state, const RenderNode &node) { if (state.isPostfix()) { CSGTerm *t1 = NULL; - // FIXME: Calling evaluator directly since we're not a PolyNode. Generalize this. - PolySet *ps = NULL; + shared_ptr<PolySet> ps; if (this->psevaluator) { - ps = this->psevaluator->evaluatePolySet(node, AbstractPolyNode::RENDER_OPENCSG); + ps = this->psevaluator->getPolySet(node, true); } if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, @@ -202,9 +203,9 @@ Response CSGTermEvaluator::visit(State &state, const CgaladvNode &node) if (state.isPostfix()) { CSGTerm *t1 = NULL; // FIXME: Calling evaluator directly since we're not a PolyNode. Generalize this. - PolySet *ps = NULL; + shared_ptr<PolySet> ps; if (this->psevaluator) { - ps = this->psevaluator->evaluatePolySet(node, AbstractPolyNode::RENDER_OPENCSG); + ps = this->psevaluator->getPolySet(node, true); } if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, |