Point Cloud Library (PCL)  1.7.2
List of all members | Public Types | Public Member Functions
pcl::PLYReader Class Reference

Point Cloud Data (PLY) file format reader. More...

#include <pcl/io/ply_io.h>

+ Inheritance diagram for pcl::PLYReader:

Public Types

enum  { PLY_V0 = 0, PLY_V1 = 1 }

Public Member Functions

 PLYReader ()
 PLYReader (const PLYReader &p)
PLYReaderoperator= (const PLYReader &p)
 ~PLYReader ()
int readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &ply_version, int &data_type, unsigned int &data_idx, const int offset=0)
 Read a point cloud data header from a PLY file.
int read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &ply_version, const int offset=0)
 Read a point cloud data from a PLY file and store it into a pcl/PCLPointCloud2.
int read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset=0)
 Read a point cloud data from a PLY file and store it into a pcl/PCLPointCloud2.
template<typename PointT >
int read (const std::string &file_name, pcl::PointCloud< PointT > &cloud, const int offset=0)
 Read a point cloud data from any PLY file, and convert it to the given template format.
int read (const std::string &file_name, pcl::PolygonMesh &mesh, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &ply_version, const int offset=0)
 Read a point cloud data from a PLY file and store it into a pcl/PolygonMesh.
int read (const std::string &file_name, pcl::PolygonMesh &mesh, const int offset=0)
 Read a point cloud data from a PLY file and store it into a pcl/PolygonMesh.
- Public Member Functions inherited from pcl::FileReader
 FileReader ()
 empty constructor
virtual ~FileReader ()
 empty destructor

Detailed Description

Point Cloud Data (PLY) file format reader.

The PLY data format is organized in the following way: lines beginning with "comment" are treated as comments

Author
Nizar Sallem

Definition at line 77 of file ply_io.h.

Member Enumeration Documentation

anonymous enum
Enumerator:
PLY_V0 
PLY_V1 

Definition at line 80 of file ply_io.h.

Constructor & Destructor Documentation

pcl::PLYReader::PLYReader ( )
inline

Definition at line 86 of file ply_io.h.

pcl::PLYReader::PLYReader ( const PLYReader p)
inline

Definition at line 100 of file ply_io.h.

pcl::PLYReader::~PLYReader ( )
inline

Definition at line 126 of file ply_io.h.

Member Function Documentation

PLYReader& pcl::PLYReader::operator= ( const PLYReader p)
inline

Definition at line 117 of file ply_io.h.

int pcl::PLYReader::read ( const std::string &  file_name,
pcl::PCLPointCloud2 cloud,
Eigen::Vector4f &  origin,
Eigen::Quaternionf &  orientation,
int &  ply_version,
const int  offset = 0 
)
virtual

Read a point cloud data from a PLY file and store it into a pcl/PCLPointCloud2.

Parameters
[in]file_namethe name of the file containing the actual PointCloud data
[out]cloudthe resultant PointCloud message read from disk
[in]originthe sensor data acquisition origin (translation)
[in]orientationthe sensor data acquisition origin (rotation)
[out]ply_versionthe PLY version read from the file
[in]offsetthe offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).

Implements pcl::FileReader.

Referenced by pcl::io::loadPLYFile().

int pcl::PLYReader::read ( const std::string &  file_name,
pcl::PCLPointCloud2 cloud,
const int  offset = 0 
)
inline

Read a point cloud data from a PLY file and store it into a pcl/PCLPointCloud2.

Note
This function is provided for backwards compatibility only
Parameters
[in]file_namethe name of the file containing the actual PointCloud data
[out]cloudthe resultant PointCloud message read from disk
[in]offsetthe offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).

Reimplemented from pcl::FileReader.

Definition at line 181 of file ply_io.h.

References pcl::read().

template<typename PointT >
int pcl::PLYReader::read ( const std::string &  file_name,
pcl::PointCloud< PointT > &  cloud,
const int  offset = 0 
)
inline

Read a point cloud data from any PLY file, and convert it to the given template format.

Parameters
[in]file_namethe name of the file containing the actual PointCloud data
[out]cloudthe resultant PointCloud message read from disk
[in]offsetthe offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).

Reimplemented from pcl::FileReader.

Definition at line 199 of file ply_io.h.

References pcl::fromPCLPointCloud2(), pcl::read(), pcl::PointCloud< PointT >::sensor_orientation_, and pcl::PointCloud< PointT >::sensor_origin_.

int pcl::PLYReader::read ( const std::string &  file_name,
pcl::PolygonMesh mesh,
Eigen::Vector4f &  origin,
Eigen::Quaternionf &  orientation,
int &  ply_version,
const int  offset = 0 
)

Read a point cloud data from a PLY file and store it into a pcl/PolygonMesh.

Parameters
[in]file_namethe name of the file containing the actual PointCloud data
[out]meshthe resultant PolygonMesh message read from disk
[in]originthe sensor data acquisition origin (translation)
[in]orientationthe sensor data acquisition origin (rotation)
[out]ply_versionthe PLY version read from the file
[in]offsetthe offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).
int pcl::PLYReader::read ( const std::string &  file_name,
pcl::PolygonMesh mesh,
const int  offset = 0 
)

Read a point cloud data from a PLY file and store it into a pcl/PolygonMesh.

Parameters
[in]file_namethe name of the file containing the actual PointCloud data
[out]meshthe resultant PolygonMesh message read from disk
[in]offsetthe offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).
int pcl::PLYReader::readHeader ( const std::string &  file_name,
pcl::PCLPointCloud2 cloud,
Eigen::Vector4f &  origin,
Eigen::Quaternionf &  orientation,
int &  ply_version,
int &  data_type,
unsigned int &  data_idx,
const int  offset = 0 
)
virtual

Read a point cloud data header from a PLY file.

Load only the meta information (number of points, their types, etc), and not the points themselves, from a given PLY file. Useful for fast evaluation of the underlying data structure.

Returns:

  • < 0 (-1) on error
  • > 0 on success
    Parameters
    [in]file_namethe name of the file to load
    [out]cloudthe resultant point cloud dataset (only the header will be filled)
    [in]originthe sensor data acquisition origin (translation)
    [in]orientationthe sensor data acquisition origin (rotation)
    [out]ply_versionthe PLY version read from the file
    [out]data_typethe type of PLY data stored in the file
    [out]data_idxthe data index
    [in]offsetthe offset in the file where to expect the true header to begin. One usage example for setting the offset parameter is for reading data from a TAR "archive containing multiple files: TAR files always add a 512 byte header in front of the actual file, so set the offset to the next byte after the header (e.g., 513).

Implements pcl::FileReader.


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