diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-09 03:53:05 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-09 03:53:05 (GMT) |
commit | cbba974d3ac1edeb716a1384a2262ed5447fa9e6 (patch) | |
tree | 30708ef085204435d644c4ab685b87556628d22a /src/PolySetEvaluator.h | |
parent | 328897c1f28e0d438aa678891f8d5a45b114f267 (diff) |
Initial attempt of cleaning up polyset handling. PolySet no longer keeps a refcount, basic cache mechanism is in place, instantiating polysets are controlled through PolySetEvaluator
Diffstat (limited to 'src/PolySetEvaluator.h')
-rw-r--r-- | src/PolySetEvaluator.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/PolySetEvaluator.h b/src/PolySetEvaluator.h index 70ec7ed..1a97cb5 100644 --- a/src/PolySetEvaluator.h +++ b/src/PolySetEvaluator.h @@ -3,39 +3,42 @@ #include "myqhash.h" #include "node.h" +#include "Tree.h" #include <QCache> class PolySetEvaluator { public: - enum EvaluateMode { EVALUATE_CGAL, EVALUATE_OPENCSG }; - PolySetEvaluator() : cache(100) {} - + PolySetEvaluator(const Tree &tree) : cache(100000), 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; - virtual PolySet *evaluatePolySet(const class CgaladvNode &, AbstractPolyNode::render_mode_e) = 0; - virtual PolySet *evaluatePolySet(const class RenderNode &, AbstractPolyNode::render_mode_e) = 0; + const Tree &getTree() const { return this->tree; } + + virtual PolySet *getPolySet(const class AbstractNode &); + + 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; } void clearCache() { this->cache.clear(); } - + void printCache(); protected: struct cache_entry { class PolySet *ps; QString msg; cache_entry(PolySet *ps); - ~cache_entry(); + ~cache_entry() { } }; QCache<std::string, cache_entry> cache; private: - static PolySetEvaluator *global_evaluator; + const Tree &tree; }; #endif |