diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-10-31 01:19:06 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-10-31 01:19:06 (GMT) |
commit | 53337ff65426ff1ebd87160b502ec383d201ac7b (patch) | |
tree | fbcb75d32e8763aac3f0ad28528936a0ec11930b /src/surface.cc | |
parent | 746159d1838e895e80725cdc892f7bef85feb1af (diff) |
Committed current version of visitor refactoring
git-svn-id: http://svn.clifford.at/openscad/trunk@571 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/surface.cc')
-rw-r--r-- | src/surface.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/surface.cc b/src/surface.cc index ddcd3a6..57b3f59 100644 --- a/src/surface.cc +++ b/src/surface.cc @@ -31,8 +31,10 @@ #include "dxftess.h" #include "printutils.h" #include "openscad.h" // handle_dep() +#include "visitor.h" #include <QFile> +#include <sstream> class SurfaceModule : public AbstractModule { @@ -44,10 +46,15 @@ public: class SurfaceNode : public AbstractPolyNode { public: + SurfaceNode(const ModuleInstantiation *mi) : AbstractPolyNode(mi) { } + virtual Response accept(const class State &state, Visitor &visitor) const { + return visitor.visit(state, *this); + } + virtual std::string toString() const; + QString filename; bool center; int convexity; - SurfaceNode(const ModuleInstantiation *mi) : AbstractPolyNode(mi) { } virtual PolySet *render_polyset(render_mode_e mode) const; virtual QString dump(QString indent) const; }; @@ -208,3 +215,13 @@ QString SurfaceNode::dump(QString indent) const return dump_cache; } +std::string SurfaceNode::toString() const +{ + std::stringstream stream; + stream << "n" << this->index() << ": "; + + stream << "surface(file = \"" << this->filename + << "\", center = " << (this->center ? "true" : "false") << ")"; + + return stream.str(); +} |