
#include "geometry.h"
#include "ray.h"

Geometry::Geometry() {
}

Geometry::Geometry(RayCastNode *p,
				   float x1, float x2, float y1, float y2, float z1, float z2) :
		RayCastNode(p, x1, x2, y1, y2, z1, z2) {
}

Geometry::Geometry(RayCastNode *p, const Bounds3d &B) : RayCastNode(p, B) {
}

Geometry::~Geometry() {
}

Geometry& Geometry::CopyFrom(const Geometry &G) {

	_objects = G._objects;

	return *this;
}

ostream& operator<<(ostream &co, const Geometry&) {

	co << "Geometry (no output function yet)" << endl;

	return co;
}

/*
istream& operator>>(istream &ci, Geometry &G) {

	return ci;
}
*/


void Geometry::Intersect(const Ray &ray, Hit &hit, Bounds3d *tighter) {
	for (int i=0; i<_objects.Size(); i++)
	  {
	    _objects[i].Intersect(ray, hit, tighter);
	  }

}

