summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-03-30 22:53:01 (GMT)
committerMarius Kintel <marius@kintel.net>2010-10-31 00:42:35 (GMT)
commit99f406d9941ef9fef8b2522ccbf6a72eb474f27a (patch)
treef9dc4a9f0e9e66fc8264044f4b6d663c87467a08
parenteb81def6ebfa0997798808408e3d27f03eff1996 (diff)
Removed temporary REMOVE_DUMP define
-rw-r--r--openscad.pro2
-rw-r--r--src/cgaladv.cc25
-rw-r--r--src/csgnode.h3
-rw-r--r--src/csgops.cc19
-rw-r--r--src/dxflinextrude.cc30
-rw-r--r--src/dxflinextrudenode.h3
-rw-r--r--src/dxfrotextrude.cc23
-rw-r--r--src/dxfrotextrudenode.h3
-rw-r--r--src/import.cc27
-rw-r--r--src/importnode.h3
-rw-r--r--src/node.cc28
-rw-r--r--src/node.h6
-rw-r--r--src/primitives.cc28
-rw-r--r--src/projection.cc16
-rw-r--r--src/projectionnode.h3
-rw-r--r--src/render.cc13
-rw-r--r--src/rendernode.h3
-rw-r--r--src/surface.cc16
-rw-r--r--src/transform.cc24
-rw-r--r--src/transformnode.h3
-rw-r--r--test-code/cgaltest.pro1
-rw-r--r--test-code/csgtexttest.pro1
-rw-r--r--test-code/dumptest.pro1
23 files changed, 1 insertions, 280 deletions
diff --git a/openscad.pro b/openscad.pro
index a785259..3df1a5f 100644
--- a/openscad.pro
+++ b/openscad.pro
@@ -9,8 +9,6 @@ UI_DIR = objects
RCC_DIR = objects
INCLUDEPATH += src
-DEFINES += REMOVE_DUMP
-
macx {
DEPLOYDIR = $$(MACOSX_DEPLOY_DIR)
!isEmpty(DEPLOYDIR) {
diff --git a/src/cgaladv.cc b/src/cgaladv.cc
index 260850a..87975d2 100644
--- a/src/cgaladv.cc
+++ b/src/cgaladv.cc
@@ -69,9 +69,6 @@ public:
int convexity, level;
cgaladv_type_e type;
virtual CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
AbstractNode *CgaladvModule::evaluate(const Context *ctx, const ModuleInstantiation *inst) const
@@ -160,28 +157,6 @@ CSGTerm *CgaladvNode::render_csg_term(double m[20], QVector<CSGTerm*> *highlight
#endif // ENABLE_CGAL
-#ifndef REMOVE_DUMP
-QString CgaladvNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- if (type == MINKOWSKI)
- text.sprintf("minkowski(convexity = %d) {\n", this->convexity);
- if (type == GLIDE) {
- text.sprintf(", convexity = %d) {\n", this->convexity);
- text = QString("glide(path = ") + this->path.dump() + text;
- }
- if (type == SUBDIV)
- text.sprintf("subdiv(level = %d, convexity = %d) {\n", this->level, this->convexity);
- foreach (AbstractNode *v, this->children)
- text += v->dump(indent + QString("\t"));
- text += indent + "}\n";
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string CgaladvNode::toString() const
{
std::stringstream stream;
diff --git a/src/csgnode.h b/src/csgnode.h
index 4601dc8..02039e9 100644
--- a/src/csgnode.h
+++ b/src/csgnode.h
@@ -21,9 +21,6 @@ public:
virtual std::string toString() const;
CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/src/csgops.cc b/src/csgops.cc
index 5ab12bc..dda523e 100644
--- a/src/csgops.cc
+++ b/src/csgops.cc
@@ -77,25 +77,6 @@ CSGTerm *CsgNode::render_csg_term(double m[20], QVector<CSGTerm*> *highlights, Q
return t1;
}
-#ifndef REMOVE_DUMP
-QString CsgNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text = indent + QString("n%1: ").arg(idx);
- if (type == CSG_TYPE_UNION)
- text += "union() {\n";
- if (type == CSG_TYPE_DIFFERENCE)
- text += "difference() {\n";
- if (type == CSG_TYPE_INTERSECTION)
- text += "intersection() {\n";
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- ((AbstractNode*)this)->dump_cache = text + indent + "}\n";
- }
- return dump_cache;
-}
-#endif
-
std::string CsgNode::toString() const
{
std::stringstream stream;
diff --git a/src/dxflinextrude.cc b/src/dxflinextrude.cc
index d162b9f..b704c35 100644
--- a/src/dxflinextrude.cc
+++ b/src/dxflinextrude.cc
@@ -152,36 +152,6 @@ PolySet *DxfLinearExtrudeNode::render_polyset(render_mode_e mode) const
return ps;
}
-#ifndef REMOVE_DUMP
-QString DxfLinearExtrudeNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- struct stat st;
- memset(&st, 0, sizeof(struct stat));
- stat(filename.toAscii().data(), &st);
- text.sprintf("linear_extrude(file = \"%s\", cache = \"%x.%x\", layer = \"%s\", "
- "height = %g, origin = [ %g %g ], scale = %g, center = %s, convexity = %d",
- filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size,
- layername.toAscii().data(), height, origin_x, origin_y, scale,
- center ? "true" : "false", convexity);
- if (has_twist) {
- QString t2;
- t2.sprintf(", twist = %g, slices = %d", twist, slices);
- text += t2;
- }
- QString t3;
- t3.sprintf(", $fn = %g, $fa = %g, $fs = %g) {\n", fn, fa, fs);
- text += t3;
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- text += indent + "}\n";
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string DxfLinearExtrudeNode::toString() const
{
std::stringstream stream;
diff --git a/src/dxflinextrudenode.h b/src/dxflinextrudenode.h
index 3fa87c1..9ae9549 100644
--- a/src/dxflinextrudenode.h
+++ b/src/dxflinextrudenode.h
@@ -24,9 +24,6 @@ public:
bool center, has_twist;
QString filename, layername;
virtual PolySet *render_polyset(render_mode_e mode) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/src/dxfrotextrude.cc b/src/dxfrotextrude.cc
index c1f8af1..a84097f 100644
--- a/src/dxfrotextrude.cc
+++ b/src/dxfrotextrude.cc
@@ -129,29 +129,6 @@ PolySet *DxfRotateExtrudeNode::render_polyset(render_mode_e mode) const
return ps;
}
-#ifndef REMOVE_DUMP
-QString DxfRotateExtrudeNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- struct stat st;
- memset(&st, 0, sizeof(struct stat));
- stat(filename.toAscii().data(), &st);
- text.sprintf("rotate_extrude(file = \"%s\", cache = \"%x.%x\", layer = \"%s\", "
- "origin = [ %g %g ], scale = %g, convexity = %d, "
- "$fn = %g, $fa = %g, $fs = %g) {\n",
- filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size,
- layername.toAscii().data(), origin_x, origin_y, scale, convexity,
- fn, fa, fs);
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- text += indent + "}\n";
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string DxfRotateExtrudeNode::toString() const
{
std::stringstream stream;
diff --git a/src/dxfrotextrudenode.h b/src/dxfrotextrudenode.h
index b2f4a38..33a9bae 100644
--- a/src/dxfrotextrudenode.h
+++ b/src/dxfrotextrudenode.h
@@ -22,9 +22,6 @@ public:
double origin_x, origin_y, scale;
QString filename, layername;
virtual PolySet *render_polyset(render_mode_e mode) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/src/import.cc b/src/import.cc
index 99b7eeb..aeda529 100644
--- a/src/import.cc
+++ b/src/import.cc
@@ -189,33 +189,6 @@ PolySet *ImportNode::render_polyset(render_mode_e) const
return p;
}
-#ifndef REMOVE_DUMP
-QString ImportNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- struct stat st;
- memset(&st, 0, sizeof(struct stat));
- stat(filename.toAscii().data(), &st);
- if (type == TYPE_STL)
- text.sprintf("import_stl(file = \"%s\", cache = \"%x.%x\", convexity = %d);\n",
- filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size, convexity);
- if (type == TYPE_OFF)
- text.sprintf("import_off(file = \"%s\", cache = \"%x.%x\", convexity = %d);\n",
- filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size, convexity);
- if (type == TYPE_DXF)
- text.sprintf("import_dxf(file = \"%s\", cache = \"%x.%x\", layer = \"%s\", "
- "origin = [ %g %g ], scale = %g, convexity = %d, "
- "$fn = %g, $fa = %g, $fs = %g);\n",
- filename.toAscii().data(), (int)st.st_mtime, (int)st.st_size,
- layername.toAscii().data(), origin_x, origin_y, scale, convexity,
- fn, fa, fs);
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string ImportNode::toString() const
{
std::stringstream stream;
diff --git a/src/importnode.h b/src/importnode.h
index 7e71d45..01c87ca 100644
--- a/src/importnode.h
+++ b/src/importnode.h
@@ -26,9 +26,6 @@ public:
double fn, fs, fa;
double origin_x, origin_y, scale;
virtual PolySet *render_polyset(render_mode_e mode) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/src/node.cc b/src/node.cc
index 0cdf5d7..dc2fc0c 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -64,19 +64,7 @@ Response AbstractPolyNode::accept(const class State &state, Visitor &visitor) co
return visitor.visit(state, *this);
}
-#ifndef REMOVE_DUMP
-QString AbstractNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text = indent + QString("n%1: group() {\n").arg(idx);
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- ((AbstractNode*)this)->dump_cache = text + indent + "}\n";
- }
- return dump_cache;
-}
-#else
-// Temporarily offer a top-level dump function to keep existing code running
+// FIXME: Temporarily offer a top-level dump function to keep existing code running
QString AbstractNode::dump() const
{
NodeDumper dumper;
@@ -84,7 +72,6 @@ QString AbstractNode::dump() const
trav.execute();
return QString::fromStdString(dumper.getDump() + "\n");
}
-#endif
std::string AbstractNode::toString() const
{
@@ -93,19 +80,6 @@ std::string AbstractNode::toString() const
return stream.str();
}
-#ifndef REMOVE_DUMP
-QString AbstractIntersectionNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text = indent + QString::fromStdString(this->toString()) + " {\n";
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- ((AbstractNode*)this)->dump_cache = text + indent + "}\n";
- }
- return dump_cache;
-}
-#endif
-
std::string AbstractIntersectionNode::toString() const
{
std::stringstream stream;
diff --git a/src/node.h b/src/node.h
index bb3d645..df2529c 100644
--- a/src/node.h
+++ b/src/node.h
@@ -54,9 +54,6 @@ public:
// FIXME: Remove these three with dump() method
virtual QString mk_cache_id() const;
QString dump() const;
-#ifndef REMOVE_DUMP
- QString dump_cache;
-#endif
// FIXME: Rewrite to visitor
virtual class CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
@@ -76,9 +73,6 @@ public:
virtual std::string toString() const;
virtual CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
class AbstractPolyNode : public AbstractNode
diff --git a/src/primitives.cc b/src/primitives.cc
index 4cfb1ce..16c6ab7 100644
--- a/src/primitives.cc
+++ b/src/primitives.cc
@@ -70,9 +70,6 @@ public:
int convexity;
Value points, paths, triangles;
virtual PolySet *render_polyset(render_mode_e mode) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
AbstractNode *PrimitiveModule::evaluate(const Context *ctx, const ModuleInstantiation *inst) const
@@ -529,31 +526,6 @@ sphere_next_r2:
return p;
}
-#ifndef REMOVE_DUMP
-QString PrimitiveNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- if (type == CUBE)
- text.sprintf("cube(size = [%g, %g, %g], center = %s);\n", x, y, z, center ? "true" : "false");
- if (type == SPHERE)
- text.sprintf("sphere($fn = %g, $fa = %g, $fs = %g, r = %g);\n", fn, fa, fs, r1);
- if (type == CYLINDER)
- text.sprintf("cylinder($fn = %g, $fa = %g, $fs = %g, h = %g, r1 = %g, r2 = %g, center = %s);\n", fn, fa, fs, h, r1, r2, center ? "true" : "false");
- if (type == POLYHEDRON)
- text.sprintf("polyhedron(points = %s, triangles = %s, convexity = %d);\n", points.dump().toAscii().data(), triangles.dump().toAscii().data(), convexity);
- if (type == SQUARE)
- text.sprintf("square(size = [%g, %g], center = %s);\n", x, y, center ? "true" : "false");
- if (type == CIRCLE)
- text.sprintf("circle($fn = %g, $fa = %g, $fs = %g, r = %g);\n", fn, fa, fs, r1);
- if (type == POLYGON)
- text.sprintf("polygon(points = %s, paths = %s, convexity = %d);\n", points.dump().toAscii().data(), paths.dump().toAscii().data(), convexity);
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string PrimitiveNode::toString() const
{
std::stringstream stream;
diff --git a/src/projection.cc b/src/projection.cc
index b4a19c7..83f0205 100644
--- a/src/projection.cc
+++ b/src/projection.cc
@@ -116,22 +116,6 @@ PolySet *ProjectionNode::render_polyset(render_mode_e mode) const
return ps;
}
-#ifndef REMOVE_DUMP
-QString ProjectionNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- text.sprintf("projection(cut = %s, convexity = %d) {\n",
- this->cut_mode ? "true" : "false", this->convexity);
- foreach (AbstractNode *v, this->children)
- text += v->dump(indent + QString("\t"));
- text += indent + "}\n";
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string ProjectionNode::toString() const
{
std::stringstream stream;
diff --git a/src/projectionnode.h b/src/projectionnode.h
index e59088c..06e693a 100644
--- a/src/projectionnode.h
+++ b/src/projectionnode.h
@@ -18,9 +18,6 @@ public:
int convexity;
bool cut_mode;
virtual PolySet *render_polyset(render_mode_e mode) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/src/render.cc b/src/render.cc
index 0e0ea51..0218e7f 100644
--- a/src/render.cc
+++ b/src/render.cc
@@ -203,19 +203,6 @@ CSGTerm *RenderNode::render_csg_term(double m[20], QVector<CSGTerm*> *highlights
#endif
-#ifndef REMOVE_DUMP
-QString RenderNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text = indent + QString("n%1: ").arg(idx) + QString("render(convexity = %1) {\n").arg(QString::number(convexity));
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- ((AbstractNode*)this)->dump_cache = text + indent + "}\n";
- }
- return dump_cache;
-}
-#endif
-
std::string RenderNode::toString() const
{
std::stringstream stream;
diff --git a/src/rendernode.h b/src/rendernode.h
index 5561a36..3df797e 100644
--- a/src/rendernode.h
+++ b/src/rendernode.h
@@ -15,9 +15,6 @@ public:
int convexity;
CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/src/surface.cc b/src/surface.cc
index cd40e97..a7b58a1 100644
--- a/src/surface.cc
+++ b/src/surface.cc
@@ -56,9 +56,6 @@ public:
bool center;
int convexity;
virtual PolySet *render_polyset(render_mode_e mode) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
AbstractNode *SurfaceModule::evaluate(const Context *ctx, const ModuleInstantiation *inst) const
@@ -206,19 +203,6 @@ PolySet *SurfaceNode::render_polyset(render_mode_e) const
return p;
}
-#ifndef REMOVE_DUMP
-QString SurfaceNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- text.sprintf("surface(file = \"%s\", center = %s);\n",
- filename.toAscii().data(), center ? "true" : "false");
- ((AbstractNode*)this)->dump_cache = indent + QString("n%1: ").arg(idx) + text;
- }
- return dump_cache;
-}
-#endif
-
std::string SurfaceNode::toString() const
{
std::stringstream stream;
diff --git a/src/transform.cc b/src/transform.cc
index 870ad32..0bbf9bd 100644
--- a/src/transform.cc
+++ b/src/transform.cc
@@ -263,30 +263,6 @@ CSGTerm *TransformNode::render_csg_term(double c[20], QVector<CSGTerm*> *highlig
return t1;
}
-#ifndef REMOVE_DUMP
-QString TransformNode::dump(QString indent) const
-{
- if (dump_cache.isEmpty()) {
- QString text;
- if (m[16] >= 0 || m[17] >= 0 || m[18] >= 0 || m[19] >= 0)
- text.sprintf("n%d: color([%g, %g, %g, %g])", idx,
- m[16], m[17], m[18], m[19]);
- else
- text.sprintf("n%d: multmatrix([[%g, %g, %g, %g], [%g, %g, %g, %g], "
- "[%g, %g, %g, %g], [%g, %g, %g, %g]])", idx,
- m[0], m[4], m[ 8], m[12],
- m[1], m[5], m[ 9], m[13],
- m[2], m[6], m[10], m[14],
- m[3], m[7], m[11], m[15]);
- text = indent + text + " {\n";
- foreach (AbstractNode *v, children)
- text += v->dump(indent + QString("\t"));
- ((AbstractNode*)this)->dump_cache = text + indent + "}\n";
- }
- return dump_cache;
-}
-#endif
-
std::string TransformNode::toString() const
{
std::stringstream stream;
diff --git a/src/transformnode.h b/src/transformnode.h
index a392107..33efa63 100644
--- a/src/transformnode.h
+++ b/src/transformnode.h
@@ -15,9 +15,6 @@ public:
double m[20];
virtual CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
-#ifndef REMOVE_DUMP
- virtual QString dump(QString indent) const;
-#endif
};
#endif
diff --git a/test-code/cgaltest.pro b/test-code/cgaltest.pro
index 27eeb1a..c181046 100644
--- a/test-code/cgaltest.pro
+++ b/test-code/cgaltest.pro
@@ -7,7 +7,6 @@ UI_DIR = objects
RCC_DIR = objects
INCLUDEPATH += ../src
-DEFINES += REMOVE_DUMP REMOVE_RENDERCGAL
macx {
CONFIG -= app_bundle
LIBS += -framework Carbon
diff --git a/test-code/csgtexttest.pro b/test-code/csgtexttest.pro
index 43632ed..60dd731 100644
--- a/test-code/csgtexttest.pro
+++ b/test-code/csgtexttest.pro
@@ -7,7 +7,6 @@ UI_DIR = objects
RCC_DIR = objects
INCLUDEPATH += ../src
-DEFINES += REMOVE_DUMP
macx {
CONFIG -= app_bundle
LIBS += -framework Carbon
diff --git a/test-code/dumptest.pro b/test-code/dumptest.pro
index 9e42320..f861f9a 100644
--- a/test-code/dumptest.pro
+++ b/test-code/dumptest.pro
@@ -7,7 +7,6 @@ UI_DIR = objects
RCC_DIR = objects
INCLUDEPATH += ../src
-DEFINES += REMOVE_DUMP
TARGET = dumptest
macx {
CONFIG -= app_bundle
contact: Jan Huwald // Impressum