diff options
author | Marius Kintel <marius@kintel.net> | 2010-04-12 00:16:36 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-10-31 00:42:35 (GMT) |
commit | e8e213b3c9ce0580045ea6e7e86b00ab41d4c58b (patch) | |
tree | cb32e67b6334aa1f1dc62aa4a0686a22782e7f77 /src/node.cc | |
parent | 53a9953b7dc4ab4a366046c91529b32fb6652551 (diff) |
Another refactoring session:
o mk_cache_id() obsoleted by removing the node index from the dump
o node index output removed from each node and make optional in NodeDumper
o The visitors are no longer global, but associated with a tree
o Added Tree class to manage node trees and the (now implicit) dump cache
o Moved PolySet cache into PolySetRenderer
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/node.cc b/src/node.cc index dc2fc0c..69c0692 100644 --- a/src/node.cc +++ b/src/node.cc @@ -64,26 +64,17 @@ Response AbstractPolyNode::accept(const class State &state, Visitor &visitor) co return visitor.visit(state, *this); } -// FIXME: Temporarily offer a top-level dump function to keep existing code running -QString AbstractNode::dump() const -{ - NodeDumper dumper; - Traverser trav(dumper, *this, Traverser::PRE_AND_POSTFIX); - trav.execute(); - return QString::fromStdString(dumper.getDump() + "\n"); -} - std::string AbstractNode::toString() const { std::stringstream stream; - stream << "n" << this->index() << ": group()"; + stream << "group()"; return stream.str(); } std::string AbstractIntersectionNode::toString() const { std::stringstream stream; - stream << "n" << this->index() << ": intersection()"; + stream << "intersection()"; return stream.str(); } @@ -161,13 +152,3 @@ std::ostream &operator<<(std::ostream &stream, const AbstractNode &node) stream << node.toString(); return stream; } - -QString AbstractNode::mk_cache_id() const -{ - QString cache_id = dump(); - cache_id.remove(QRegExp("[a-zA-Z_][a-zA-Z_0-9]*:")); - cache_id.remove(' '); - cache_id.remove('\t'); - cache_id.remove('\n'); - return cache_id; -} |