summaryrefslogtreecommitdiff
path: root/src/CSGTermEvaluator.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-06 12:57:24 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-06 12:57:24 (GMT)
commit1e4e18c52451d2f04050cb44441b615398882c56 (patch)
tree0fc51c818db83632e983c0720d1e497c83fedb01 /src/CSGTermEvaluator.cc
parentfdd96a177c0fb3a94d317cb3e584b4881c09ea0e (diff)
minkowski sums should now work again
Diffstat (limited to 'src/CSGTermEvaluator.cc')
-rw-r--r--src/CSGTermEvaluator.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/CSGTermEvaluator.cc b/src/CSGTermEvaluator.cc
index b75babe..b59f4db 100644
--- a/src/CSGTermEvaluator.cc
+++ b/src/CSGTermEvaluator.cc
@@ -7,7 +7,9 @@
#include "transformnode.h"
#include "colornode.h"
#include "rendernode.h"
+#include "cgaladvnode.h"
#include "printutils.h"
+#include "PolySetEvaluator.h"
#include <string>
#include <map>
@@ -88,7 +90,7 @@ static CSGTerm *evaluate_csg_term_from_ps(const State &state,
vector<CSGTerm*> &background,
PolySet *ps,
const ModuleInstantiation *modinst,
- const AbstractPolyNode &node)
+ const AbstractNode &node)
{
std::stringstream stream;
stream << node.name() << node.index();
@@ -184,6 +186,25 @@ Response CSGTermEvaluator::visit(State &state, const RenderNode &node)
return ContinueTraversal;
}
+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;
+ if (this->psevaluator) {
+ ps = this->psevaluator->evaluatePolySet(node, AbstractPolyNode::RENDER_OPENCSG);
+ }
+ 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);
+ }
+ return ContinueTraversal;
+}
+
/*!
Adds ourself to out parent's list of traversed children.
Call this for _every_ node which affects output during the postfix traversal.
contact: Jan Huwald // Impressum