summaryrefslogtreecommitdiff
path: root/src/CGALRenderer.h
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-04-12 04:57:02 (GMT)
committerMarius Kintel <marius@kintel.net>2010-10-31 00:42:35 (GMT)
commit1caf80e561819832092e67bd15ceba5d6f9a02f8 (patch)
treeac144b7659840529155c762794508bea018b2be3 /src/CGALRenderer.h
parente8e213b3c9ce0580045ea6e7e86b00ab41d4c58b (diff)
Added CSGTextCache for experimenting with cache-tree organization
Diffstat (limited to 'src/CGALRenderer.h')
-rw-r--r--src/CGALRenderer.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/CGALRenderer.h b/src/CGALRenderer.h
index 0492c86..11abaa3 100644
--- a/src/CGALRenderer.h
+++ b/src/CGALRenderer.h
@@ -1,11 +1,13 @@
#ifndef CGALRENDERER_H_
#define CGALRENDERER_H_
+#include "myqhash.h"
+
#include <string>
#include <map>
#include <list>
#include "visitor.h"
-#include "nodecache.h"
+#include "Tree.h"
#include "cgal.h"
#ifdef ENABLE_CGAL
@@ -23,7 +25,7 @@ class CGALRenderer : public Visitor
public:
enum CsgOp {UNION, INTERSECTION, DIFFERENCE, MINKOWSKI};
// FIXME: If a cache is not given, we need to fix this ourselves
- CGALRenderer(QHash<QString, CGAL_Nef_polyhedron> &cache, const NodeCache<string> &dumpcache) : cache(cache), dumpcache(dumpcache) {}
+ CGALRenderer(QHash<string, CGAL_Nef_polyhedron> &cache, const Tree &tree) : cache(cache), tree(tree) {}
virtual ~CGALRenderer() {}
virtual Response visit(const State &state, const AbstractNode &node);
@@ -38,16 +40,15 @@ public:
private:
void addToParent(const State &state, const AbstractNode &node);
bool isCached(const AbstractNode &node) const;
- QString mk_cache_id(const AbstractNode &node) const;
void process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedron &src, CGALRenderer::CsgOp op);
void applyToChildren(const AbstractNode &node, CGALRenderer::CsgOp op);
string currindent;
- typedef list<pair<const AbstractNode *, QString> > ChildList;
+ typedef list<pair<const AbstractNode *, string> > ChildList;
map<int, ChildList> visitedchildren;
- QHash<QString, CGAL_Nef_polyhedron> &cache;
- const NodeCache<string> &dumpcache;
+ QHash<string, CGAL_Nef_polyhedron> &cache;
+ const Tree &tree;
};
#endif
contact: Jan Huwald // Impressum