diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-11 05:33:18 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-11 05:33:18 (GMT) |
commit | c0641d6916775309d64944ca121cc736f0c8d7a1 (patch) | |
tree | 801e0b5d67d13ff4773c5906c9cb68d271a2be02 /src/CSGTermEvaluator.cc | |
parent | 09cc0496f7ce61e2bcbce80e067e0fac8054599a (diff) |
Reenabled PolySet caching. Pass shared_ptrs to polysets around to better manage memory
Diffstat (limited to 'src/CSGTermEvaluator.cc')
-rw-r--r-- | src/CSGTermEvaluator.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc index 40e46b9..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(); @@ -109,7 +109,7 @@ Response CSGTermEvaluator::visit(State &state, const AbstractPolyNode &node) if (state.isPostfix()) { CSGTerm *t1 = NULL; if (this->psevaluator) { - PolySet *ps = this->psevaluator->getPolySet(node); + 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); @@ -184,9 +184,9 @@ Response CSGTermEvaluator::visit(State &state, const RenderNode &node) { if (state.isPostfix()) { CSGTerm *t1 = NULL; - PolySet *ps = NULL; + shared_ptr<PolySet> ps; if (this->psevaluator) { - ps = this->psevaluator->getPolySet(node); + ps = this->psevaluator->getPolySet(node, true); } if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, @@ -203,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->getPolySet(node); + ps = this->psevaluator->getPolySet(node, true); } if (ps) { t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background, |