summaryrefslogtreecommitdiff
path: root/src/CGALRenderer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CGALRenderer.h')
-rw-r--r--src/CGALRenderer.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/CGALRenderer.h b/src/CGALRenderer.h
index fc7e0c4..0492c86 100644
--- a/src/CGALRenderer.h
+++ b/src/CGALRenderer.h
@@ -22,8 +22,8 @@ class CGALRenderer : public Visitor
{
public:
enum CsgOp {UNION, INTERSECTION, DIFFERENCE, MINKOWSKI};
- // FIXME: If a cache is not give, we need to fix this ourselves
- CGALRenderer(const NodeCache<string> &dumpcache) : root(NULL), dumpcache(dumpcache) {}
+ // 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) {}
virtual ~CGALRenderer() {}
virtual Response visit(const State &state, const AbstractNode &node);
@@ -32,14 +32,9 @@ public:
virtual Response visit(const State &state, const TransformNode &node);
virtual Response visit(const State &state, const AbstractPolyNode &node);
- QHash<QString, CGAL_Nef_polyhedron> &getCache() { return this->cache; }
-
CGAL_Nef_polyhedron renderCGALMesh(const AbstractNode &node);
CGAL_Nef_polyhedron renderCGALMesh(const PolySet &polyset);
- // FIXME: Questionable design...
- static CGALRenderer *renderer() { return global_renderer; }
- static void setRenderer(CGALRenderer *r) { global_renderer = r; }
private:
void addToParent(const State &state, const AbstractNode &node);
bool isCached(const AbstractNode &node) const;
@@ -48,15 +43,11 @@ private:
void applyToChildren(const AbstractNode &node, CGALRenderer::CsgOp op);
string currindent;
- const AbstractNode *root;
typedef list<pair<const AbstractNode *, QString> > ChildList;
map<int, ChildList> visitedchildren;
- // FIXME: enforce some maximum cache size (old version had 100K vertices as limit)
- QHash<QString, CGAL_Nef_polyhedron> cache;
+ QHash<QString, CGAL_Nef_polyhedron> &cache;
const NodeCache<string> &dumpcache;
-
- static CGALRenderer *global_renderer;
};
#endif
contact: Jan Huwald // Impressum