Boctree.cc
Go to the documentation of this file.
1 /*
2  * Boctree implementation
3  *
4  * Copyright (C) Jan Elseberg
5  *
6  * Released under the GPL version 3.
7  *
8  */
9 
10 #include "slam6d/Boctree.h"
11 
13 struct Initializer {
15  for(unsigned char mask = 0; mask <= 255; mask++) {
16  for(unsigned char index = 0; index < 8; index++) {
17  char c = 0;
18  char *mimap = imap[index]; // maps area index to preference
19  for(unsigned char i = 0; i < 8; i++) {
20  if(( 1 << i ) & mask) { // if ith node exists
21  sequence2ci[index][mask][ mimap[i] ] = c++;
22  } else {
23  sequence2ci[index][mask][ mimap[i] ] = -1;
24  }
25  }
26  }
27  if (mask == UCHAR_MAX) break;
28  }
29  }
30 };
31 
32 namespace{
33  Initializer init;
34 }
35 
36 char sequence2ci[8][256][8] = {};
37 
38 char amap[8][8] = {
39  {0, 1, 2, 4, 3, 5, 6, 7 },
40  {1, 0, 3, 5, 2, 4, 6, 7 },
41  {2, 0, 3, 6, 1, 4, 5, 7 },
42  {3, 1, 2, 7, 0, 5, 4, 6 },
43  {4, 5, 6, 0, 7, 1, 2, 3 },
44  {5, 4, 7, 1, 6, 0, 3, 2 },
45  {6, 4, 7, 2, 5, 0, 3, 1 },
46  {7, 5, 6, 3, 4, 1, 2, 0 } };
47 
48 char imap[8][8] = {
49  {0, 1, 2, 4, 3, 5, 6, 7 },
50  {1, 0, 4, 2, 5, 3, 6, 7 },
51  {1, 4, 0, 2, 5, 6, 3, 7 },
52  {4, 1, 2, 0, 6, 5, 7, 3 },
53  {3, 5, 6, 7, 0, 1, 2, 4 },
54  {5, 3, 7, 6, 1, 0, 4, 2 },
55  {5, 7, 3, 6, 1, 4, 0, 2 },
56  {7, 5, 6, 3, 4, 1, 2, 0 } };
Initializer
Start-of-the-program initializer for the sequence map.
Definition: Boctree.cc:13
amap
char amap[8][8]
Definition: Boctree.cc:38
Boctree.h
Efficient representation of an octree.
Initializer::Initializer
Initializer()
Definition: Boctree.cc:14
imap
char imap[8][8]
Definition: Boctree.cc:48
sequence2ci
char sequence2ci[8][256][8]
Definition: Boctree.cc:36


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:22