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
LASspatial::get_intersected_cells
virtual BOOL get_intersected_cells()=0
LASspatial::get_max_x
virtual F64 get_max_x() const =0
LASspatial::intersect_rectangle
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
LASspatial::~LASspatial
virtual ~LASspatial()
Definition: lasspatial.hpp:45
LASspatial::has_more_cells
virtual BOOL has_more_cells()=0
F64
double F64
Definition: mydefs.hpp:52
I32
int I32
Definition: mydefs.hpp:35
LASspatial::write
virtual BOOL write(ByteStreamOut *stream) const =0
LASspatial::inside
virtual BOOL inside(const F64 x, const F64 y) const =0
LASspatial::get_min_x
virtual F64 get_min_x() const =0
LASspatial::intersect_circle
virtual U32 intersect_circle(const F64 center_x, const F64 center_y, const F64 radius)=0
LASspatial::current_cell
I32 current_cell
Definition: lasspatial.hpp:81
LASspatial::get_all_cells
virtual BOOL get_all_cells()=0
LASspatial
Definition: lasspatial.hpp:42
LASspatial::manage_cell
virtual BOOL manage_cell(const U32 cell_index, const BOOL finalize=FALSE)=0
LASspatial::get_max_y
virtual F64 get_max_y() const =0
ByteStreamOut
Definition: bytestreamout.hpp:36
mydefs.hpp
LASspatialReadWrite::write
BOOL write(const LASspatial *spatial, ByteStreamOut *stream) const
Definition: lasspatial.cpp:76
ByteStreamIn
Definition: bytestreamin.hpp:36
LASspatial::get_cell_index
virtual U32 get_cell_index(const F64 x, const F64 y) const =0
BOOL
int BOOL
Definition: mydefs.hpp:57
LASspatial::coarsen
virtual BOOL coarsen(const I32 cell_index, I32 *coarser_cell_index, U32 *num_cell_indices, I32 **cell_indices) const =0
LASspatial::read
virtual BOOL read(ByteStreamIn *stream)=0
FALSE
#define FALSE
Definition: mydefs.hpp:133
F32
float F32
Definition: mydefs.hpp:51
LASspatial::get_cell_bounding_box
virtual void get_cell_bounding_box(const I32 cell_index, F32 *min, F32 *max) const =0
LASspatialReadWrite
Definition: lasspatial.hpp:84
U32
unsigned int U32
Definition: mydefs.hpp:39
LASspatialReadWrite::read
LASspatial * read(ByteStreamIn *stream) const
Definition: lasspatial.cpp:38
LASspatial::intersect_tile
virtual U32 intersect_tile(const F32 ll_x, const F32 ll_y, const F32 size)=0
LASspatial::get_min_y
virtual F64 get_min_y() 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 Wed Mar 2 2022 00:37:23