Subversion Repositories gelsvn

Rev

Rev 443 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 443 Rev 595
Line -... Line 1...
-
 
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 BSPTree.h
-
 
9
 * @brief Binary space partitioning tree.
-
 
10
 */
-
 
11
 
1
#ifndef __GEOMETRY_BSPTREE_H__
12
#ifndef __GEOMETRY_BSPTREE_H__
2
#define __GEOMETRY_BSPTREE_H__
13
#define __GEOMETRY_BSPTREE_H__
3
 
14
 
4
#include <vector>
15
#include <vector>
5
 
16
 
Line 16... Line 27...
16
  struct BSPNode 
27
  struct BSPNode 
17
  {
28
  {
18
    unsigned char axis_leaf; // 00 = axis 0, 01 = axis 1, 10 = axis 2, 11 = leaf
29
    unsigned char axis_leaf; // 00 = axis 0, 01 = axis 1, 10 = axis 2, 11 = leaf
19
    double plane;
30
    double plane;
20
    BSPNode *left, *right;
31
    BSPNode *left, *right;
21
    int id;
32
    size_t id;
22
    int count;
33
    int count;
23
    unsigned int ref;
34
    unsigned int ref;
24
  };
35
  };
25
 
36
 
26
  // Faster structure
37
  // Faster structure
Line 43... Line 54...
43
  {
54
  {
44
    BSPLeaf leaf;
55
    BSPLeaf leaf;
45
    BSPInner inner;
56
    BSPInner inner;
46
  };
57
  };
47
 
58
 
-
 
59
    /** BSPTree class. Mostly used to accelerate ray casting. 
-
 
60
     */
48
  class BSPTree 
61
  class BSPTree 
49
  {
62
  {
50
    bool b_is_build;
63
    bool b_is_build;
51
 
64
 
52
	  static int node_calls;
65
	  static int node_calls;