diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-11 05:33:18 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-11 05:33:18 (GMT) |
commit | c0641d6916775309d64944ca121cc736f0c8d7a1 (patch) | |
tree | 801e0b5d67d13ff4773c5906c9cb68d271a2be02 /src/PolySetEvaluator.h | |
parent | 09cc0496f7ce61e2bcbce80e067e0fac8054599a (diff) |
Reenabled PolySet caching. Pass shared_ptrs to polysets around to better manage memory
Diffstat (limited to 'src/PolySetEvaluator.h')
-rw-r--r-- | src/PolySetEvaluator.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/PolySetEvaluator.h b/src/PolySetEvaluator.h index b7c490d..6319e55 100644 --- a/src/PolySetEvaluator.h +++ b/src/PolySetEvaluator.h @@ -5,6 +5,7 @@ #include "node.h" #include "Tree.h" #include <QCache> +#include "memory.h" class PolySetEvaluator { @@ -14,7 +15,7 @@ public: const Tree &getTree() const { return this->tree; } - virtual PolySet *getPolySet(const class AbstractNode &); + virtual shared_ptr<PolySet> getPolySet(const class AbstractNode &, bool cache); virtual PolySet *evaluatePolySet(const class ProjectionNode &) { return NULL; } virtual PolySet *evaluatePolySet(const class DxfLinearExtrudeNode &) { return NULL; } @@ -22,16 +23,16 @@ public: virtual PolySet *evaluatePolySet(const class CgaladvNode &) { return NULL; } virtual PolySet *evaluatePolySet(const class RenderNode &) { return NULL; } - void clearCache() { + static void clearCache() { cache.clear(); } void printCache(); protected: struct cache_entry { - class PolySet *ps; + shared_ptr<class PolySet> ps; QString msg; - cache_entry(PolySet *ps); + cache_entry(const shared_ptr<PolySet> &ps); ~cache_entry() { } }; |