LineReader.hpp
Go to the documentation of this file.
1 
28 /*
29  * LineReader.hpp
30  *
31  * Created on: Aug 15, 2017
32  * Author: Isaak Mitschke
33  */
34 
35 #ifndef LAS_VEGAS_LINEREADER_HPP
36 #define LAS_VEGAS_LINEREADER_HPP
37 
38 #include "DataStruct.hpp"
39 
40 #include <boost/shared_array.hpp>
41 #include <exception>
42 #include <string>
43 
44 namespace lvr2
45 {
46 
48 {
49  XYZ,
53 };
54 
56 {
57  std::string m_filePath;
58  size_t m_filePos;
62  bool m_ply;
63  bool m_binary;
65 };
66 
67 struct __attribute__((packed)) xyz
68 {
69  lvr2::coord<float> point;
70 };
71 
72 struct __attribute__((packed)) xyzn : xyz
73 {
74  lvr2::coord<float> normal;
75 };
76 
77 struct __attribute__((packed)) xyznc : xyzn
78 {
80 };
81 struct __attribute__((packed)) xyzc : xyz
82 {
84 };
85 
86 
88 {
89 public:
90  LineReader();
91  LineReader(std::string filePath);
92  LineReader(std::vector<std::string> filePaths);
93  void open(std::string filePath);
94  void open(std::vector<std::string> filePaths);
95  size_t getNumPoints();
96  bool getNextPoint(xyznc &point);
97  // boost::shared_array<xyzn> getNextPoints(size_t &return_amount, size_t amount =
98  // 1000000); boost::shared_array<xyzc> getNextPoints(size_t &return_amount, size_t amount
99  // = 1000000); boost::shared_array<xyznc> getNextPoints(size_t &return_amount, size_t
100  // amount = 1000000);
101  boost::shared_ptr<void> getNextPoints(size_t &return_amount, size_t amount = 1000000);
102  fileType getFileType(size_t i);
103  fileType getFileType();
104  void rewind(size_t i);
105  void rewind();
106  bool ok();
107  bool isPly() { return m_ply; }
108 
109  class readException : public std::exception
110  {
111  public:
112  readException(std::string what) : error_msg(what) {}
113  virtual const char *what() const throw() { return error_msg.c_str(); }
114 
115  private:
116  std::string error_msg;
117  };
118 
119 private:
120  std::vector<std::string> m_filePaths;
121  std::vector<size_t> m_filePos;
125  bool m_ply;
126  bool m_binary;
128  size_t m_numFiles;
131  std::vector<fileAttribut> m_fileAttributes;
132 };
133 
134 } // namespace lvr2
135 
136 #endif // LAS_VEGAS_LINEREADER_H
Datastructures for holding loaded data.
size_t m_PointBlockSize
Definition: LineReader.hpp:124
struct __attribute__((packed)) xyz
Definition: LineReader.hpp:67
size_t m_line_element_amount
Definition: LineReader.hpp:127
size_t m_line_element_amount
Definition: LineReader.hpp:64
size_t m_elementAmount
Definition: LineReader.hpp:122
fileType m_fileType
Definition: LineReader.hpp:123
size_t m_currentReadFile
Definition: LineReader.hpp:129
std::vector< std::string > m_filePaths
Definition: LineReader.hpp:120
std::vector< size_t > m_filePos
Definition: LineReader.hpp:121
readException(std::string what)
Definition: LineReader.hpp:112
std::shared_ptr< HighFive::File > open(const std::string &filename)
Definition: Hdf5Util.cpp:202
std::string m_filePath
Definition: LineReader.hpp:57
virtual const char * what() const
Definition: LineReader.hpp:113
std::vector< fileAttribut > m_fileAttributes
Definition: LineReader.hpp:131


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