summaryrefslogtreecommitdiff
path: root/module.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-06-23 19:56:46 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-06-23 19:56:46 (GMT)
commit4daae374011de97aafa999f2353e2c7d17511046 (patch)
treebc51daf75fb7d4be3d17ed4fd3206f08bf7d0aee /module.cc
parent0fcdcb6bd6117e8e8ccaff15b0a083c2f76266a6 (diff)
Clifford Wolf:
Added GUI git-svn-id: http://svn.clifford.at/openscad/trunk@13 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'module.cc')
-rw-r--r--module.cc36
1 files changed, 23 insertions, 13 deletions
diff --git a/module.cc b/module.cc
index 6c443de..9f9a21b 100644
--- a/module.cc
+++ b/module.cc
@@ -135,36 +135,42 @@ AbstractNode *Module::evaluate(const Context *ctx, const QVector<QString> &call_
QString Module::dump(QString indent, QString name) const
{
- QString text = QString("%1module %2(").arg(indent, name);
- for (int i=0; i < argnames.size(); i++) {
- if (i > 0)
- text += QString(", ");
- text += argnames[i];
- if (argexpr[i])
- text += QString(" = ") + argexpr[i]->dump();
+ QString text, tab;
+ if (!name.isEmpty()) {
+ text = QString("%1module %2(").arg(indent, name);
+ for (int i=0; i < argnames.size(); i++) {
+ if (i > 0)
+ text += QString(", ");
+ text += argnames[i];
+ if (argexpr[i])
+ text += QString(" = ") + argexpr[i]->dump();
+ }
+ text += QString(") {\n");
+ tab = "\t";
}
- text += QString(") {\n");
{
QHashIterator<QString, AbstractFunction*> i(functions);
while (i.hasNext()) {
i.next();
- text += i.value()->dump(indent + QString("\t"), i.key());
+ text += i.value()->dump(indent + tab, i.key());
}
}
{
QHashIterator<QString, AbstractModule*> i(modules);
while (i.hasNext()) {
i.next();
- text += i.value()->dump(indent + QString("\t"), i.key());
+ text += i.value()->dump(indent + tab, i.key());
}
}
for (int i = 0; i < assignments_var.size(); i++) {
- text += QString("%1\t%2 = %3;\n").arg(indent, assignments_var[i], assignments_expr[i]->dump());
+ text += QString("%1%2 = %3;\n").arg(indent + tab, assignments_var[i], assignments_expr[i]->dump());
}
for (int i = 0; i < children.size(); i++) {
- text += children[i]->dump(indent + QString("\t"));
+ text += children[i]->dump(indent + tab);
+ }
+ if (!name.isEmpty()) {
+ text += QString("%1}\n").arg(indent);
}
- text += QString("%1}\n").arg(indent);
return text;
}
@@ -192,6 +198,8 @@ AbstractNode::~AbstractNode()
delete v;
}
+#ifdef ENABLE_CGAL
+
CGAL_Nef_polyhedron AbstractNode::render_cgal_nef_polyhedron() const
{
CGAL_Nef_polyhedron N;
@@ -201,6 +209,8 @@ CGAL_Nef_polyhedron AbstractNode::render_cgal_nef_polyhedron() const
return N;
}
+#endif /* ENABLE_CGAL */
+
QString AbstractNode::dump(QString indent) const
{
QString text = indent + "group() {\n";
contact: Jan Huwald // Impressum