summaryrefslogtreecommitdiff
path: root/src/CSGTermEvaluator.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-09 03:53:05 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-09 03:53:05 (GMT)
commitcbba974d3ac1edeb716a1384a2262ed5447fa9e6 (patch)
tree30708ef085204435d644c4ab685b87556628d22a /src/CSGTermEvaluator.cc
parent328897c1f28e0d438aa678891f8d5a45b114f267 (diff)
Initial attempt of cleaning up polyset handling. PolySet no longer keeps a refcount, basic cache mechanism is in place, instantiating polysets are controlled through PolySetEvaluator
Diffstat (limited to 'src/CSGTermEvaluator.cc')
-rw-r--r--src/CSGTermEvaluator.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc
index dafa6a6..40e46b9 100644
--- a/src/CSGTermEvaluator.cc
+++ b/src/CSGTermEvaluator.cc
@@ -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) {
+ PolySet *ps = this->psevaluator->getPolySet(node);
+ 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;
if (this->psevaluator) {
- ps = this->psevaluator->evaluatePolySet(node, AbstractPolyNode::RENDER_OPENCSG);
+ ps = this->psevaluator->getPolySet(node);
}
if (ps) {
t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background,
@@ -204,7 +205,7 @@ Response CSGTermEvaluator::visit(State &state, const CgaladvNode &node)
// FIXME: Calling evaluator directly since we're not a PolyNode. Generalize this.
PolySet *ps = NULL;
if (this->psevaluator) {
- ps = this->psevaluator->evaluatePolySet(node, AbstractPolyNode::RENDER_OPENCSG);
+ ps = this->psevaluator->getPolySet(node);
}
if (ps) {
t1 = evaluate_csg_term_from_ps(state, this->highlights, this->background,
contact: Jan Huwald // Impressum