lasspatial.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: lasspatial.hpp
5 
6  CONTENTS:
7 
8  A base class for spatial management of LAS data allowing spatial indexing
9  with quad trees, kd trees, tilings, or other spatial subdivisions.
10 
11  PROGRAMMERS:
12 
13  martin.isenburg@gmail.com
14 
15  COPYRIGHT:
16 
17  (c) 2009-11, Martin Isenburg, LASSO - tools to catch reality
18 
19  This is free software; you can redistribute and/or modify it under the
20  terms of the GNU Lesser General Licence as published by the Free Software
21  Foundation. See the COPYING file for more information.
22 
23  This software is distributed WITHOUT ANY WARRANTY and without even the
24  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 
26  CHANGE HISTORY:
27 
28  4 May 2011 -- created before meeting with Silke at the Marktplatz in OF
29 
30 ===============================================================================
31 */
32 #ifndef LAS_SPATIAL_HPP
33 #define LAS_SPATIAL_HPP
34 
35 #include "mydefs.hpp"
36 
37 class ByteStreamIn;
38 class ByteStreamOut;
39 
40 #define LAS_SPATIAL_QUAD_TREE 0
41 
43 {
44 public:
45  virtual ~LASspatial() {};
46 
47  // read from file or write to file
48  virtual BOOL read(ByteStreamIn* stream) = 0;
49  virtual BOOL write(ByteStreamOut* stream) const = 0;
50 
51  // create or finalize the cell (in the spatial hierarchy)
52  virtual BOOL manage_cell(const U32 cell_index, const BOOL finalize=FALSE) = 0;
53 
54  // map points to cells
55  virtual BOOL inside(const F64 x, const F64 y) const = 0;
56  virtual U32 get_cell_index(const F64 x, const F64 y) const = 0;
57 
58  // map cells to coarser cells
59  virtual BOOL coarsen(const I32 cell_index, I32* coarser_cell_index, U32* num_cell_indices, I32** cell_indices) const = 0;
60 
61  // describe cells
62  virtual void get_cell_bounding_box(const I32 cell_index, F32* min, F32* max) const = 0;
63  virtual void get_cell_bounding_box(const F64 x, const F64 y, F32* min, F32* max) const = 0;
64 
65  // decribe spatial extend
66  virtual F64 get_min_x() const = 0;
67  virtual F64 get_min_y() const = 0;
68  virtual F64 get_max_x() const = 0;
69  virtual F64 get_max_y() const = 0;
70 
71  // query spatial intersections
72  virtual U32 intersect_rectangle(const F64 r_min_x, const F64 r_min_y, const F64 r_max_x, const F64 r_max_y) = 0;
73  virtual U32 intersect_tile(const F32 ll_x, const F32 ll_y, const F32 size) = 0;
74  virtual U32 intersect_circle(const F64 center_x, const F64 center_y, const F64 radius) = 0;
75 
76  // iterate over cells
77  virtual BOOL get_all_cells() = 0;
78  virtual BOOL get_intersected_cells() = 0;
79  virtual BOOL has_more_cells() = 0;
80 
82 };
83 
85 {
86 public:
87  LASspatial* read(ByteStreamIn* stream) const;
88  BOOL write(const LASspatial* spatial, ByteStreamOut* stream) const;
89 };
90 
91 #endif
int BOOL
Definition: mydefs.hpp:57
virtual BOOL get_intersected_cells()=0
#define FALSE
Definition: mydefs.hpp:133
virtual U32 intersect_circle(const F64 center_x, const F64 center_y, const F64 radius)=0
float F32
Definition: mydefs.hpp:51
virtual U32 intersect_tile(const F32 ll_x, const F32 ll_y, const F32 size)=0
virtual F64 get_min_y() const =0
unsigned int U32
Definition: mydefs.hpp:39
virtual F64 get_max_x() const =0
virtual F64 get_min_x() const =0
I32 current_cell
Definition: lasspatial.hpp:81
virtual BOOL inside(const F64 x, const F64 y) const =0
virtual U32 intersect_rectangle(const F64 r_min_x, const F64 r_min_y, const F64 r_max_x, const F64 r_max_y)=0
virtual BOOL has_more_cells()=0
virtual BOOL get_all_cells()=0
virtual ~LASspatial()
Definition: lasspatial.hpp:45
virtual BOOL manage_cell(const U32 cell_index, const BOOL finalize=FALSE)=0
int I32
Definition: mydefs.hpp:35
virtual F64 get_max_y() const =0
virtual BOOL read(ByteStreamIn *stream)=0
virtual U32 get_cell_index(const F64 x, const F64 y) const =0
virtual BOOL coarsen(const I32 cell_index, I32 *coarser_cell_index, U32 *num_cell_indices, I32 **cell_indices) const =0
virtual void get_cell_bounding_box(const I32 cell_index, F32 *min, F32 *max) const =0
double F64
Definition: mydefs.hpp:52
virtual BOOL write(ByteStreamOut *stream) const =0


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