summaryrefslogtreecommitdiff
path: root/src/node.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/node.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/node.cc')
-rw-r--r--src/node.cc63
1 files changed, 10 insertions, 53 deletions
diff --git a/src/node.cc b/src/node.cc
index 437fdfa..87a7051 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -29,9 +29,7 @@
#include "csgterm.h"
#include "progress.h"
#include "polyset.h"
-#include "visitor.h"
#include <QRegExp>
-#include <sstream>
int AbstractNode::idx_counter;
@@ -47,21 +45,6 @@ AbstractNode::~AbstractNode()
delete v;
}
-Response AbstractNode::accept(const class State &state, Visitor &visitor) const
-{
- return visitor.visit(state, *this);
-}
-
-Response AbstractIntersectionNode::accept(const class State &state, Visitor &visitor) const
-{
- return visitor.visit(state, *this);
-}
-
-Response AbstractPolyNode::accept(const class State &state, Visitor &visitor) const
-{
- return visitor.visit(state, *this);
-}
-
QString AbstractNode::mk_cache_id() const
{
QString cache_id = dump("");
@@ -96,19 +79,19 @@ static CGAL_Nef_polyhedron render_cgal_nef_polyhedron_backend(const AbstractNode
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) {
if (intersect)
- N.p2 *= v->renderCSGMesh().p2;
+ N.p2 *= v->render_cgal_nef_polyhedron().p2;
else
- N.p2 += v->renderCSGMesh().p2;
+ N.p2 += v->render_cgal_nef_polyhedron().p2;
} else {
if (intersect)
- N.p3 *= v->renderCSGMesh().p3;
+ N.p3 *= v->render_cgal_nef_polyhedron().p3;
else
- N.p3 += v->renderCSGMesh().p3;
+ N.p3 += v->render_cgal_nef_polyhedron().p3;
}
v->progress_report();
}
@@ -120,12 +103,12 @@ static CGAL_Nef_polyhedron render_cgal_nef_polyhedron_backend(const AbstractNode
return N;
}
-CGAL_Nef_polyhedron AbstractNode::renderCSGMesh() const
+CGAL_Nef_polyhedron AbstractNode::render_cgal_nef_polyhedron() const
{
return render_cgal_nef_polyhedron_backend(this, false);
}
-CGAL_Nef_polyhedron AbstractIntersectionNode::renderCSGMesh() const
+CGAL_Nef_polyhedron AbstractIntersectionNode::render_cgal_nef_polyhedron() const
{
return render_cgal_nef_polyhedron_backend(this, true);
}
@@ -176,17 +159,10 @@ QString AbstractNode::dump(QString indent) const
return dump_cache;
}
-std::string AbstractNode::toString() const
-{
- std::stringstream stream;
- stream << "n" << this->index() << ": group()";
- return stream.str();
-}
-
QString AbstractIntersectionNode::dump(QString indent) const
{
if (dump_cache.isEmpty()) {
- QString text = indent + QString::fromStdString(this->toString()) + " {\n";
+ QString text = indent + QString("n%1: intersection() {\n").arg(idx);
foreach (AbstractNode *v, children)
text += v->dump(indent + QString("\t"));
((AbstractNode*)this)->dump_cache = text + indent + "}\n";
@@ -194,13 +170,6 @@ QString AbstractIntersectionNode::dump(QString indent) const
return dump_cache;
}
-std::string AbstractIntersectionNode::toString() const
-{
- std::stringstream stream;
- stream << "n" << this->index() << ": intersection()";
- return stream.str();
-}
-
void AbstractNode::progress_prepare()
{
foreach (AbstractNode *v, children)
@@ -215,7 +184,7 @@ void AbstractNode::progress_report() const
#ifdef ENABLE_CGAL
-CGAL_Nef_polyhedron AbstractPolyNode::renderCSGMesh() const
+CGAL_Nef_polyhedron AbstractPolyNode::render_cgal_nef_polyhedron() const
{
QString cache_id = mk_cache_id();
if (cgal_nef_cache.contains(cache_id)) {
@@ -228,7 +197,7 @@ CGAL_Nef_polyhedron AbstractPolyNode::renderCSGMesh() const
PolySet *ps = render_polyset(RENDER_CGAL);
try {
- CGAL_Nef_polyhedron N = ps->renderCSGMesh();
+ CGAL_Nef_polyhedron N = ps->render_cgal_nef_polyhedron();
cgal_nef_cache.insert(cache_id, new cgal_nef_cache_entry(N), N.weight());
print_messages_pop();
progress_report();
@@ -262,15 +231,3 @@ CSGTerm *AbstractPolyNode::render_csg_term_from_ps(double m[20], QVector<CSGTerm
return t;
}
-std::ostream &operator<<(std::ostream &stream, const QString &str)
-{
- stream << str.toStdString();
- return stream;
-}
-
-std::ostream &operator<<(std::ostream &stream, const AbstractNode &node)
-{
- stream << node.toString();
- return stream;
-}
-
contact: Jan Huwald // Impressum