summaryrefslogtreecommitdiff
path: root/src/csgtermnormalizer.h
blob: f7a444f6d20b392eb2a4840e37a8bf10839664d3 (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
#ifndef CSGTERMNORMALIZER_H_
#define CSGTERMNORMALIZER_H_

#include "memory.h"

class CSGTermNormalizer
{
public:
	CSGTermNormalizer(size_t limit) : limit(limit) {}
	~CSGTermNormalizer() {}

	shared_ptr<class CSGTerm> normalize(const shared_ptr<CSGTerm> &term);

private:
	shared_ptr<CSGTerm> normalizePass(shared_ptr<CSGTerm> term) ;
	bool match_and_replace(shared_ptr<CSGTerm> &term);
	shared_ptr<CSGTerm> collapse_null_terms(const shared_ptr<CSGTerm> &term);
	unsigned int count(const shared_ptr<CSGTerm> &term) const;

	bool aborted;
	size_t limit;
	size_t nodecount;
	shared_ptr<class CSGTerm> rootnode;
};

#endif
contact: Jan Huwald // Impressum