summaryrefslogtreecommitdiff
path: root/src/PolySetEvaluator.h
diff options
context:
space:
mode:
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