mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ply_exporter.h
Go to the documentation of this file.
1 #include <fstream>
2 #include <string>
3 #include "../point_cloud/point.h"
4 #include "../utility/io.h"
5 #include "../ndarray/ndarray_view.h"
6 
7 namespace mf {
8 
10 
11 class ply_exporter {
12 private:
13  std::ofstream file_;
14  std::ofstream::pos_type vertex_count_string_position_;
15  std::size_t count_ = 0;
16 
17  const line_delimitor line_delimitor_;
18  bool full_;
19  bool ascii_;
20 
21  void write_line_(const std::string& ln);
22 
23  void write_binary_(const point_xyz&);
24  void write_ascii_(const point_xyz&);
25  void write_binary_(const point_full&);
26  void write_ascii_(const point_full&);
27 
28 
29 public:
30  explicit ply_exporter(
31  const std::string& filename,
32  bool full = true,
33  bool ascii = false,
35  );
36  ~ply_exporter();
37 
41  void close();
42 };
43 
44 }
void write(const ndarray_view< 1, const point_xyz > &)
Definition: ply_exporter.cc:69
Mapping between coordinates, indices, and addresses of multi-dimensional data.
Definition: ndarray_view.h:16
ply_exporter(const std::string &filename, bool full=true, bool ascii=false, line_delimitor ld=line_delimitor::LF)
Definition: ply_exporter.cc:13
Exports point cloud into PLY file.
Definition: ply_exporter.h:11
~ply_exporter()
Definition: ply_exporter.cc:54
Point cloud point with only XYZ coordinates.
Definition: point.h:14
Point cloud point with XYZ coordinates, normal vector, weight, and RGB color.
Definition: point.h:52
line_delimitor
Definition: io.h:11
void close()
Definition: ply_exporter.cc:59