hdf5/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 namespace hdf5features
16 {
17 
18 template <typename Derived, typename T>
19 struct IOType;
20 
21 template <typename Derived>
22 struct IOType<Derived, MeshBufferPtr> {
24 };
25 
26 template <typename Derived>
27 struct IOType<Derived, PointBufferPtr> {
29 };
30 
31 template <typename Derived>
32 class ChunkIO
33 {
34  public:
35  void saveAmount(BaseVector<std::size_t> amount);
36 
37  void saveChunkSize(float chunkSize);
38 
39  void saveBoundingBox(BoundingBox<BaseVector<float>> boundingBox);
40 
41  void save(BaseVector<std::size_t> amount,
42  float chunkSize,
43  BoundingBox<BaseVector<float>> boundingBox);
44 
45  template <typename T>
46  void saveChunk(T data, std::string layer, int x, int y, int z);
47 
48  BaseVector<size_t> loadAmount();
49 
50  float loadChunkSize();
51 
52  BoundingBox<BaseVector<float>> loadBoundingBox();
53 
54  template <typename T>
55  T loadChunk(std::string layer, int x, int y, int z);
56 
57  protected:
58  Derived* m_file_access = static_cast<Derived*>(this);
59  ArrayIO<Derived>* m_array_io = static_cast<ArrayIO<Derived>*>(m_file_access);
60 
61  private:
62  const std::string m_chunkName = "chunks";
63  const std::string m_amountName = "amount";
64  const std::string m_chunkSizeName = "size";
65  const std::string m_boundingBoxName = "bounding_box";
66 };
67 
68 } // namespace hdf5features
69 
73 template <typename Derived>
74 struct Hdf5Construct<hdf5features::ChunkIO, Derived>
75 {
76  // DEPS
80  using deps = typename dep1::template Merge<dep2>::template Merge<dep3>;
81 
82  // add actual feature
83  using type = typename deps::template add_features<hdf5features::ChunkIO>::type;
84 };
85 
86 } // namespace lvr2
87 
88 #include "ChunkIO.tcc"
89 
90 #endif
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
Hdf5IO Feature for handling PointBuffer related IO.
typename Hdf5Construct< hdf5features::MeshIO, Derived >::type dep2
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
Helper class how to construct a IO feature with its dependencies.
typename deps::template add_features< hdf5features::ChunkIO >::type type
Hdf5IO Feature for handling MeshBuffer related IO.
Definition: MeshIO.hpp:52
typename Hdf5Construct< hdf5features::PointCloudIO, Derived >::type dep3
typename Derived::template add_features< Feature >::type type
typename dep1::template Merge< dep2 >::template Merge< dep3 > deps
typename Hdf5Construct< hdf5features::ArrayIO, Derived >::type dep1


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