src/kdtree.h
branchpyrit
changeset 11 4d192e13ee84
parent 10 f9fad94cd0cc
child 12 f4fcabf05785
--- a/src/kdtree.h	Fri Nov 23 01:24:33 2007 +0100
+++ b/src/kdtree.h	Fri Nov 23 16:14:38 2007 +0100
@@ -65,8 +65,11 @@
 public:
 	ShapeList shapes;
 	Container(): bbox(), shapes() {};
+	virtual ~Container() {};
 	virtual void addShape(Shape* aShape);
 	//void addShapeNoExtend(Shape* aShape) { shapes.push_back(aShape); };
+        virtual Shape *nearest_intersection(const Shape *origin_shape, const Ray &ray,
+		float &nearest_distance);
 	virtual void optimize() {};
 };
 
@@ -105,8 +108,10 @@
 public:
 	KdTree() : Container(), built(false) {};
 	void addShape(Shape* aShape) { Container::addShape(aShape); built = false; };
-	void optimize(); // build kd-tree
+	void build();
+	void optimize() { build(); };
 	void save(ostream &str, KdNode *node = NULL);
+	void load(istream &str, KdNode *node = NULL);
 };
 
 #endif