diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-09-12 22:40:51 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2011-09-12 22:40:51 (GMT) |
commit | f5f06c8e976ca45aebea42fe8c04bf7404357ac8 (patch) | |
tree | 8d0cdd2698e7806c1b12cc49e743b561e1082961 /src/CGALEvaluator.h | |
parent | 007c40848db9efd704694f2e7596cabed80da50f (diff) | |
parent | 5ac9162f1c67fd21737ead11d7ebc638bf4eef5f (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/CGALEvaluator.h')
-rw-r--r-- | src/CGALEvaluator.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/CGALEvaluator.h b/src/CGALEvaluator.h index 9a1c88c..c1b5ae8 100644 --- a/src/CGALEvaluator.h +++ b/src/CGALEvaluator.h @@ -4,16 +4,13 @@ #include "myqhash.h" #include "visitor.h" #include "Tree.h" -#include "cgal.h" +#include "CGAL_Nef_polyhedron.h" #include "PolySetCGALEvaluator.h" #include <string> #include <map> #include <list> -extern CGAL_Nef_polyhedron3 minkowski3(CGAL_Nef_polyhedron3 a, CGAL_Nef_polyhedron3 b); -extern CGAL_Nef_polyhedron2 minkowski2(CGAL_Nef_polyhedron2 a, CGAL_Nef_polyhedron2 b); - using std::string; using std::map; using std::list; @@ -22,9 +19,8 @@ using std::pair; class CGALEvaluator : public Visitor { public: - enum CsgOp {CGE_UNION, CGE_INTERSECTION, CGE_DIFFERENCE, CGE_MINKOWSKI, CGE_HULL}; - // FIXME: If a cache is not given, we need to fix this ourselves - CGALEvaluator(QHash<string, CGAL_Nef_polyhedron> &cache, const Tree &tree) : cache(cache), tree(tree), psevaluator(*this) {} + enum CsgOp {CGE_UNION, CGE_INTERSECTION, CGE_DIFFERENCE, CGE_MINKOWSKI}; + CGALEvaluator(const Tree &tree) : tree(tree), psevaluator(*this) {} virtual ~CGALEvaluator() {} virtual Response visit(State &state, const AbstractNode &node); @@ -32,6 +28,7 @@ public: virtual Response visit(State &state, const CsgNode &node); virtual Response visit(State &state, const TransformNode &node); virtual Response visit(State &state, const AbstractPolyNode &node); + virtual Response visit(State &state, const CgaladvNode &node); CGAL_Nef_polyhedron evaluateCGALMesh(const AbstractNode &node); CGAL_Nef_polyhedron evaluateCGALMesh(const PolySet &polyset); @@ -42,14 +39,17 @@ private: void addToParent(const State &state, const AbstractNode &node); bool isCached(const AbstractNode &node) const; void process(CGAL_Nef_polyhedron &target, const CGAL_Nef_polyhedron &src, CGALEvaluator::CsgOp op); - void applyToChildren(const AbstractNode &node, CGALEvaluator::CsgOp op); + CGAL_Nef_polyhedron applyToChildren(const AbstractNode &node, CGALEvaluator::CsgOp op); + CGAL_Nef_polyhedron applyHull(const CgaladvNode &node); string currindent; typedef list<pair<const AbstractNode *, string> > ChildList; map<int, ChildList> visitedchildren; - QHash<string, CGAL_Nef_polyhedron> &cache; const Tree &tree; +public: + // FIXME: Do we need to make this visible? Used for cache management + // Note: psevaluator constructor needs this->tree to be initialized first PolySetCGALEvaluator psevaluator; }; |