summaryrefslogtreecommitdiff
path: root/src/transform.cc
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-10-31 01:58:50 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-10-31 01:58:50 (GMT)
commite0c5673e1bf965fbb1bbbef2562a54be1a3144a3 (patch)
tree5996824c15ccca985630ff07294a5b79158e4d86 /src/transform.cc
parentb3f4c98c80acaa414f7bdacc86314d97267acba5 (diff)
Reverted accidental commits
git-svn-id: http://svn.clifford.at/openscad/trunk@573 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/transform.cc')
-rw-r--r--src/transform.cc48
1 files changed, 8 insertions, 40 deletions
diff --git a/src/transform.cc b/src/transform.cc
index 8f61c26..746283e 100644
--- a/src/transform.cc
+++ b/src/transform.cc
@@ -32,8 +32,6 @@
#include "dxftess.h"
#include "builtin.h"
#include "printutils.h"
-#include "visitor.h"
-#include <sstream>
enum transform_type_e {
SCALE,
@@ -55,15 +53,10 @@ public:
class TransformNode : public AbstractNode
{
public:
- TransformNode(const ModuleInstantiation *mi) : AbstractNode(mi) { }
- virtual Response accept(const class State &state, Visitor &visitor) const {
- return visitor.visit(state, *this);
- }
- virtual std::string toString() const;
-
double m[20];
+ TransformNode(const ModuleInstantiation *mi) : AbstractNode(mi) { }
#ifdef ENABLE_CGAL
- virtual CGAL_Nef_polyhedron renderCSGMesh() const;
+ virtual CGAL_Nef_polyhedron render_cgal_nef_polyhedron() const;
#endif
virtual CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
virtual QString dump(QString indent) const;
@@ -247,7 +240,7 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti
#ifdef ENABLE_CGAL
-CGAL_Nef_polyhedron TransformNode::renderCSGMesh() const
+CGAL_Nef_polyhedron TransformNode::render_cgal_nef_polyhedron() const
{
QString cache_id = mk_cache_id();
if (cgal_nef_cache.contains(cache_id)) {
@@ -265,13 +258,13 @@ CGAL_Nef_polyhedron TransformNode::renderCSGMesh() const
if (v->modinst->tag_background)
continue;
if (first) {
- N = v->renderCSGMesh();
+ N = v->render_cgal_nef_polyhedron();
if (N.dim != 0)
first = false;
} else if (N.dim == 2) {
- N.p2 += v->renderCSGMesh().p2;
+ N.p2 += v->render_cgal_nef_polyhedron().p2;
} else if (N.dim == 3) {
- N.p3 += v->renderCSGMesh().p3;
+ N.p3 += v->render_cgal_nef_polyhedron().p3;
}
v->progress_report();
}
@@ -298,7 +291,7 @@ CGAL_Nef_polyhedron TransformNode::renderCSGMesh() const
ps.is2d = true;
dxf_tesselate(&ps, &dd, 0, true, false, 0);
- N = ps.renderCSGMesh();
+ N = ps.render_cgal_nef_polyhedron();
ps.refcount = 0;
}
if (N.dim == 3) {
@@ -375,32 +368,6 @@ QString TransformNode::dump(QString indent) const
return dump_cache;
}
-std::string TransformNode::toString() const
-{
- std::stringstream stream;
- stream << "n" << this->index() << ": ";
-
- if (m[16] >= 0 || m[17] >= 0 || m[18] >= 0 || m[19] >= 0) {
- stream << "color([" << m[16] << ", " << m[17] << ", " << m[18] << ", " << m[19] << "])";
- }
- else {
- stream << "multmatrix([";
- for (int j=0;j<4;j++) {
- stream << "[";
- for (int i=0;i<4;i++) {
- // FIXME: The 0 test is to avoid a leading minus before a single 0 (cosmetics)
- stream << ((m[i*4+j]==0)?0:m[i*4+j]);
- if (i != 3) stream << ", ";
- }
- stream << "]";
- if (j != 3) stream << ", ";
- }
- stream << "])";
- }
-
- return stream.str();
-}
-
void register_builtin_transform()
{
builtin_modules["scale"] = new TransformModule(SCALE);
@@ -410,3 +377,4 @@ void register_builtin_transform()
builtin_modules["multmatrix"] = new TransformModule(MULTMATRIX);
builtin_modules["color"] = new TransformModule(COLOR);
}
+
contact: Jan Huwald // Impressum