BigVolumen.hpp
Go to the documentation of this file.
1 
28 /*
29  * BigVolumen.hpp
30  *
31  * Created on: Jul 17, 2017
32  * Author: Isaak Mitschke
33  */
34 
35 #ifndef LAS_VEGAS_BigVolumen_HPP
36 #define LAS_VEGAS_BigVolumen_HPP
37 
39 #include "lvr2/io/DataStruct.hpp"
40 
41 #include <boost/archive/binary_iarchive.hpp>
42 #include <boost/archive/binary_oarchive.hpp>
43 #include <boost/iostreams/device/mapped_file.hpp>
44 #include <fstream>
45 #include <sstream>
46 #include <string>
47 #include <unordered_map>
48 #include <utility>
49 
50 #ifndef __APPLE__
51 #include <omp.h>
52 #endif
53 
54 namespace lvr2
55 {
56 
57 template <typename BaseVecT>
59 {
60 
61  public:
63  {
65  size_t size;
67  size_t ix;
68  size_t iy;
69  size_t iz;
70  std::string path;
72  std::ofstream ofs_points;
73  std::ofstream ofs_normals;
74  std::ofstream ofs_colors;
75  };
76 
82  BigVolumen(std::vector<std::string>,
83  float voxelsize,
84  float overlapping_size = 0,
85  float scale = 1);
86 
90  size_t size();
91 
95  size_t pointSize();
96 
98 
99  virtual ~BigVolumen();
100 
101  inline size_t hashValue(size_t i, size_t j, size_t k)
102  {
103  return i * m_maxIndexSquare + j * m_maxIndex + k;
104  }
105 
106  inline bool hasColors() { return m_has_color; }
107  inline bool hasNormals() { return m_has_normal; }
108 
109  inline std::unordered_map<size_t, VolumeCellInfo>* getCellinfo() { return &m_gridNumPoints; };
110 
111  private:
112  inline int calcIndex(float f) { return f < 0 ? f - .5 : f + .5; }
113 
115  size_t m_maxIndex;
116  size_t m_maxIndexX;
117  size_t m_maxIndexY;
118  size_t m_maxIndexZ;
119  size_t m_numPoints;
120  float m_voxelSize;
121  bool m_extrude;
122 
125 
126  boost::iostreams::mapped_file m_PointFile;
127  boost::iostreams::mapped_file m_NomralFile;
128  boost::iostreams::mapped_file m_ColorFile;
130  std::unordered_map<size_t, VolumeCellInfo> m_gridNumPoints;
131  float m_scale;
132 };
133 
134 } // namespace lvr2
135 
136 #include "lvr2/reconstruction/BigVolumen.tcc"
137 
138 #endif // LAS_VEGAS_BigVolumen_HPP
Datastructures for holding loaded data.
size_t m_maxIndexSquare
Definition: BigVolumen.hpp:114
virtual ~BigVolumen()
BoundingBox< BaseVecT > m_bb
Definition: BigVolumen.hpp:129
boost::iostreams::mapped_file m_PointFile
Definition: BigVolumen.hpp:126
size_t hashValue(size_t i, size_t j, size_t k)
Definition: BigVolumen.hpp:101
boost::iostreams::mapped_file m_NomralFile
Definition: BigVolumen.hpp:127
BigVolumen(std::vector< std::string >, float voxelsize, float overlapping_size=0, float scale=1)
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
std::unordered_map< size_t, VolumeCellInfo > m_gridNumPoints
Definition: BigVolumen.hpp:130
int calcIndex(float f)
Definition: BigVolumen.hpp:112
size_t pointSize()
BoundingBox< BaseVecT > & getBB()
Definition: BigVolumen.hpp:97
boost::iostreams::mapped_file m_ColorFile
Definition: BigVolumen.hpp:128
std::unordered_map< size_t, VolumeCellInfo > * getCellinfo()
Definition: BigVolumen.hpp:109
BoundingBox< BaseVecT > bb
Definition: BigVolumen.hpp:71


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