summaryrefslogtreecommitdiff
path: root/src/csgtermnormalizer.h
blob: bb55141e958dc3637e4a5d017665eecdca13de6f (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
#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);
	shared_ptr<CSGTerm> cleanup_term(shared_ptr<CSGTerm> &t);
	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