Public Member Functions | Static Private Member Functions | List of all members
lvr2::PLYIO Class Reference

A class for input and output to ply files. More...

#include "io/PLYIO.hpp"

Inheritance diagram for lvr2::PLYIO:
Inheritance graph
[legend]

Public Member Functions

 PLYIO ()
 Constructor. More...
 
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. More...
 
ModelPtr read (string filename)
 Read specified PLY file. More...
 
void save (string filename)
 Save PLY with previously specified data. More...
 
void save (ModelPtr model, string filename)
 
 ~PLYIO ()
 
- Public Member Functions inherited from lvr2::BaseIO
 BaseIO ()
 
virtual ModelPtr getModel ()
 Get the model for io operations. More...
 
virtual ModelPtr read (std::string filename)=0
 Parse the given file and load supported elements. More...
 
virtual void save (std::string filename)=0
 Save the loaded elements to the given file. More...
 
virtual void save (ModelPtr model, std::string filename)
 Set the model and save the loaded elements to the given file. More...
 
virtual void setModel (ModelPtr m)
 Set the model for io operations to use. More...
 
virtual ~BaseIO ()
 

Static Private Member Functions

static int readColorCb (p_ply_argument argument)
 Callback for read color information. More...
 
static int readFaceCb (p_ply_argument argument)
 Callback for read faces. More...
 
static int readPanoramaCoordCB (p_ply_argument argument)
 Callback for read panorama coords. More...
 
static int readVertexCb (p_ply_argument argument)
 Callback for read vertices. More...
 

Additional Inherited Members

- Protected Attributes inherited from lvr2::BaseIO
ModelPtr m_model
 

Detailed Description

A class for input and output to ply files.

The PLYIO class provides functionalities for reading and writing the Polygon File Format, also known as Stanford Triangle Format. Both binary and ascii modes are supported. For the actual file handling the RPly library is used.

The following list is a short description of all handled elements and properties of ply files. In short the elements vertex and face specifies a mesh and the element point specifies a pointcloud. However there is one exception to this: If neither point nor face is defined, it is assumed that the read vertices are meant to be points and thus are loaded as pointcloud.

ELEMENT vertex
   PROPERTY              x (float)
   PROPERTY              y (float)
   PROPERTY              z (float)
   PROPERTY            red (unsigned char)
   PROPERTY          green (unsigned char)
   PROPERTY           blue (unsigned char)
   PROPERTY             nx (float)
   PROPERTY             ny (float)
   PROPERTY             nz (float)
   PROPERTY      intensity (float)
   PROPERTY     confidence (float)
   PROPERTY       x_coords (short)  <<  [only read]
   PROPERTY       y_coords (short)  <<  [only read]
ELEMENT point
   PROPERTY              x (float)
   PROPERTY              y (float)
   PROPERTY              z (float)
   PROPERTY            red (unsigned char)
   PROPERTY          green (unsigned char)
   PROPERTY           blue (unsigned char)
   PROPERTY             nx (float)
   PROPERTY             ny (float)
   PROPERTY             nz (float)
   PROPERTY      intensity (float)
   PROPERTY     confidence (float)
   PROPERTY       x_coords (short)  <<  [only read]
   PROPERTY       y_coords (short)  <<  [only read]
ELEMENT face
   PROPERTY vertex_indices (LIST uchar int)
   PROPERTY   vertex_index (LIST uchar int)  <<  [only read]

Definition at line 104 of file PLYIO.hpp.

Constructor & Destructor Documentation

◆ PLYIO()

lvr2::PLYIO::PLYIO ( )
inline

Constructor.

Definition at line 110 of file PLYIO.hpp.

◆ ~PLYIO()

lvr2::PLYIO::~PLYIO ( )
inline

Definition at line 116 of file PLYIO.hpp.

Member Function Documentation

◆ read() [1/2]

ModelPtr lvr2::PLYIO::read ( string  filename,
bool  readColor,
bool  readConfidence = true,
bool  readIntensity = true,
bool  readNormals = true,
bool  readFaces = true,
bool  readPanoramaCoords = true 
)

Read specified PLY file.

Read a specified PLY file. The additional parameters specify the data to be read. The default is to read all available data.

Parameters
filenameFilename of file to read.
readColorSpecifies if color should be read.
readConfidenceSpecifies if confidence should be read.
readIntensitySpecifies if intensity should be read.
readNormalsSpecifies if normals should be read.
readFacesSpecifies if faces should be read.
readPanoramaCoordsSpecifies if panorama coordinates should be read.

Definition at line 419 of file PLYIO.cpp.

◆ read() [2/2]

ModelPtr lvr2::PLYIO::read ( string  filename)

Read specified PLY file.

Read a specified PLY file with all available data.

Parameters
filenameFilename of file to read.

Definition at line 405 of file PLYIO.cpp.

◆ readColorCb()

int lvr2::PLYIO::readColorCb ( p_ply_argument  argument)
staticprivate

Callback for read color information.

Parameters
argumentArgument to pass the read data.

Definition at line 935 of file PLYIO.cpp.

◆ readFaceCb()

int lvr2::PLYIO::readFaceCb ( p_ply_argument  argument)
staticprivate

Callback for read faces.

Parameters
argumentArgument to pass the read data.

Definition at line 947 of file PLYIO.cpp.

◆ readPanoramaCoordCB()

int lvr2::PLYIO::readPanoramaCoordCB ( p_ply_argument  argument)
staticprivate

Callback for read panorama coords.

Parameters
argumentArgument to pass the read data.

Definition at line 971 of file PLYIO.cpp.

◆ readVertexCb()

int lvr2::PLYIO::readVertexCb ( p_ply_argument  argument)
staticprivate

Callback for read vertices.

Parameters
argumentArgument to pass the read data.

Definition at line 924 of file PLYIO.cpp.

◆ save() [1/2]

void lvr2::PLYIO::save ( string  filename)

Save PLY with previously specified data.

Save a PLY file with given filename. The mode is automatically set to little endian binary.

Parameters
filenameFilename of the output file.

Definition at line 57 of file PLYIO.cpp.

◆ save() [2/2]

void lvr2::PLYIO::save ( ModelPtr  model,
string  filename 
)
inline

Definition at line 129 of file PLYIO.hpp.


The documentation for this class was generated from the following files:


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