summaryrefslogtreecommitdiff
path: root/src/PolySetEvaluator.h
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-09-12 22:40:51 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-09-12 22:40:51 (GMT)
commitf5f06c8e976ca45aebea42fe8c04bf7404357ac8 (patch)
tree8d0cdd2698e7806c1b12cc49e743b561e1082961 /src/PolySetEvaluator.h
parent007c40848db9efd704694f2e7596cabed80da50f (diff)
parent5ac9162f1c67fd21737ead11d7ebc638bf4eef5f (diff)
merge
Merge remote branch 'upstream/visitor' into visitortests Conflicts: src/export.cc src/openscad.cc src/polyset.cc src/transform.cc tests/CMakeLists.txt tests/FindGLEW.cmake tests/csgtermtest.cc
Diffstat (limited to 'src/PolySetEvaluator.h')
-rw-r--r--src/PolySetEvaluator.h33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/PolySetEvaluator.h b/src/PolySetEvaluator.h
index dcc67db..833b079 100644
--- a/src/PolySetEvaluator.h
+++ b/src/PolySetEvaluator.h
@@ -1,39 +1,28 @@
#ifndef POLYSETEVALUATOR_H_
#define POLYSETEVALUATOR_H_
-#include "myqhash.h"
#include "node.h"
-#include <QCache>
+#include "Tree.h"
+#include "memory.h"
class PolySetEvaluator
{
public:
- enum EvaluateMode { EVALUATE_CGAL, EVALUATE_OPENCSG };
- PolySetEvaluator() : cache(100) {}
-
+ PolySetEvaluator(const Tree &tree) : tree(tree) {}
virtual ~PolySetEvaluator() {}
- virtual PolySet *evaluatePolySet(const class ProjectionNode &, AbstractPolyNode::render_mode_e) = 0;
- virtual PolySet *evaluatePolySet(const class DxfLinearExtrudeNode &, AbstractPolyNode::render_mode_e) = 0;
- virtual PolySet *evaluatePolySet(const class DxfRotateExtrudeNode &, AbstractPolyNode::render_mode_e) = 0;
-
- void clearCache() {
- this->cache.clear();
- }
-
-protected:
+ const Tree &getTree() const { return this->tree; }
- struct cache_entry {
- class PolySet *ps;
- QString msg;
- cache_entry(PolySet *ps);
- ~cache_entry();
- };
+ virtual shared_ptr<PolySet> getPolySet(const class AbstractNode &, bool cache);
- QCache<std::string, cache_entry> cache;
+ virtual PolySet *evaluatePolySet(const class ProjectionNode &) { return NULL; }
+ virtual PolySet *evaluatePolySet(const class DxfLinearExtrudeNode &) { return NULL; }
+ virtual PolySet *evaluatePolySet(const class DxfRotateExtrudeNode &) { return NULL; }
+ virtual PolySet *evaluatePolySet(const class CgaladvNode &) { return NULL; }
+ virtual PolySet *evaluatePolySet(const class RenderNode &) { return NULL; }
private:
- static PolySetEvaluator *global_evaluator;
+ const Tree &tree;
};
#endif
contact: Jan Huwald // Impressum