ChunkIO.hpp
Go to the documentation of this file.
1 
35 #ifndef CHUNKIO_HPP
36 #define CHUNKIO_HPP
37 
39 #include "lvr2/io/Model.hpp"
40 
42 #include "lvr2/io/hdf5/ArrayIO.hpp"
44 #include "lvr2/io/hdf5/MeshIO.hpp"
46 
47 namespace lvr2 {
53 
54 class ChunkIO{
55 
56  public:
57  ChunkIO();
62  ChunkIO(std::string filePath);
63 
67  void writeBasicStructure(BaseVector<std::size_t> amount, float chunksize, BoundingBox<BaseVector<float>> boundingBox);
68 
72  void writeChunk(lvr2::MeshBufferPtr mesh, size_t x, size_t y, size_t z);
73 
77  lvr2::MeshBufferPtr loadChunk(std::string chunkName);
78 
83 
88 
92  float loadChunkSize();
96  void writeVoxelSize(float voxelSize);
100  float readVoxelSize();
104  boost::shared_array<bool> lsrLoadExtruded(string chunkName);
108  boost::shared_array<float> lsrLoadQueryPoints(string chunkName);
112  size_t lsrLoadNumCells(string chunkName);
116  boost::shared_array<float> lsrLoadCenters(string chunkName);
125  void writeTSDF(string cellName,
126  size_t csize,
127  boost::shared_array<float> centers,
128  boost::shared_array<bool> extruded,
129  boost::shared_array<float> queryPoints);
130 
131  private:
132  // path to the hdf5 file
133  std::string m_filePath;
134  // hdf5Io object to save and load chunks
136 
137 
138  // default names for the groups
139  const std::string m_chunkName = "chunks";
140  const std::string m_amountName = "amount";
141  const std::string m_chunkSizeName = "size";
142  const std::string m_boundingBoxName = "bounding_box";
143 
144 
145 };
146 } // namespace lvr2
147 
148 #endif //CHUNKIO_HPP
BaseVector< size_t > loadAmount()
loads and returns a BaseVector with the amount of chunks in each dimension
Definition: ChunkIO.cpp:83
ChunkHDF5IO m_hdf5IO
Definition: ChunkIO.hpp:135
HalfEdgeMesh< Vec > mesh
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
std::string m_filePath
Definition: ChunkIO.hpp:133
void writeTSDF(string cellName, size_t csize, boost::shared_array< float > centers, boost::shared_array< bool > extruded, boost::shared_array< float > queryPoints)
Writes the parameters in the HDF5 file.
Definition: ChunkIO.cpp:163
void writeBasicStructure(BaseVector< std::size_t > amount, float chunksize, BoundingBox< BaseVector< float >> boundingBox)
write amount, chunksize and the bounding box in the hdf5 file
Definition: ChunkIO.cpp:53
lvr2::MeshBufferPtr loadChunk(std::string chunkName)
load a mesh from a group with the given cellIndex
Definition: ChunkIO.cpp:140
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
const std::string m_boundingBoxName
Definition: ChunkIO.hpp:142
Manager Class for all Hdf5IO components located in hdf5 directory.
Hdf5IO Feature for handling MeshBuffer related IO.
Definition: MeshIO.hpp:52
void writeVoxelSize(float voxelSize)
save reconstruction voxelsize in HDF5
Definition: ChunkIO.cpp:145
lvr2::Hdf5IO< lvr2::hdf5features::ArrayIO, lvr2::hdf5features::ChannelIO, lvr2::hdf5features::VariantChannelIO, lvr2::hdf5features::MeshIO > ChunkHDF5IO
Definition: ChunkIO.hpp:52
BoundingBox< BaseVector< float > > loadBoundingBox()
loads and returns the bounding box for the complete original mesh (that got chunked) ...
Definition: ChunkIO.cpp:120
Hdf5IO Feature for handling VariantChannel related IO.
float loadChunkSize()
loads and returns the chunksize
Definition: ChunkIO.cpp:101
void writeChunk(lvr2::MeshBufferPtr mesh, size_t x, size_t y, size_t z)
write a mesh in a group with the given cellIndex
Definition: ChunkIO.cpp:70
boost::shared_array< float > lsrLoadCenters(string chunkName)
loads and returns the centers for the cells/voxel in one chunk
Definition: ChunkIO.cpp:185
boost::shared_array< float > lsrLoadQueryPoints(string chunkName)
loads and returns the Querypoint-distances for the cells/voxel of one chunk
Definition: ChunkIO.cpp:226
const std::string m_chunkSizeName
Definition: ChunkIO.hpp:141
size_t lsrLoadNumCells(string chunkName)
loads and returns the number of cells/voxel in the chunk
Definition: ChunkIO.cpp:209
boost::shared_array< bool > lsrLoadExtruded(string chunkName)
load the extruded value for the cells/voxel of one chunk
Definition: ChunkIO.cpp:250
const std::string m_amountName
Definition: ChunkIO.hpp:140
float readVoxelSize()
returns the voxelsize
Definition: ChunkIO.cpp:156
const std::string m_chunkName
Definition: ChunkIO.hpp:139


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