/* ----------------------------------------------------------------------- * * This file is part of GEL, http://www.imm.dtu.dk/GEL * Copyright (C) the authors and DTU Informatics * For license and list of authors, see ../../doc/intro.pdf * ----------------------------------------------------------------------- */ /** * @file BoundingINode.h * @brief Interior node class of a bounding hierarchy */ #ifndef __GEOMETRY_BOUNDINGINODE_H #define __GEOMETRY_BOUNDINGINODE_H #include "Ray.h" #include "BoundingNode.h" namespace Geometry { /** Interior node of bounding box tree. Contains pointers to left and right tree. */ template class BoundingINode: public BoundingNode { BoundingNode* left; BoundingNode* right; public: BoundingINode(const BoxType& box, BoundingNode* _left, BoundingNode* _right): BoundingNode(box), left(_left), right(_right) {} virtual ~BoundingINode() {delete left; delete right;} bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const; void intersect(Ray& r) const; int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const; const BoundingNode* get_left() const {return left;} const BoundingNode* get_right() const {return right;} }; } #endif