blob: b0fffe45dbd5d28edde76c2e5bc2d42af3aa658b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#ifndef CSGTERM_H_
#define CSGTERM_H_
#include <QString>
#include <QVector>
#include "polyset.h"
class CSGTerm
{
public:
enum type_e {
TYPE_PRIMITIVE,
TYPE_UNION,
TYPE_INTERSECTION,
TYPE_DIFFERENCE
};
type_e type;
PolySet *polyset;
QString label;
CSGTerm *left;
CSGTerm *right;
double m[16];
double color[4];
int refcounter;
CSGTerm(PolySet *polyset, const double matrix[16], const double color[4], 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<double*> colors;
QVector<CSGTerm::type_e> types;
QVector<QString> labels;
CSGChain();
void add(PolySet *polyset, double *m, double *color, CSGTerm::type_e type, QString label);
void import(CSGTerm *term, CSGTerm::type_e type = CSGTerm::TYPE_UNION);
QString dump();
BoundingBox getBoundingBox() const;
};
#endif
|