--- a/src/kdtree.h Thu Nov 29 18:30:16 2007 +0100
+++ b/src/kdtree.h Fri Nov 30 00:44:51 2007 +0100
@@ -62,8 +62,9 @@
{
KdNode *root;
bool built;
+ int max_depth;
public:
- KdTree() : Container(), root(NULL), built(false) {};
+ KdTree() : Container(), root(NULL), built(false), max_depth(32) {};
~KdTree() { if (root) delete root; };
void addShape(Shape* aShape) { Container::addShape(aShape); built = false; };
Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray,
@@ -72,6 +73,7 @@
void build();
void save(ostream &str, KdNode *node = NULL);
void load(istream &str, KdNode *node = NULL);
+ void setMaxDepth(int md) { max_depth = md; };
};
#endif