descriptions/ChunkIO.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef LVR2_IO_HDF5_CHUNKIO_HPP
3 #define LVR2_IO_HDF5_CHUNKIO_HPP
4 
5 #include "ArrayIO.hpp"
6 #include "MeshIO.hpp"
7 #include "PointCloudIO.hpp"
10 #include "lvr2/io/Model.hpp"
11 
12 namespace lvr2
13 {
14 
15 template <typename FeatureBase, typename T>
16 struct IOType;
17 
18 template <typename FeatureBase>
20  using io_type = MeshIO<FeatureBase>;
21 };
22 
23 template <typename FeatureBase>
26 };
27 
28 template <typename FeatureBase>
29 class ChunkIO
30 {
31  public:
32  void saveAmount(BaseVector<std::size_t> amount);
33 
34  void saveChunkSize(float chunkSize);
35 
36  void saveBoundingBox(BoundingBox<BaseVector<float>> boundingBox);
37 
38  void save(BaseVector<std::size_t> amount,
39  float chunkSize,
40  BoundingBox<BaseVector<float>> boundingBox);
41 
42  template <typename T>
43  void saveChunk(T data, std::string layer, int x, int y, int z);
44 
45  BaseVector<size_t> loadAmount();
46 
47  float loadChunkSize();
48 
49  BoundingBox<BaseVector<float>> loadBoundingBox();
50 
51  template <typename T>
52  T loadChunk(std::string layer, int x, int y, int z);
53 
54  protected:
55  FeatureBase* m_file_access = static_cast<FeatureBase*>(this);
56  ArrayIO<FeatureBase>* m_array_io = static_cast<ArrayIO<FeatureBase>*>(m_file_access);
57 
58  private:
59  const std::string m_chunkName = "chunks";
60  const std::string m_amountName = "amount";
61  const std::string m_chunkSizeName = "size";
62  const std::string m_boundingBoxName = "bounding_box";
63 };
64 
68 template <typename FeatureBase>
70 {
71  // DEPS
75  using deps = typename dep1::template Merge<dep2>::template Merge<dep3>;
76 
77  // add actual feature
78  using type = typename deps::template add_features<ChunkIO>::type;
79 };
80 
81 } // namespace lvr2
82 
83 #include "ChunkIO.tcc"
84 
85 #endif
Manager Class for all FeatureBase components located in hdf5 directory.
Definition: FeatureBase.hpp:31
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
Helper class how to construct a IO feature with its dependencies.
Definition: FeatureBase.hpp:20
typename FeatureConstruct< MeshIO, FeatureBase >::type dep2
typename FeatureConstruct< ArrayIO, FeatureBase >::type dep1
typename dep1::template Merge< dep2 >::template Merge< dep3 > deps
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
typename Derived::template add_features< Feature >::type type
typename FeatureConstruct< PointCloudIO, FeatureBase >::type dep3
typename deps::template add_features< ChunkIO >::type type
Hdf5IO Feature for handling PointBuffer related IO.


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