/*
	BoundingBoxTree.H

	Type definitions for BoundingBoxTree
*/
#ifndef _BOUNDINGBOXTREE_H__
#define _BOUNDINGBOXTREE_H__

#include <afxtempl.h>
#include "BoundingBox.h"
#include "../Face.h"
#include "../3DPoint.h"
class CBoundingBoxTree
{
	public:
		CBoundingBoxTree();
		~CBoundingBoxTree();

		CBoundingBox *m_pBox;
		CList<CFace*, CFace*>* m_objectsFaces; //the faces of the object
		CBoundingBoxTree* m_leftTree; //Tree1
		CBoundingBoxTree* m_rightTree; //Tree2

		void CreateFrom(CList<CFace*, CFace*> *faces);
		void CreateFromUnionOf(CBoundingBoxTree *tree1, CBoundingBoxTree *tree2);
		double GetVolume(void);
		double GetUnionVolumeWith(CBoundingBoxTree* tree);
		C3DPoint* Intersects(C3DPoint p1, C3DPoint p2);
		CFace* IntersectsFace(C3DPoint p1, C3DPoint p2);
	};

#endif