lasreader_las.hpp
Go to the documentation of this file.
1 /*
2 ===============================================================================
3 
4  FILE: lasreader_las.hpp
5 
6  CONTENTS:
7 
8  Reads LIDAR points from the LAS format (Version 1.x , April 29, 2008).
9 
10  PROGRAMMERS:
11 
12  martin.isenburg@gmail.com
13 
14  COPYRIGHT:
15 
16  (c) 2007-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  5 November 2011 -- changed default IO buffer size with setvbuf() to 65536
28  21 January 2011 -- adapted from lasreader to create abstract reader class
29  3 December 2010 -- updated to (somewhat) support LAS format 1.3
30  7 September 2008 -- updated to support LAS format 1.2
31  18 February 2007 -- created after repairing 2 vacuum cleaners in the garden
32 
33 ===============================================================================
34 */
35 #ifndef LAS_READER_LAS_HPP
36 #define LAS_READER_LAS_HPP
37 
38 #include "lasreader.hpp"
39 
40 #include <stdio.h>
41 
42 #ifdef LZ_WIN32_VC6
43 #include <fstream.h>
44 #else
45 #include <istream>
46 #include <fstream>
47 using namespace std;
48 #endif
49 
50 class LASreadPoint;
51 
52 class LASreaderLAS : public LASreader
53 {
54 public:
55 
56  BOOL open(const char* file_name, U32 io_buffer_size=65536);
57  BOOL open(FILE* file);
58  BOOL open(istream& stream);
59 
60  I32 get_format() const;
61 
62  BOOL seek(const I64 p_index);
63 
64  ByteStreamIn* get_stream() const;
65  void close(BOOL close_stream=TRUE);
66 
67  LASreaderLAS();
68  virtual ~LASreaderLAS();
69 
70 protected:
71  virtual BOOL open(ByteStreamIn* stream);
72  virtual BOOL read_point_default();
73 
74 private:
75  FILE* file;
78 };
79 
80 class LASreaderLASrescale : public virtual LASreaderLAS
81 {
82 public:
83  LASreaderLASrescale(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor);
84 
85 protected:
86  virtual BOOL open(ByteStreamIn* stream);
87  virtual BOOL read_point_default();
88  BOOL rescale_x, rescale_y, rescale_z;
89  F64 scale_factor[3];
90  F64 orig_x_scale_factor, orig_y_scale_factor, orig_z_scale_factor;
91 };
92 
93 class LASreaderLASreoffset : public virtual LASreaderLAS
94 {
95 public:
96  LASreaderLASreoffset(F64 x_offset, F64 y_offset, F64 z_offset);
97 
98 protected:
99  virtual BOOL open(ByteStreamIn* stream);
100  virtual BOOL read_point_default();
101  BOOL reoffset_x, reoffset_y, reoffset_z;
102  F64 offset[3];
103  F64 orig_x_offset, orig_y_offset, orig_z_offset;
104 };
105 
107 {
108 public:
109  LASreaderLASrescalereoffset(F64 x_scale_factor, F64 y_scale_factor, F64 z_scale_factor, F64 x_offset, F64 y_offset, F64 z_offset);
110 
111 protected:
112  BOOL open(ByteStreamIn* stream);
113  BOOL read_point_default();
114 };
115 
116 #endif
LASreaderLAS::stream
ByteStreamIn * stream
Definition: lasreader_las.hpp:76
LASreaderLASreoffset
Definition: lasreader_las.hpp:93
lasreader.hpp
I64
long long I64
Definition: mydefs.hpp:48
F64
double F64
Definition: mydefs.hpp:52
LASreadPoint
Definition: lasreadpoint.hpp:48
I32
int I32
Definition: mydefs.hpp:35
TRUE
#define TRUE
Definition: mydefs.hpp:137
LASreaderLASrescale::orig_z_scale_factor
F64 orig_z_scale_factor
Definition: lasreader_las.hpp:90
LASreaderLASreoffset::reoffset_z
BOOL reoffset_z
Definition: lasreader_las.hpp:101
LASreaderLASreoffset::orig_z_offset
F64 orig_z_offset
Definition: lasreader_las.hpp:103
LASreaderLASrescale
Definition: lasreader_las.hpp:80
LASreader
Definition: lasreader.hpp:49
LASreaderLAS::reader
LASreadPoint * reader
Definition: lasreader_las.hpp:77
LASreaderLAS
Definition: lasreader_las.hpp:52
LASreaderLASrescale::rescale_z
BOOL rescale_z
Definition: lasreader_las.hpp:88
ByteStreamIn
Definition: bytestreamin.hpp:36
BOOL
int BOOL
Definition: mydefs.hpp:57
file
FILE * file
Definition: arithmeticencoder.cpp:77
LASreaderLASrescalereoffset
Definition: lasreader_las.hpp:106
std
Definition: HalfEdge.hpp:124
U32
unsigned int U32
Definition: mydefs.hpp:39
LASreaderLAS::file
FILE * file
Definition: lasreader_las.hpp:75
lvr2::hdf5util::open
std::shared_ptr< HighFive::File > open(const std::string &filename)
Definition: Hdf5Util.cpp:202


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