include
lvr2
reconstruction
gs2
TumbleTree.hpp
Go to the documentation of this file.
1
//
2
// Created by patrick on 4/4/19.
3
//
4
5
#ifndef LAS_VEGAS_TUMBLETREE_HPP
6
#define LAS_VEGAS_TUMBLETREE_HPP
7
8
#include "
lvr2/attrmaps/HashMap.hpp
"
9
#include "
lvr2/geometry/Handles.hpp
"
10
11
namespace
lvr2
12
{
13
14
typedef
struct
Cell
15
{
16
double
alpha
= 1;
17
double
signal_counter
;
18
HashMap<VertexHandle, double>
duplicateMap
;
19
Cell
*
left
;
// left subtree
20
Cell
*
right
;
// right subtree
21
Cell
*
parent
;
22
}
Cell
;
23
24
class
TumbleTree
25
{
26
27
Cell
*
root
;
28
29
Cell
* makeEmpty(
Cell
* c);
30
31
Cell
*
remove
(
double
sc,
VertexHandle
vH,
Cell
* c,
bool
removeWhole =
false
);
32
// Cell* removeTwo(double sc, VertexHandle vH, Cell* c, bool removeWhole = false, double alpha =
33
// 1);
34
35
Cell
* insert(
Cell
* c,
double
sc,
VertexHandle
vH);
36
Cell
* findMin(
Cell
* c);
37
Cell
* findMax(
Cell
* c);
38
Cell
* find(
double
sc,
VertexHandle
vH,
Cell
* c,
double
alpha
= 1);
39
int
size(
Cell
* c);
40
int
maxDepth(
Cell
* cell);
41
int
minDepth(
Cell
* cell);
42
int
sumDepth(
Cell
* c,
int
currentDepth = 1);
43
int
numLeafes(
Cell
* c);
44
Cell
* buildTree(vector<Cell*>& cells,
int
start,
int
end);
45
void
getCellsAsVector(
Cell
* c, vector<Cell*>& cells);
46
47
void
update(
double
alpha
);
48
49
void
inorder(
Cell
* c);
50
51
public
:
52
TumbleTree
();
53
~
TumbleTree
();
54
55
// Cell* insertIterative(double sc, VertexHandle vH);
56
Cell
* insert(
double
sc,
VertexHandle
vH);
57
double
remove
(
Cell
* c,
VertexHandle
vH);
// returns the real sc
58
59
int
maxDepth();
60
int
minDepth();
61
int
avgDepth();
62
Cell
* find(
double
sc,
VertexHandle
vH);
63
64
void
display();
65
void
balance();
66
67
Cell
* min();
68
Cell
* max();
69
70
Cell
* makeCell(
double
sc,
71
VertexHandle
vH,
72
Cell
*
left
=
NULL
,
73
Cell
*
right
=
NULL
,
74
Cell
*
parent
=
NULL
,
75
double
alpha
= 1);
76
77
int
size();
78
79
void
updateSC(
double
alpha
);
80
int
notDeleted = 0;
81
};
82
83
}
// namespace lvr2
84
85
#include "TumbleTree.tcc"
86
87
#endif // LAS_VEGAS_TUMBLETREE_HPP
lvr2::Cell::left
Cell * left
Definition:
TumbleTree.hpp:19
lvr2::VertexHandle
Handle to access vertices of the mesh.
Definition:
Handles.hpp:146
lvr2::Cell
Definition:
TumbleTree.hpp:14
HashMap.hpp
lvr2::Cell
struct lvr2::Cell Cell
lvr2::Cell::alpha
double alpha
Definition:
TumbleTree.hpp:16
lvr2::Cell::signal_counter
double signal_counter
Definition:
TumbleTree.hpp:17
lvr2::HashMap
Definition:
HashMap.hpp:47
lvr2::TumbleTree::root
Cell * root
Definition:
TumbleTree.hpp:27
lvr2::Cell::duplicateMap
HashMap< VertexHandle, double > duplicateMap
Definition:
TumbleTree.hpp:18
Handles.hpp
lvr2::TumbleTree
Definition:
TumbleTree.hpp:24
lvr2
Definition:
BaseBufferManipulators.hpp:39
NULL
#define NULL
Definition:
mydefs.hpp:141
lvr2::Cell::right
Cell * right
Definition:
TumbleTree.hpp:20
lvr2::Cell::parent
Cell * parent
Definition:
TumbleTree.hpp:21
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 Mon Feb 28 2022 22:46:09