ParMooN
 All Classes Functions Variables Friends Pages
OctTree.h
1 #ifndef __OCTREE__
2 #define __OCTREE__
3 
4 #include <Collection.h>
5 #include <BaseCell.h>
6 
7 class TOctTree
8 {
9  public:
10  typedef struct {
11  double StartX;
12  double StartY;
13  double StartZ;
14  double BoundX;
15  double BoundY;
16  double BoundZ;
17  } TBoundBox;
18 
19  protected:
20  class TNode
21  {
22  protected:
25 
28 
31 
33  int Depth;
34 
35  int N_Cells;
36  TBaseCell **Cells;
37 
38  protected:
39  void MakeSubBoxes();
40  bool Intersect(TBaseCell *Cell);
41  bool PointInBox(double x, double y, double z);
42 
43  public:
44  TNode (TNode *Parent, TBoundBox *box, int n_cells, TBaseCell **cells);
45  ~TNode ();
46 
47  TNode *GetLeaf(double x, double y, double z);
48  void GetCells(int &n_cells, TBaseCell **&cells);
49  };
50 
51  protected:
52 
55 
58 
61 
62  protected:
63  void BuildTree();
64 
65  public:
66  TOctTree(TCollection *coll, TBoundBox *bounds);
67  ~TOctTree();
68 
69  void GetCells(double x, double y, double z, int &N_Cells, TBaseCell **&Cells);
70 };
71 
72 #endif
TNode * Parent
parent
Definition: OctTree.h:27
TNode * Childs[8]
sub boxes
Definition: OctTree.h:30
Definition: OctTree.h:10
TCollection * Coll
Collection from which the octtree is build.
Definition: OctTree.h:54
store cells in an array, used by cell iterators
Definition: Collection.h:18
TBoundBox Box
parameters describing box
Definition: OctTree.h:24
Definition: OctTree.h:20
information for finite element data structure
Definition: BaseCell.h:25
TBoundBox Bound
bounding box for whole domain
Definition: OctTree.h:60
TNode * Head
head of the tree
Definition: OctTree.h:57
Definition: OctTree.h:7