lasutility.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: lasutility.hpp
5 
6  CONTENTS:
7 
8  Simple utilities that come in handy when using the laslib API.
9 
10  PROGRAMMERS:
11 
12  martin.isenburg@gmail.com
13 
14  COPYRIGHT:
15 
16  (c) 2010-2011, 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  25 December 2010 -- created after swinging in Mara's hammock for hours
28 
29 ===============================================================================
30 */
31 #ifndef LAS_UTILITY_HPP
32 #define LAS_UTILITY_HPP
33 
34 #include "lasdefinitions.hpp"
35 
37 {
38 public:
39  BOOL active() const { return (first == false); };
48  BOOL add(const LASpoint* point);
49  LASinventory();
50 private:
52 };
53 
55 {
56 public:
57  BOOL active() const { return (first == false); };
67  BOOL add(const LASpoint* point);
68  LASsummary();
69 private:
71 };
72 
73 class LASbin
74 {
75 public:
76  void add(I32 item);
77  void add(I64 item);
78  void add(F64 item);
79  void add(I32 item, I32 value);
80  void report(FILE* file, const char* name=0, const char* name_avg=0) const;
81  LASbin(F32 step);
82  ~LASbin();
83 private:
84  void add_to_bin(I32 bin);
96 };
97 
99 {
100 public:
101  BOOL active() const { return is_active; };
102  BOOL parse(int argc, char* argv[]);
103  BOOL histo(const char* name, F32 step);
104  BOOL histo_avg(const char* name, F32 step, const char* name_avg);
105  void add(const LASpoint* point);
106  void report(FILE* file) const;
107  LAShistogram();
108  ~LAShistogram();
109 private:
111  // counter bins
124  // averages bins
131 };
132 
134 {
135 public:
136  void reset();
137  BOOL add(const LASpoint* point);
138  BOOL add(I32 pos_x, I32 pos_y);
139  BOOL occupied(const LASpoint* point) const;
140  BOOL occupied(I32 pos_x, I32 pos_y) const;
141  BOOL active() const;
142  U32 get_num_occupied() const { return num_occupied; };
143  BOOL write_asc_grid(const char* file_name) const;
144 
145  // read from file or write to file
146 // BOOL read(ByteStreamIn* stream);
147 // BOOL write(ByteStreamOut* stream) const;
148 
152 private:
153  BOOL add_internal(I32 pos_x, I32 pos_y);
171 };
172 
173 #endif
LASsummary::number_of_returns_of_given_pulse
U32 number_of_returns_of_given_pulse[8]
Definition: lasutility.hpp:60
LASbin::bins_neg
U32 * bins_neg
Definition: lasutility.hpp:93
LAShistogram::classification_bin_intensity
LASbin * classification_bin_intensity
Definition: lasutility.hpp:125
LAShistogram::intensity_bin
LASbin * intensity_bin
Definition: lasutility.hpp:115
LASoccupancyGrid::minus_minus_sizes
U16 * minus_minus_sizes
Definition: lasutility.hpp:159
LASbin::one_over_step
F32 one_over_step
Definition: lasutility.hpp:87
LAShistogram::scan_angle_bin_z
LASbin * scan_angle_bin_z
Definition: lasutility.hpp:127
LAShistogram::return_map_bin_intensity
LASbin * return_map_bin_intensity
Definition: lasutility.hpp:130
LAShistogram::gps_time_bin
LASbin * gps_time_bin
Definition: lasutility.hpp:119
LAShistogram::scan_angle_bin_intensity
LASbin * scan_angle_bin_intensity
Definition: lasutility.hpp:129
LASsummary::min
LASpoint min
Definition: lasutility.hpp:65
LASoccupancyGrid::occupied
BOOL occupied(const LASpoint *point) const
Definition: lasutility.cpp:772
LASpoint
Definition: lasdefinitions.hpp:472
LASinventory::active
BOOL active() const
Definition: lasutility.hpp:39
LASoccupancyGrid::reset
void reset()
Definition: lasutility.cpp:863
LAShistogram::~LAShistogram
~LAShistogram()
Definition: lasutility.cpp:417
I64
long long I64
Definition: mydefs.hpp:48
LASinventory
Definition: lasutility.hpp:36
LASbin::add_to_bin
void add_to_bin(I32 bin)
Definition: lasutility.cpp:208
F64
double F64
Definition: mydefs.hpp:52
LASinventory::LASinventory
LASinventory()
Definition: lasutility.cpp:37
LASinventory::raw_max_x
I32 raw_max_x
Definition: lasutility.hpp:42
LASoccupancyGrid::write_asc_grid
BOOL write_asc_grid(const char *file_name) const
Definition: lasutility.cpp:910
I32
int I32
Definition: mydefs.hpp:35
LASinventory::add
BOOL add(const LASpoint *point)
Definition: lasutility.cpp:48
LAShistogram
Definition: lasutility.hpp:98
LASbin
Definition: lasutility.hpp:73
LASsummary::first
BOOL first
Definition: lasutility.hpp:70
LAShistogram::point_source_id_bin
LASbin * point_source_id_bin
Definition: lasutility.hpp:118
LASsummary::active
BOOL active() const
Definition: lasutility.hpp:57
LASsummary::number_of_point_records
U32 number_of_point_records
Definition: lasutility.hpp:57
LAShistogram::wavepacket_index_bin
LASbin * wavepacket_index_bin
Definition: lasutility.hpp:120
LASsummary::classification
U32 classification[32]
Definition: lasutility.hpp:61
LASsummary
Definition: lasutility.hpp:54
LAShistogram::histo
BOOL histo(const char *name, F32 step)
Definition: lasutility.cpp:478
LASoccupancyGrid::num_occupied
U32 num_occupied
Definition: lasutility.hpp:170
LAShistogram::wavepacket_offset_bin
LASbin * wavepacket_offset_bin
Definition: lasutility.hpp:121
LASoccupancyGrid::active
BOOL active() const
Definition: lasutility.cpp:857
LASoccupancyGrid::anker
I32 anker
Definition: lasutility.hpp:155
LAShistogram::classification_bin_scan_angle
LASbin * classification_bin_scan_angle
Definition: lasutility.hpp:126
LAShistogram::z_bin
LASbin * z_bin
Definition: lasutility.hpp:114
LASoccupancyGrid::max_y
I32 max_y
Definition: lasutility.hpp:151
LAShistogram::histo_avg
BOOL histo_avg(const char *name, F32 step, const char *name_avg)
Definition: lasutility.cpp:513
LAShistogram::LAShistogram
LAShistogram()
Definition: lasutility.cpp:392
LASinventory::raw_max_z
I32 raw_max_z
Definition: lasutility.hpp:46
LASoccupancyGrid::get_num_occupied
U32 get_num_occupied() const
Definition: lasutility.hpp:142
LAShistogram::add
void add(const LASpoint *point)
Definition: lasutility.cpp:560
LASoccupancyGrid::minus_minus_size
U32 minus_minus_size
Definition: lasutility.hpp:157
LASinventory::raw_min_z
I32 raw_min_z
Definition: lasutility.hpp:47
LASbin::count
I64 count
Definition: lasutility.hpp:86
LASsummary::max
LASpoint max
Definition: lasutility.hpp:66
LAShistogram::is_active
BOOL is_active
Definition: lasutility.hpp:110
LASoccupancyGrid::add_internal
BOOL add_internal(I32 pos_x, I32 pos_y)
Definition: lasutility.cpp:652
LASoccupancyGrid
Definition: lasutility.hpp:133
LASbin::add
void add(I32 item)
Definition: lasutility.cpp:184
LASbin::size_pos
I32 size_pos
Definition: lasutility.hpp:90
LASoccupancyGrid::plus_plus_size
U32 plus_plus_size
Definition: lasutility.hpp:167
LASoccupancyGrid::plus_minus
U32 ** plus_minus
Definition: lasutility.hpp:165
LASsummary::classification_keypoint
U32 classification_keypoint
Definition: lasutility.hpp:63
LAShistogram::x_bin
LASbin * x_bin
Definition: lasutility.hpp:112
U16
unsigned short U16
Definition: mydefs.hpp:40
LASsummary::classification_withheld
U32 classification_withheld
Definition: lasutility.hpp:64
LASbin::report
void report(FILE *file, const char *name=0, const char *name_avg=0) const
Definition: lasutility.cpp:323
LASoccupancyGrid::max_x
I32 max_x
Definition: lasutility.hpp:151
LASoccupancyGrid::~LASoccupancyGrid
~LASoccupancyGrid()
Definition: lasutility.cpp:962
LAShistogram::wavepacket_size_bin
LASbin * wavepacket_size_bin
Definition: lasutility.hpp:122
LASsummary::LASsummary
LASsummary()
Definition: lasutility.cpp:71
BOOL
int BOOL
Definition: mydefs.hpp:57
LASbin::bins_pos
U32 * bins_pos
Definition: lasutility.hpp:92
LASoccupancyGrid::minus_plus_sizes
U16 * minus_plus_sizes
Definition: lasutility.hpp:162
argc
int argc
Definition: tests_high_five_parallel.cpp:27
LAShistogram::wavepacket_location_bin
LASbin * wavepacket_location_bin
Definition: lasutility.hpp:123
LAShistogram::y_bin
LASbin * y_bin
Definition: lasutility.hpp:113
LASbin::values_pos
F64 * values_pos
Definition: lasutility.hpp:94
file
FILE * file
Definition: arithmeticencoder.cpp:77
LASoccupancyGrid::LASoccupancyGrid
LASoccupancyGrid(F32 grid_spacing)
Definition: lasutility.cpp:941
F32
float F32
Definition: mydefs.hpp:51
LASoccupancyGrid::min_x
I32 min_x
Definition: lasutility.hpp:151
LASsummary::add
BOOL add(const LASpoint *point)
Definition: lasutility.cpp:84
LASbin::total
F64 total
Definition: lasutility.hpp:85
LASoccupancyGrid::plus_plus
U32 ** plus_plus
Definition: lasutility.hpp:168
LASbin::values_neg
F64 * values_neg
Definition: lasutility.hpp:95
LASoccupancyGrid::plus_ankers
I32 * plus_ankers
Definition: lasutility.hpp:163
LASbin::~LASbin
~LASbin()
Definition: lasutility.cpp:176
LASoccupancyGrid::min_y
I32 min_y
Definition: lasutility.hpp:151
LASoccupancyGrid::plus_minus_sizes
U16 * plus_minus_sizes
Definition: lasutility.hpp:166
LAShistogram::scan_angle_bin_number_of_returns
LASbin * scan_angle_bin_number_of_returns
Definition: lasutility.hpp:128
LASoccupancyGrid::minus_ankers
I32 * minus_ankers
Definition: lasutility.hpp:156
LASbin::anker
I32 anker
Definition: lasutility.hpp:89
LASinventory::first
BOOL first
Definition: lasutility.hpp:51
LASoccupancyGrid::grid_spacing
F32 grid_spacing
Definition: lasutility.hpp:154
LASsummary::classification_synthetic
U32 classification_synthetic
Definition: lasutility.hpp:62
LASinventory::number_of_point_records
U32 number_of_point_records
Definition: lasutility.hpp:39
U32
unsigned int U32
Definition: mydefs.hpp:39
LASoccupancyGrid::add
BOOL add(const LASpoint *point)
Definition: lasutility.cpp:613
LASbin::LASbin
LASbin(F32 step)
Definition: lasutility.cpp:162
LASbin::size_neg
I32 size_neg
Definition: lasutility.hpp:91
LASoccupancyGrid::minus_plus
U32 ** minus_plus
Definition: lasutility.hpp:161
LAShistogram::report
void report(FILE *file) const
Definition: lasutility.cpp:589
LAShistogram::scan_angle_bin
LASbin * scan_angle_bin
Definition: lasutility.hpp:117
LASsummary::number_of_points_by_return
U32 number_of_points_by_return[8]
Definition: lasutility.hpp:59
LAShistogram::parse
BOOL parse(int argc, char *argv[])
Definition: lasutility.cpp:441
LASbin::first
BOOL first
Definition: lasutility.hpp:88
LASoccupancyGrid::minus_plus_size
U32 minus_plus_size
Definition: lasutility.hpp:160
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
LASoccupancyGrid::minus_minus
U32 ** minus_minus
Definition: lasutility.hpp:158
lasdefinitions.hpp
LAShistogram::classification_bin
LASbin * classification_bin
Definition: lasutility.hpp:116
LASinventory::raw_max_y
I32 raw_max_y
Definition: lasutility.hpp:44
scripts.create_png.step
step
Definition: create_png.py:42
LAShistogram::active
BOOL active() const
Definition: lasutility.hpp:101
LASinventory::raw_min_x
I32 raw_min_x
Definition: lasutility.hpp:43
LASinventory::raw_min_y
I32 raw_min_y
Definition: lasutility.hpp:45
LASoccupancyGrid::plus_minus_size
U32 plus_minus_size
Definition: lasutility.hpp:164
LASoccupancyGrid::plus_plus_sizes
U16 * plus_plus_sizes
Definition: lasutility.hpp:169
LASinventory::number_of_points_by_return
U32 number_of_points_by_return[8]
Definition: lasutility.hpp:41


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:23