summaryrefslogtreecommitdiff
path: root/src/PolySetEvaluator.h
blob: b7c490d7b0c06c613f0f9c856897c6904916f3d7 (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
#ifndef POLYSETEVALUATOR_H_
#define POLYSETEVALUATOR_H_

#include "myqhash.h"
#include "node.h"
#include "Tree.h"
#include <QCache>

class PolySetEvaluator
{
public:
	PolySetEvaluator(const Tree &tree) : tree(tree) {}
	virtual ~PolySetEvaluator() {}

	const Tree &getTree() const { return this->tree; }

	virtual PolySet *getPolySet(const class AbstractNode &);

	virtual PolySet *evaluatePolySet(const class ProjectionNode &) { return NULL; }
	virtual PolySet *evaluatePolySet(const class DxfLinearExtrudeNode &) { return NULL; }
	virtual PolySet *evaluatePolySet(const class DxfRotateExtrudeNode &) { return NULL; }
	virtual PolySet *evaluatePolySet(const class CgaladvNode &) { return NULL; }
	virtual PolySet *evaluatePolySet(const class RenderNode &) { return NULL; }

	void clearCache() {
		cache.clear();
	}
	void printCache();
protected:

	struct cache_entry {
		class PolySet *ps;
		QString msg;
		cache_entry(PolySet *ps);
		~cache_entry() { }
	};

	static QCache<std::string, cache_entry> cache;

private:
	const Tree &tree;
};

#endif
contact: Jan Huwald // Impressum