licornea_tools
ply_exporter.h
Go to the documentation of this file.
1 #ifndef LICORNEA_PLY_EXPORTER_H_
2 #define LICORNEA_PLY_EXPORTER_H_
3 
4 #include <fstream>
5 #include <string>
6 #include "point.h"
7 #include "io.h"
8 
9 namespace tlz {
10 
12 
13 class ply_exporter {
14 private:
15  std::ofstream file_;
16  std::ofstream::pos_type vertex_count_string_position_;
17  std::size_t count_ = 0;
18 
19  const line_delimitor line_delimitor_;
20  bool full_;
21  bool ascii_;
22 
23  void write_line_(const std::string& ln);
24 
25  void write_binary_(const point_xyz&);
26  void write_ascii_(const point_xyz&);
27  void write_full_binary_(const point_full&);
28  void write_full_ascii_(const point_full&);
29 
30 
31 public:
32  explicit ply_exporter(
33  const std::string& filename,
34  bool full = true,
35  bool ascii = false,
37  );
38  ~ply_exporter();
39 
40  template<typename It> void write(It begin, It end);
41 
42  void close();
43 };
44 
45 }
46 
47 #include "ply_exporter.tcc"
48 
49 #endif
Exports point cloud into PLY file.
Definition: ply_exporter.h:13
void write(It begin, It end)
ply_exporter(const std::string &filename, bool full=true, bool ascii=false, line_delimitor ld=line_delimitor::LF)
Definition: ply_exporter.cc:13
line_delimitor
Definition: io.h:11