summaryrefslogtreecommitdiff
path: root/src/csgterm.h
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-30 04:26:05 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-30 04:26:05 (GMT)
commit191dc4857c852f1867e80cd9d03a6d1c0921dcb1 (patch)
tree4a6421d50eb6cf70924fc0ba06afccf10df00650 /src/csgterm.h
parent6940d171812565209efe679a5d923417c3f47d4a (diff)
header file reorg
git-svn-id: http://svn.clifford.at/openscad/trunk@365 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/csgterm.h')
-rw-r--r--src/csgterm.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/csgterm.h b/src/csgterm.h
new file mode 100644
index 0000000..35d071d
--- /dev/null
+++ b/src/csgterm.h
@@ -0,0 +1,51 @@
+#ifndef CSGTERM_H_
+#define CSGTERM_H_
+
+#include <QString>
+#include <QVector>
+
+class CSGTerm
+{
+public:
+ enum type_e {
+ TYPE_PRIMITIVE,
+ TYPE_UNION,
+ TYPE_INTERSECTION,
+ TYPE_DIFFERENCE
+ };
+
+ type_e type;
+ class PolySet *polyset;
+ QString label;
+ CSGTerm *left;
+ CSGTerm *right;
+ double m[20];
+ int refcounter;
+
+ CSGTerm(PolySet *polyset, double m[20], QString label);
+ CSGTerm(type_e type, CSGTerm *left, CSGTerm *right);
+
+ CSGTerm *normalize();
+ CSGTerm *normalize_tail();
+
+ CSGTerm *link();
+ void unlink();
+ QString dump();
+};
+
+class CSGChain
+{
+public:
+ QVector<PolySet*> polysets;
+ QVector<double*> matrices;
+ QVector<CSGTerm::type_e> types;
+ QVector<QString> labels;
+
+ CSGChain();
+
+ void add(PolySet *polyset, double *m, CSGTerm::type_e type, QString label);
+ void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION);
+ QString dump();
+};
+
+#endif
contact: Jan Huwald // Impressum