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
lvr2::BigVolumen::VolumeCellInfo::size
size_t size
Definition: BigVolumen.hpp:65
lvr2::BigVolumen::m_maxIndexX
size_t m_maxIndexX
Definition: BigVolumen.hpp:116
lvr2::BigVolumen::VolumeCellInfo::ofs_points
std::ofstream ofs_points
Definition: BigVolumen.hpp:72
lvr2::BigVolumen::m_scale
float m_scale
Definition: BigVolumen.hpp:131
lvr2::BigVolumen::m_bb
BoundingBox< BaseVecT > m_bb
Definition: BigVolumen.hpp:129
lvr2::BigVolumen::m_PointFile
boost::iostreams::mapped_file m_PointFile
Definition: BigVolumen.hpp:126
lvr2::BigVolumen::m_maxIndex
size_t m_maxIndex
Definition: BigVolumen.hpp:115
lvr2::BigVolumen::BigVolumen
BigVolumen(std::vector< std::string >, float voxelsize, float overlapping_size=0, float scale=1)
lvr2::BigVolumen::VolumeCellInfo::iz
size_t iz
Definition: BigVolumen.hpp:69
lvr2::BigVolumen::VolumeCellInfo::overlapping_size
size_t overlapping_size
Definition: BigVolumen.hpp:66
lvr2::BigVolumen::VolumeCellInfo::VolumeCellInfo
VolumeCellInfo()
Definition: BigVolumen.hpp:64
lvr2::BigVolumen::getCellinfo
std::unordered_map< size_t, VolumeCellInfo > * getCellinfo()
Definition: BigVolumen.hpp:109
lvr2::BigVolumen::~BigVolumen
virtual ~BigVolumen()
lvr2::BigVolumen::m_maxIndexY
size_t m_maxIndexY
Definition: BigVolumen.hpp:117
lvr2::BigVolumen::getBB
BoundingBox< BaseVecT > & getBB()
Definition: BigVolumen.hpp:97
lvr2::BigVolumen::size
size_t size()
lvr2::BigVolumen::m_has_normal
bool m_has_normal
Definition: BigVolumen.hpp:123
lvr2::BigVolumen
Definition: BigVolumen.hpp:58
lvr2::BigVolumen::m_has_color
bool m_has_color
Definition: BigVolumen.hpp:124
lvr2::BigVolumen::VolumeCellInfo::ofs_normals
std::ofstream ofs_normals
Definition: BigVolumen.hpp:73
lvr2::BigVolumen::hasColors
bool hasColors()
Definition: BigVolumen.hpp:106
lvr2::BigVolumen::hashValue
size_t hashValue(size_t i, size_t j, size_t k)
Definition: BigVolumen.hpp:101
lvr2::BigVolumen::calcIndex
int calcIndex(float f)
Definition: BigVolumen.hpp:112
lvr2::BigVolumen::m_gridNumPoints
std::unordered_map< size_t, VolumeCellInfo > m_gridNumPoints
Definition: BigVolumen.hpp:130
DataStruct.hpp
Datastructures for holding loaded data.
lvr2::BigVolumen::VolumeCellInfo::ofs_colors
std::ofstream ofs_colors
Definition: BigVolumen.hpp:74
lvr2::BigVolumen::VolumeCellInfo::path
std::string path
Definition: BigVolumen.hpp:70
lvr2::BigVolumen::m_maxIndexZ
size_t m_maxIndexZ
Definition: BigVolumen.hpp:118
lvr2::BigVolumen::VolumeCellInfo::ix
size_t ix
Definition: BigVolumen.hpp:67
lvr2::BigVolumen::pointSize
size_t pointSize()
lvr2::BigVolumen::m_ColorFile
boost::iostreams::mapped_file m_ColorFile
Definition: BigVolumen.hpp:128
lvr2::BoundingBox
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
lvr2::BigVolumen::VolumeCellInfo::bb
BoundingBox< BaseVecT > bb
Definition: BigVolumen.hpp:71
lvr2::BigVolumen::m_voxelSize
float m_voxelSize
Definition: BigVolumen.hpp:120
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::BigVolumen::hasNormals
bool hasNormals()
Definition: BigVolumen.hpp:107
lvr2::BigVolumen::VolumeCellInfo
Definition: BigVolumen.hpp:62
lvr2::BigVolumen::m_extrude
bool m_extrude
Definition: BigVolumen.hpp:121
BoundingBox.hpp
lvr2::BigVolumen::m_maxIndexSquare
size_t m_maxIndexSquare
Definition: BigVolumen.hpp:114
lvr2::BigVolumen::m_NomralFile
boost::iostreams::mapped_file m_NomralFile
Definition: BigVolumen.hpp:127
lvr2::BigVolumen::VolumeCellInfo::iy
size_t iy
Definition: BigVolumen.hpp:68
lvr2::BigVolumen::m_numPoints
size_t m_numPoints
Definition: BigVolumen.hpp:119


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