// // C++ Interface: BVTree // // Description: // // // Authors: Dalla Corte Ludovic (C) 2011 // Phan Laurent // Etudiants Infographie Groupe 1 2010-2011 // // Copyright: See COPYING file that comes with this distribution // // #ifndef BVTREE_H_ #define BVTREE_H_ #include "BoundingBox.h" #include #include #include class Gscene; class BVNode { public: BVNode() : info(NULL), left(NULL), right(NULL) {} BVNode(BoundingBox* newInfo) : info(newInfo), left(NULL), right(NULL) {} virtual ~BVNode() {}; BVNode* getBVNodeLeft() { return left; } BVNode* getBVNodeRight() { return right; } BoundingBox* getBVNodeInfo() { return info; } void setBVNodeLeft(BVNode* newLeft) { left = newLeft; } void setBVNodeRight(BVNode* newRight) { right = newRight; } void setBVNodeInfo(BoundingBox* newInfo) { info = newInfo; } bool isBVNodeLeaf() { return (left == NULL) && (right == NULL); } private: BoundingBox* info; BVNode* left; BVNode* right; }; class BVTree { public: BVTree() : root(NULL) {} BVTree(Gscene*); virtual ~BVTree(); BVNode* getBVTreeRoot() { return root; } void setBVTreeRoot(BVNode* newRoot) { root = newRoot; } void intersectionBBox(BVNode*, ray*, std::vector*); private: BVNode* root; void freeBVTree(BVNode*); }; #endif /* BVTREE_H_ */