diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-11-25 20:47:54 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-11-25 20:47:54 (GMT) |
commit | 07acb6714e1c07531710b81b41dfd978bfce78d3 (patch) | |
tree | 097a8d039a8727c0bc65e419673160643b327946 /control.cc | |
parent | 14c9d3200ac21ab9fc8988289c355d6a5d219553 (diff) |
Clifford Wolf:
Added intersection_for()
git-svn-id: http://svn.clifford.at/openscad/trunk@138 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'control.cc')
-rw-r--r-- | control.cc | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -26,6 +26,7 @@ enum control_type_e { ECHO, ASSIGN, FOR, + INT_FOR, IF }; @@ -79,7 +80,12 @@ void for_eval(AbstractNode *node, int l, const QVector<QString> &call_argnames, AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstanciation *inst) const { - AbstractNode *node = new AbstractNode(inst); + AbstractNode *node; + + if (type == INT_FOR) + node = new AbstractIntersectionNode(inst); + else + node = new AbstractNode(inst); if (type == ECHO) { @@ -108,7 +114,7 @@ AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstanciation } } - if (type == FOR) + if (type == FOR || type == INT_FOR) { for_eval(node, 0, inst->argnames, inst->argvalues, inst->children, inst->ctx); } @@ -131,6 +137,7 @@ void register_builtin_control() builtin_modules["echo"] = new ControlModule(ECHO); builtin_modules["assign"] = new ControlModule(ASSIGN); builtin_modules["for"] = new ControlModule(FOR); + builtin_modules["intersection_for"] = new ControlModule(INT_FOR); builtin_modules["if"] = new ControlModule(IF); } |