ext
laslib
inc
lasinterval.hpp
Go to the documentation of this file.
1
/*
2
===============================================================================
3
4
FILE: lasinterval.hpp
5
6
CONTENTS:
7
8
Reads LIDAR .
9
10
PROGRAMMERS:
11
12
martin.isenburg@gmail.com
13
14
COPYRIGHT:
15
16
(c) 2009-11, Martin Isenburg, LASSO - tools to catch reality
17
18
This is free software; you can redistribute and/or modify it under the
19
terms of the GNU Lesser General Licence as published by the Free Software
20
Foundation. See the COPYING file for more information.
21
22
This software is distributed WITHOUT ANY WARRANTY and without even the
23
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24
25
CHANGE HISTORY:
26
27
29 April 2011 -- created after cable outage during the royal wedding (-:
28
29
===============================================================================
30
*/
31
#ifndef LAS_INTERVAL_HPP
32
#define LAS_INTERVAL_HPP
33
34
#include "
mydefs.hpp
"
35
36
class
ByteStreamIn
;
37
class
ByteStreamOut
;
38
39
class
LASintervalCell
40
{
41
public
:
42
U32
start
;
43
U32
end
;
44
LASintervalCell
*
next
;
45
LASintervalCell
();
46
LASintervalCell
(
const
U32
p_index);
47
LASintervalCell
(
const
LASintervalCell
* cell);
48
};
49
50
class
LASintervalStartCell
:
public
LASintervalCell
51
{
52
public
:
53
U32
full
;
54
U32
total
;
55
LASintervalCell
*
last
;
56
LASintervalStartCell
();
57
LASintervalStartCell
(
const
U32
p_index);
58
BOOL
add(
const
U32
p_index,
const
U32
threshold=1000);
59
};
60
61
class
LASinterval
62
{
63
public
:
64
LASinterval
(
const
U32
threshold=1000);
65
~
LASinterval
();
66
67
// add points and create cells with intervals
68
BOOL
add(
const
U32
p_index,
const
I32
c_index);
69
70
// get total number of cells
71
U32
get_number_cells()
const
;
72
73
// get total number of intervals
74
U32
get_number_intervals()
const
;
75
76
// merge cells (and their intervals) into one cell
77
BOOL
merge_cells(
const
U32
num_indices,
const
I32
* indices,
const
I32
new_index);
78
79
// merge adjacent intervals with small gaps in cells to reduce total interval number to maximum
80
void
merge_intervals(
U32
maximum);
81
82
// read from file or write to file
83
BOOL
read(
ByteStreamIn
* stream);
84
BOOL
write(
ByteStreamOut
* stream)
const
;
85
86
// get one cell after the other
87
void
get_cells();
88
BOOL
has_cells();
89
90
// get a particular cell
91
BOOL
get_cell(
const
I32
c_index);
92
93
// add cell's intervals to those that will be merged
94
BOOL
add_current_cell_to_merge_cell_set();
95
BOOL
add_cell_to_merge_cell_set(
const
I32
c_index,
const
BOOL
erase=
FALSE
);
96
BOOL
merge(
const
BOOL
erase=
FALSE
);
97
void
clear_merge_cell_set();
98
BOOL
get_merged_cell();
99
100
// iterate intervals of current cell (or over merged intervals)
101
BOOL
has_intervals();
102
103
I32
index
;
104
U32
start
;
105
U32
end
;
106
U32
full
;
107
U32
total
;
108
109
private
:
110
void
*
cells
;
111
void
*
cells_to_merge
;
112
U32
threshold
;
113
U32
number_intervals
;
114
I32
last_index
;
115
LASintervalStartCell
*
last_cell
;
116
LASintervalCell
*
current_cell
;
117
LASintervalStartCell
*
merged_cells
;
118
BOOL
merged_cells_temporary
;
119
};
120
121
#endif
LASinterval::cells
void * cells
Definition:
lasinterval.hpp:110
LASintervalCell
Definition:
lasinterval.hpp:39
BOOL
int BOOL
Definition:
mydefs.hpp:57
FALSE
#define FALSE
Definition:
mydefs.hpp:133
LASinterval
Definition:
lasinterval.hpp:61
LASintervalCell::start
U32 start
Definition:
lasinterval.hpp:42
LASintervalCell::next
LASintervalCell * next
Definition:
lasinterval.hpp:44
ByteStreamOut
Definition:
bytestreamout.hpp:36
LASinterval::last_cell
LASintervalStartCell * last_cell
Definition:
lasinterval.hpp:115
LASintervalStartCell::total
U32 total
Definition:
lasinterval.hpp:54
U32
unsigned int U32
Definition:
mydefs.hpp:39
LASintervalStartCell
Definition:
lasinterval.hpp:50
LASinterval::threshold
U32 threshold
Definition:
lasinterval.hpp:112
LASintervalCell::end
U32 end
Definition:
lasinterval.hpp:43
LASinterval::merged_cells
LASintervalStartCell * merged_cells
Definition:
lasinterval.hpp:117
ByteStreamIn
Definition:
bytestreamin.hpp:36
LASinterval::cells_to_merge
void * cells_to_merge
Definition:
lasinterval.hpp:111
LASinterval::total
U32 total
Definition:
lasinterval.hpp:107
LASinterval::start
U32 start
Definition:
lasinterval.hpp:104
LASinterval::merged_cells_temporary
BOOL merged_cells_temporary
Definition:
lasinterval.hpp:118
I32
int I32
Definition:
mydefs.hpp:35
LASinterval::end
U32 end
Definition:
lasinterval.hpp:105
LASinterval::full
U32 full
Definition:
lasinterval.hpp:106
mydefs.hpp
LASintervalStartCell::last
LASintervalCell * last
Definition:
lasinterval.hpp:55
LASinterval::last_index
I32 last_index
Definition:
lasinterval.hpp:114
LASinterval::number_intervals
U32 number_intervals
Definition:
lasinterval.hpp:113
LASinterval::current_cell
LASintervalCell * current_cell
Definition:
lasinterval.hpp:116
LASintervalCell::LASintervalCell
LASintervalCell()
Definition:
lasinterval.cpp:62
LASintervalStartCell::full
U32 full
Definition:
lasinterval.hpp:53
LASinterval::index
I32 index
Definition:
lasinterval.hpp:103
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:07