PLYIO.hpp
Go to the documentation of this file.
1 
41 #ifndef __PLY_IO_H__
42 #define __PLY_IO_H__
43 
44 #include "lvr2/io/BaseIO.hpp"
45 
46 #include <rply.h>
47 #include <stdint.h>
48 #include <cstdio>
49 #include <vector>
50 
51 #include <locale.h>
52 
53 namespace lvr2
54 {
55 
104 class PLYIO : public BaseIO
105 {
106  public:
111  {
112  setlocale (LC_ALL, "C");
113  m_model.reset();
114  }
115 
116  ~PLYIO() {}
117 
118 
127  void save( string filename );
128 
129  void save(ModelPtr model, string filename)
130  {
131  m_model = model;
132  save(filename);
133  }
134 
135 
150  ModelPtr read( string filename, bool readColor, bool readConfidence = true,
151  bool readIntensity = true, bool readNormals = true,
152  bool readFaces = true, bool readPanoramaCoords = true );
153 
154 
162  ModelPtr read( string filename );
163 
164 
165  private:
166 
167 
172  static int readVertexCb( p_ply_argument argument );
173 
174 
179  static int readColorCb( p_ply_argument argument );
180 
181 
186  static int readFaceCb( p_ply_argument argument );
187 
188 
193  static int readPanoramaCoordCB( p_ply_argument argument );
194 
195 };
196 
197 } // namespace lvr2
198 
199 #endif
A class for input and output to ply files.
Definition: PLYIO.hpp:104
void save(string filename)
Save PLY with previously specified data.
Definition: PLYIO.cpp:57
ModelPtr read(string filename, bool readColor, bool readConfidence=true, bool readIntensity=true, bool readNormals=true, bool readFaces=true, bool readPanoramaCoords=true)
Read specified PLY file.
Definition: PLYIO.cpp:419
void save(ModelPtr model, string filename)
Definition: PLYIO.hpp:129
Interface specification for low-level io. All read elements are stored in linear arrays.
Definition: BaseIO.hpp:57
static int readColorCb(p_ply_argument argument)
Callback for read color information.
Definition: PLYIO.cpp:935
ModelPtr m_model
Definition: BaseIO.hpp:104
static int readPanoramaCoordCB(p_ply_argument argument)
Callback for read panorama coords.
Definition: PLYIO.cpp:971
static int readFaceCb(p_ply_argument argument)
Callback for read faces.
Definition: PLYIO.cpp:947
Base interface for all I/O related classes.
static int readVertexCb(p_ply_argument argument)
Callback for read vertices.
Definition: PLYIO.cpp:924
std::shared_ptr< Model > ModelPtr
Definition: Model.hpp:80
PLYIO()
Constructor.
Definition: PLYIO.hpp:110


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