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); };
60  U32 number_of_returns_of_given_pulse[8];
61  U32 classification[32];
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 
149  LASoccupancyGrid(F32 grid_spacing);
150  ~LASoccupancyGrid();
151  I32 min_x, min_y, max_x, max_y;
152 private:
153  BOOL add_internal(I32 pos_x, I32 pos_y);
171 };
172 
173 #endif
BOOL first
Definition: lasutility.hpp:88
int BOOL
Definition: mydefs.hpp:57
LASpoint max
Definition: lasutility.hpp:66
I32 size_neg
Definition: lasutility.hpp:91
float F32
Definition: mydefs.hpp:51
LASbin * classification_bin_intensity
Definition: lasutility.hpp:125
U32 * bins_pos
Definition: lasutility.hpp:92
LASbin * wavepacket_offset_bin
Definition: lasutility.hpp:121
LASbin * classification_bin_scan_angle
Definition: lasutility.hpp:126
LASbin * gps_time_bin
Definition: lasutility.hpp:119
unsigned int U32
Definition: mydefs.hpp:39
I32 anker
Definition: lasutility.hpp:89
F32 one_over_step
Definition: lasutility.hpp:87
BOOL add(const LASpoint *point)
Definition: lasutility.cpp:48
unsigned short U16
Definition: mydefs.hpp:40
U32 number_of_point_records
Definition: lasutility.hpp:39
F64 * values_pos
Definition: lasutility.hpp:94
LASpoint min
Definition: lasutility.hpp:65
long long I64
Definition: mydefs.hpp:48
LASbin * scan_angle_bin
Definition: lasutility.hpp:117
U32 number_of_point_records
Definition: lasutility.hpp:57
LASbin * wavepacket_location_bin
Definition: lasutility.hpp:123
BOOL active() const
Definition: lasutility.hpp:39
LASbin * classification_bin
Definition: lasutility.hpp:116
U32 * bins_neg
Definition: lasutility.hpp:93
LASbin * return_map_bin_intensity
Definition: lasutility.hpp:130
LASbin * intensity_bin
Definition: lasutility.hpp:115
LASbin * scan_angle_bin_intensity
Definition: lasutility.hpp:129
LASbin * scan_angle_bin_z
Definition: lasutility.hpp:127
U32 number_of_points_by_return[8]
Definition: lasutility.hpp:41
LASbin * x_bin
Definition: lasutility.hpp:112
LASbin * wavepacket_size_bin
Definition: lasutility.hpp:122
FILE * file
int I32
Definition: mydefs.hpp:35
F64 total
Definition: lasutility.hpp:85
LASbin * y_bin
Definition: lasutility.hpp:113
I64 count
Definition: lasutility.hpp:86
LASbin * scan_angle_bin_number_of_returns
Definition: lasutility.hpp:128
I32 size_pos
Definition: lasutility.hpp:90
LASbin * wavepacket_index_bin
Definition: lasutility.hpp:120
U32 classification_withheld
Definition: lasutility.hpp:64
LASbin * z_bin
Definition: lasutility.hpp:114
LASbin * point_source_id_bin
Definition: lasutility.hpp:118
U32 classification_synthetic
Definition: lasutility.hpp:62
U32 classification_keypoint
Definition: lasutility.hpp:63
F64 * values_neg
Definition: lasutility.hpp:95
BOOL active() const
Definition: lasutility.hpp:101
double F64
Definition: mydefs.hpp:52
U32 get_num_occupied() const
Definition: lasutility.hpp:142
char ** argv


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