FileKernel.hpp
Go to the documentation of this file.
1 #ifndef FILE_KERNEL_HPP
2 #define FILE_KERNEL_HPP
3 
4 #include <string>
5 #include <vector>
6 #include <regex>
7 #include <boost/optional.hpp>
8 #include <yaml-cpp/yaml.h>
9 
10 #include <opencv2/opencv.hpp>
11 #include <opencv2/core.hpp>
12 
14 #include "lvr2/io/PointBuffer.hpp"
15 #include "lvr2/io/MeshBuffer.hpp"
16 
17 namespace lvr2
18 {
19 
21 {
22 public:
23 
24  FileKernel() = delete;
25  FileKernel(const std::string& res) : m_fileResourceName(res) {};
26 
27  virtual void saveMeshBuffer(
28  const std::string& group,
29  const std::string& container,
30  const MeshBufferPtr& buffer) const = 0;
31 
32  virtual void savePointBuffer(
33  const std::string& group,
34  const std::string& container,
35  const PointBufferPtr& buffer) const = 0;
36 
37  virtual void saveImage(
38  const std::string& group,
39  const std::string& container,
40  const cv::Mat& image) const = 0;
41 
42  virtual void saveMetaYAML(
43  const std::string& group,
44  const std::string& metaName,
45  const YAML::Node& node) const = 0;
46 
48  const std::string& group,
49  const std::string container) const = 0;
50 
52  const std::string& group,
53  const std::string& container) const = 0;
54 
55  virtual boost::optional<cv::Mat> loadImage(
56  const std::string& group,
57  const std::string& container) const = 0;
58 
62  virtual void loadMetaYAML(
63  const std::string& group,
64  const std::string& container,
65  YAML::Node& node) const = 0;
66 
67  virtual ucharArr loadUCharArray(
68  const std::string& group,
69  const std::string& constainer,
70  std::vector<size_t>& dims) const = 0;
71 
72  virtual floatArr loadFloatArray(
73  const std::string& group,
74  const std::string& constainer,
75  std::vector<size_t>& dims) const = 0;
76 
77  virtual doubleArr loadDoubleArray(
78  const std::string& group,
79  const std::string& constainer,
80  std::vector<size_t>& dims) const = 0;
81 
82  virtual void saveFloatArray(
83  const std::string& groupName,
84  const std::string& datasetName,
85  const std::vector<size_t>& dimensions,
86  const boost::shared_array<float>& data) const = 0;
87 
88  virtual void saveDoubleArray(
89  const std::string& groupName,
90  const std::string& datasetName,
91  const std::vector<size_t>& dimensions,
92  const boost::shared_array<double>& data) const = 0;
93 
94  virtual void saveUCharArray(
95  const std::string& groupName,
96  const std::string& datasetName,
97  const std::vector<size_t>& dimensions,
98  const boost::shared_array<unsigned char>& data) const = 0;
99 
100  virtual bool exists(const std::string& group) const = 0;
101  virtual bool exists(const std::string& group, const std::string& container) const = 0;
102 
103  virtual void subGroupNames(const std::string& group, std::vector<string>& subGroupNames) const = 0;
104  virtual void subGroupNames(const std::string& group, const std::regex& filter, std::vector<string>& subGroupNames) const = 0;
105 
106 protected:
107  std::string m_fileResourceName;
108 };
109 
110 using FileKernelPtr = std::shared_ptr<FileKernel>;
111 
112 } // namespace lvr2
113 
114 #endif
virtual bool exists(const std::string &group) const =0
virtual void saveMetaYAML(const std::string &group, const std::string &metaName, const YAML::Node &node) const =0
virtual void saveDoubleArray(const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< double > &data) const =0
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
FileKernel()=delete
virtual boost::optional< cv::Mat > loadImage(const std::string &group, const std::string &container) const =0
boost::shared_array< double > doubleArr
Definition: DataStruct.hpp:134
boost::shared_array< unsigned char > ucharArr
Definition: DataStruct.hpp:137
virtual void saveUCharArray(const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< unsigned char > &data) const =0
virtual floatArr loadFloatArray(const std::string &group, const std::string &constainer, std::vector< size_t > &dims) const =0
virtual MeshBufferPtr loadMeshBuffer(const std::string &group, const std::string container) const =0
virtual void savePointBuffer(const std::string &group, const std::string &container, const PointBufferPtr &buffer) const =0
std::shared_ptr< PointBuffer > PointBufferPtr
virtual doubleArr loadDoubleArray(const std::string &group, const std::string &constainer, std::vector< size_t > &dims) const =0
virtual void saveImage(const std::string &group, const std::string &container, const cv::Mat &image) const =0
virtual ucharArr loadUCharArray(const std::string &group, const std::string &constainer, std::vector< size_t > &dims) const =0
boost::shared_array< float > floatArr
Definition: DataStruct.hpp:133
void filter(lvr2::PointBufferPtr &cloud, lvr2::indexArray &inlier, size_t j)
virtual void saveFloatArray(const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< float > &data) const =0
virtual void subGroupNames(const std::string &group, std::vector< string > &subGroupNames) const =0
virtual void loadMetaYAML(const std::string &group, const std::string &container, YAML::Node &node) const =0
std::shared_ptr< FileKernel > FileKernelPtr
Definition: FileKernel.hpp:110
virtual PointBufferPtr loadPointBuffer(const std::string &group, const std::string &container) const =0
std::string m_fileResourceName
Definition: FileKernel.hpp:107
virtual void saveMeshBuffer(const std::string &group, const std::string &container, const MeshBufferPtr &buffer) const =0
FileKernel(const std::string &res)
Definition: FileKernel.hpp:25


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