summaryrefslogtreecommitdiff
path: root/src/cgaladv.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-08-28 19:21:44 (GMT)
committerMarius Kintel <marius@kintel.net>2010-10-31 00:42:38 (GMT)
commitd0390c41a2268ce23d3010c7085e4365725d2f49 (patch)
treed3f2e6b0cc58a66ff759740ddcf27191335076aa /src/cgaladv.cc
parent93f3d4a1b6251523428179261dc070df44b0b317 (diff)
Added AbstractNode::name(), changed CSGTextRenderer to use this instead of the rtti name
Diffstat (limited to 'src/cgaladv.cc')
-rw-r--r--src/cgaladv.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/cgaladv.cc b/src/cgaladv.cc
index 0b38bc0..d71e5b0 100644
--- a/src/cgaladv.cc
+++ b/src/cgaladv.cc
@@ -63,6 +63,21 @@ public:
return visitor.visit(state, *this);
}
virtual std::string toString() const;
+ virtual std::string name() const {
+ switch (this->type) {
+ case MINKOWSKI:
+ return "minkowski";
+ break;
+ case GLIDE:
+ return "glide";
+ break;
+ case SUBDIV:
+ return "subdiv";
+ break;
+ default:
+ assert(false);
+ }
+ }
Value path;
QString subdiv_type;
@@ -134,15 +149,16 @@ std::string CgaladvNode::toString() const
{
std::stringstream stream;
+ stream << this->name();
switch (type) {
case MINKOWSKI:
- stream << "minkowski(convexity = " << this->convexity << ")";
+ stream << "(convexity = " << this->convexity << ")";
break;
case GLIDE:
- stream << "glide(path = " << this->path.dump() << ", convexity = " << this->convexity << ")";
+ stream << "(path = " << this->path.dump() << ", convexity = " << this->convexity << ")";
break;
case SUBDIV:
- stream << "subdiv(level = " << this->level << ", convexity = " << this->convexity << ")";
+ stream << "(level = " << this->level << ", convexity = " << this->convexity << ")";
break;
default:
assert(false);
contact: Jan Huwald // Impressum