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:
36 
37  void saveChunkSize(float chunkSize);
38 
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 
49 
50  float loadChunkSize();
51 
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);
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
BaseVector.hpp
lvr2::Hdf5Construct< hdf5features::ChunkIO, Derived >::type
typename deps::template add_features< hdf5features::ChunkIO >::type type
Definition: hdf5/ChunkIO.hpp:83
PointCloudIO.hpp
lvr2::BaseVector< std::size_t >
lvr2::hdf5features::ChunkIO::m_chunkSizeName
const std::string m_chunkSizeName
Definition: hdf5/ChunkIO.hpp:64
MeshIO.hpp
lvr2::Hdf5Construct::type
typename Derived::template add_features< Feature >::type type
Definition: HDF5FeatureBase.hpp:165
lvr2::hdf5features::ChunkIO::m_boundingBoxName
const std::string m_boundingBoxName
Definition: hdf5/ChunkIO.hpp:65
lvr2::hdf5features::ChunkIO::saveChunkSize
void saveChunkSize(float chunkSize)
lvr2::hdf5features::ChunkIO::loadBoundingBox
BoundingBox< BaseVector< float > > loadBoundingBox()
lvr2::PointBufferPtr
std::shared_ptr< PointBuffer > PointBufferPtr
Definition: PointBuffer.hpp:130
lvr2::Hdf5Construct< hdf5features::ChunkIO, Derived >::dep3
typename Hdf5Construct< hdf5features::PointCloudIO, Derived >::type dep3
Definition: hdf5/ChunkIO.hpp:79
lvr2::Hdf5Construct< hdf5features::ChunkIO, Derived >::dep1
typename Hdf5Construct< hdf5features::ArrayIO, Derived >::type dep1
Definition: hdf5/ChunkIO.hpp:77
lvr2::hdf5features::ChunkIO
Definition: hdf5/ChunkIO.hpp:32
lvr2::hdf5features::ChunkIO::m_file_access
Derived * m_file_access
Definition: hdf5/ChunkIO.hpp:58
lvr2::hdf5features::ChunkIO::save
void save(BaseVector< std::size_t > amount, float chunkSize, BoundingBox< BaseVector< float >> boundingBox)
lvr2::ChunkIO
Definition: ChunkIO.hpp:54
lvr2::hdf5features::ChunkIO::loadChunk
T loadChunk(std::string layer, int x, int y, int z)
lvr2::hdf5features::ChunkIO::loadAmount
BaseVector< size_t > loadAmount()
lvr2::Hdf5Construct< hdf5features::ChunkIO, Derived >::dep2
typename Hdf5Construct< hdf5features::MeshIO, Derived >::type dep2
Definition: hdf5/ChunkIO.hpp:78
lvr2::hdf5features::ChunkIO::saveChunk
void saveChunk(T data, std::string layer, int x, int y, int z)
lvr2::hdf5features::IOType
Definition: hdf5/ChunkIO.hpp:19
lvr2::hdf5features::PointCloudIO
Hdf5IO Feature for handling PointBuffer related IO.
Definition: hdf5/PointCloudIO.hpp:47
lvr2::hdf5features::ChunkIO::saveAmount
void saveAmount(BaseVector< std::size_t > amount)
Model.hpp
HDF5FeatureBase.hpp
lvr2::BoundingBox
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
lvr2::hdf5features::ChunkIO::loadChunkSize
float loadChunkSize()
lvr2::hdf5features::ChunkIO::saveBoundingBox
void saveBoundingBox(BoundingBox< BaseVector< float >> boundingBox)
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::hdf5features::ChunkIO::m_chunkName
const std::string m_chunkName
Definition: hdf5/ChunkIO.hpp:62
lvr2::MeshBufferPtr
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
lvr2::Hdf5Construct
Helper class how to construct a IO feature with its dependencies.
Definition: HDF5FeatureBase.hpp:27
lvr2::hdf5features::ChunkIO::m_amountName
const std::string m_amountName
Definition: hdf5/ChunkIO.hpp:63
lvr2::hdf5features::ArrayIO
Definition: hdf5/ArrayIO.hpp:13
ArrayIO.hpp
lvr2::Hdf5Construct< hdf5features::ChunkIO, Derived >::deps
typename dep1::template Merge< dep2 >::template Merge< dep3 > deps
Definition: hdf5/ChunkIO.hpp:80
lvr2::hdf5features::ChunkIO::m_array_io
ArrayIO< Derived > * m_array_io
Definition: hdf5/ChunkIO.hpp:59
lvr2::hdf5features::MeshIO
Hdf5IO Feature for handling MeshBuffer related IO.
Definition: MeshIO.hpp:52


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