summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CGALEvaluator.h')
-rw-r--r--src/CGALEvaluator.h18
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;
};
contact: Jan Huwald // Impressum