summaryrefslogtreecommitdiff
path: root/src/csgnode.h
diff options
context:
space:
mode:
authorMarius Kintel <kintel@sim.no>2010-03-02 18:22:31 (GMT)
committerMarius Kintel <marius@kintel.net>2010-10-31 00:42:34 (GMT)
commit393c5a19fedfa4f97ca939fbcf52c2ccab1cde6a (patch)
treefbcb75d32e8763aac3f0ad28528936a0ec11930b /src/csgnode.h
parent746159d1838e895e80725cdc892f7bef85feb1af (diff)
Committed current version of visitor refactoring
Diffstat (limited to 'src/csgnode.h')
-rw-r--r--src/csgnode.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/csgnode.h b/src/csgnode.h
new file mode 100644
index 0000000..405dd96
--- /dev/null
+++ b/src/csgnode.h
@@ -0,0 +1,33 @@
+#ifndef CSGNODE_H_
+#define CSGNODE_H_
+
+#include "node.h"
+#include "visitor.h"
+#ifdef ENABLE_CGAL
+# include "cgal.h"
+#endif
+
+enum csg_type_e {
+ CSG_TYPE_UNION,
+ CSG_TYPE_DIFFERENCE,
+ CSG_TYPE_INTERSECTION
+};
+
+class CsgNode : public AbstractNode
+{
+public:
+ csg_type_e type;
+ CsgNode(const ModuleInstantiation *mi, csg_type_e type) : AbstractNode(mi), type(type) { }
+ virtual Response accept(const class State &state, Visitor &visitor) const {
+ return visitor.visit(state, *this);
+ }
+ virtual std::string toString() const;
+
+#ifdef ENABLE_CGAL
+ virtual CGAL_Nef_polyhedron renderCSGMesh() const;
+#endif
+ CSGTerm *render_csg_term(double m[20], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const;
+ virtual QString dump(QString indent) const;
+};
+
+#endif
contact: Jan Huwald // Impressum