source: GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.h @ 2592

Revision 2592, 2.5 KB checked in by bittner, 16 years ago (diff)

havran ray caster update

Line 
1#ifndef _HavranRayCaster_H__
2#define _HavranRayCaster_H__
3
4#include "RayCaster.h"
5#include "Containers.h"
6#include <string>
7#include "ktbconf.h"
8#include "raypack.h"
9
10namespace GtpVisibilityPreprocessor {
11
12
13class Intersectable;
14class VssRay;
15class KdTree;
16class Ray;
17class SimpleRayContainer;
18class AxisAlignedBox3;
19class Vector3;
20struct VssRayContainer;
21class Preprocessor;
22struct SimpleRay;
23class CKTB;
24 
25
26/** This class provides an interface for ray casting.
27*/
28class HavranRayCaster: public RayCaster
29{
30public:
31  /** Default constructor initialising e.g., KD tree
32   */
33  HavranRayCaster(const Preprocessor &preprocessor);
34  virtual ~HavranRayCaster();
35
36  void Build(ObjectContainer &objlist);
37 
38  int Type() const { return HAVRAN_RAYCASTER; }
39 
40  virtual int CastRay(
41                      const SimpleRay &simpleRay,
42                      VssRayContainer &vssRays,
43                      const AxisAlignedBox3 &box,
44                      const bool castDoubleRay,
45                      const bool pruneInvalidRays = true
46                      );
47 
48  virtual void CastRays16(SimpleRayContainer &rays,
49                          VssRayContainer &vssRays,
50                          const AxisAlignedBox3 &sbox,
51                          const bool castDoubleRay,
52                          const bool pruneInvalidRays = true
53                          );
54
55  virtual void CastRays16(SimpleRayContainer &rays,
56                          int offset,
57                          VssRayContainer &vssRays,
58                          const AxisAlignedBox3 &sbox,
59                          const bool castDoubleRay,
60                          const bool pruneInvalidRays = true
61                          ); 
62  void
63  CastSimpleForwardRays(SimpleRayContainer &rays,
64                        const AxisAlignedBox3 &sbox
65                        );
66
67  virtual void CastRays(
68                        SimpleRayContainer &rays,
69                        VssRayContainer &vssRays,
70                        const AxisAlignedBox3 &sbox,
71                        const bool castDoubleRay,
72                        const bool pruneInvalidRays = true);
73
74  // Using packet of 4 rays supposing that these are coherent
75  // We give a box to which each ray is clipped to before the
76  // ray shooting is computed !
77  virtual void CastRaysPacket4(Vector3 &minBox,
78                               Vector3 &maxBox,
79                               Vector3 origin4[],
80                               Vector3 direction4[],
81                               int     result4[],
82                               float   dist4[]);
83
84#ifdef _USE_HAVRAN_SSE 
85  // Just for testing concept
86  virtual void CastRaysPacket2x2(RayPacket2x2 &raysPack,
87                                 bool castDoubleRay,
88                                 const bool pruneInvalidRays = true);
89#endif 
90
91  bool ExportBinTree(const string &filename);
92  bool ImportBinTree(const string &filename, ObjectContainer &objects);
93 
94protected:
95  CKTB *mKtbtree;
96  static RayPacket2x2 raypack;
97};
98
99
100} // namespace
101
102#endif
Note: See TracBrowser for help on using the repository browser.