summaryrefslogtreecommitdiff
path: root/src/projection.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-04-27 05:01:45 (GMT)
committerMarius Kintel <marius@kintel.net>2013-04-27 05:01:45 (GMT)
commit17df3f6275fce73119c311cc73a6ad057d3b47ee (patch)
tree6c907e241b53c40c10743bbf08754b86a13f6457 /src/projection.cc
parent6b3daa748543f13cc7cf8eff1c9efeebd6dc3a14 (diff)
parent7858b0443e7fb09134f2b69a535417688353c0bb (diff)
Merge pull request #328 from openscad/issue116
Issue116
Diffstat (limited to 'src/projection.cc')
-rw-r--r--src/projection.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/projection.cc b/src/projection.cc
index 1fcf639..eeed411 100644
--- a/src/projection.cc
+++ b/src/projection.cc
@@ -26,7 +26,7 @@
#include "projectionnode.h"
#include "module.h"
-#include "context.h"
+#include "evalcontext.h"
#include "printutils.h"
#include "builtin.h"
#include "visitor.h"
@@ -41,19 +41,18 @@ class ProjectionModule : public AbstractModule
{
public:
ProjectionModule() { }
- virtual AbstractNode *evaluate(const Context *ctx, const ModuleInstantiation *inst) const;
+ virtual AbstractNode *evaluate(const Context *ctx, const ModuleInstantiation *inst, const EvalContext *evalctx) const;
};
-AbstractNode *ProjectionModule::evaluate(const Context *ctx, const ModuleInstantiation *inst) const
+AbstractNode *ProjectionModule::evaluate(const Context *ctx, const ModuleInstantiation *inst, const EvalContext *evalctx) const
{
ProjectionNode *node = new ProjectionNode(inst);
- std::vector<std::string> argnames;
- argnames += "cut";
- std::vector<Expression*> argexpr;
+ AssignmentList args;
+ args += Assignment("cut", NULL);
Context c(ctx);
- c.args(argnames, argexpr, inst->argnames, inst->argvalues);
+ c.setVariables(args, evalctx);
Value convexity = c.lookup_variable("convexity", true);
Value cut = c.lookup_variable("cut", true);
@@ -63,7 +62,7 @@ AbstractNode *ProjectionModule::evaluate(const Context *ctx, const ModuleInstant
if (cut.type() == Value::BOOL)
node->cut_mode = cut.toBool();
- std::vector<AbstractNode *> evaluatednodes = inst->evaluateChildren();
+ std::vector<AbstractNode *> evaluatednodes = inst->evaluateChildren(evalctx);
node->children.insert(node->children.end(), evaluatednodes.begin(), evaluatednodes.end());
return node;
contact: Jan Huwald // Impressum