Subversion Repositories gelsvn

Rev

Rev 290 | Rev 299 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 290 Rev 291
Line 5... Line 5...
5
#include "CGLA/Vec3f.h"
5
#include "CGLA/Vec3f.h"
6
#include "Triangle.h"
6
#include "Triangle.h"
7
#include "AABox.h"
7
#include "AABox.h"
8
#include "OBox.h"
8
#include "OBox.h"
9
 
9
 
-
 
10
namespace Geometry
-
 
11
{
-
 
12
 
10
/// Abstract BOUNDINGNODE node.
13
/// Abstract BOUNDINGNODE node.
11
template<class BoxType>
14
template<class BoxType>
12
class BoundingNode: public BoxType
15
class BoundingNode: public BoxType
13
{
16
{
14
 public:
17
 public:
Line 16... Line 19...
16
	BoundingNode(const BoxType& box): BoxType(box) {}
19
	BoundingNode(const BoxType& box): BoxType(box) {}
17
 
20
 
18
	/// Count number of intersections from a point in a given direction
21
	/// Count number of intersections from a point in a given direction
19
	virtual int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const=0;
22
	virtual int intersect_cnt(const CGLA::Vec3f&,const CGLA::Vec3f&) const=0;
20
 
23
 
21
	/** Draw the tree. The first argument is the level counter, the second
-
 
22
			argument is the level at which to draw. */
-
 
23
	virtual void draw(int l, int lmax) const =0;
-
 
24
 
-
 
25
	/// Find the surface intersection point
24
	/// Find the surface intersection point
26
	virtual bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const=0;
25
	virtual bool intersect(const CGLA::Vec3f&,const CGLA::Vec3f&,float&) const=0;
27
 
26
 
28
	/** For a given point, return the min and max square distance and the
27
	/** For a given point, return the min and max square distance and the
29
			sign. Non-leafs return zero for the sign. Leaves
28
			sign. Non-leafs return zero for the sign. Leaves
Line 31... Line 30...
31
	virtual void sq_distance(const CGLA::Vec3f&, float&, float&, float&) const;
30
	virtual void sq_distance(const CGLA::Vec3f&, float&, float&, float&) const;
32
	
31
	
33
	static BoundingNode* build(std::vector<Triangle>& triangles);
32
	static BoundingNode* build(std::vector<Triangle>& triangles);
34
};
33
};
35
 
34
 
-
 
35
}
36
#endif
36
#endif