diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-09-12 22:40:51 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2011-09-12 22:40:51 (GMT) |
commit | f5f06c8e976ca45aebea42fe8c04bf7404357ac8 (patch) | |
tree | 8d0cdd2698e7806c1b12cc49e743b561e1082961 /src/projection.cc | |
parent | 007c40848db9efd704694f2e7596cabed80da50f (diff) | |
parent | 5ac9162f1c67fd21737ead11d7ebc638bf4eef5f (diff) |
merge
Merge remote branch 'upstream/visitor' into visitortests
Conflicts:
src/export.cc
src/openscad.cc
src/polyset.cc
src/transform.cc
tests/CMakeLists.txt
tests/FindGLEW.cmake
tests/csgtermtest.cc
Diffstat (limited to 'src/projection.cc')
-rw-r--r-- | src/projection.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/projection.cc b/src/projection.cc index 67bd683..2c9d821 100644 --- a/src/projection.cc +++ b/src/projection.cc @@ -44,10 +44,8 @@ #include <assert.h> #include <sstream> - -#include <QApplication> -#include <QTime> -#include <QProgressDialog> +#include <boost/assign/std/vector.hpp> +using namespace boost::assign; // bring 'operator+=()' into scope class ProjectionModule : public AbstractModule { @@ -60,8 +58,9 @@ AbstractNode *ProjectionModule::evaluate(const Context *ctx, const ModuleInstant { ProjectionNode *node = new ProjectionNode(inst); - QVector<QString> argnames = QVector<QString>() << "cut"; - QVector<Expression*> argexpr; + std::vector<std::string> argnames; + argnames += "cut"; + std::vector<Expression*> argexpr; Context c(ctx); c.args(argnames, argexpr, inst->argnames, inst->argvalues); @@ -74,27 +73,22 @@ AbstractNode *ProjectionModule::evaluate(const Context *ctx, const ModuleInstant if (cut.type == Value::BOOL) node->cut_mode = cut.b; - foreach (ModuleInstantiation *v, inst->children) { - AbstractNode *n = v->evaluate(inst->ctx); - if (n) - node->children.push_back(n); - } + std::vector<AbstractNode *> evaluatednodes = inst->evaluateChildren(); + node->children.insert(node->children.end(), evaluatednodes.begin(), evaluatednodes.end()); return node; } -PolySet *ProjectionNode::evaluate_polyset(render_mode_e mode, PolySetEvaluator *evaluator) const +PolySet *ProjectionNode::evaluate_polyset(PolySetEvaluator *evaluator) const { if (!evaluator) { PRINTF("WARNING: No suitable PolySetEvaluator found for %s module!", this->name().c_str()); - PolySet *ps = new PolySet(); - ps->is2d = true; - return ps; + return NULL; } print_messages_push(); - PolySet *ps = evaluator->evaluatePolySet(*this, mode); + PolySet *ps = evaluator->evaluatePolySet(*this); print_messages_pop(); |