Subversion Repositories gelsvn

Rev

Rev 443 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
595 jab 1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
6
 
7
/**
8
 * @file BoundingINode.h
9
 * @brief Interior node class of a bounding hierarchy
10
 */
11
 
443 jab 12
#ifndef __GEOMETRY_BOUNDINGINODE_H
13
#define __GEOMETRY_BOUNDINGINODE_H
290 jrf 14
 
309 jab 15
#include "Ray.h"
290 jrf 16
#include "BoundingNode.h"
17
 
291 jrf 18
namespace Geometry
19
{
20
 
290 jrf 21
/** Interior node of bounding box tree. Contains
22
		pointers to left and right tree. */
23
template<class BoxType>
24
class BoundingINode: public BoundingNode<BoxType>
25
{
26
	BoundingNode<BoxType>* left;
27
	BoundingNode<BoxType>* right;
28
 public:
29
 
30
	BoundingINode(const BoxType& box,
31
								BoundingNode<BoxType>* _left,
32
								BoundingNode<BoxType>* _right): 
33
		BoundingNode<BoxType>(box), left(_left), right(_right) {}
34
 
324 jab 35
	virtual ~BoundingINode() {delete left; delete right;}
290 jrf 36
 
37
	bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const; 
309 jab 38
	void intersect(Ray&  r) const; 
290 jrf 39
	int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const;
40
 
41
	const BoundingNode<BoxType>* get_left() const {return left;}
42
	const BoundingNode<BoxType>* get_right() const {return right;}
43
};
44
 
291 jrf 45
}
290 jrf 46
#endif