Easy3D 2.6.1
Loading...
Searching...
No Matches
PlyReader Class Reference

A general purpose PLY file reader. More...

#include <easy3d/fileio/ply_reader_writer.h>

Public Member Functions

bool read (const std::string &file_name, std::vector< Element > &elements)
 Reads a PLY file and stores the model as a set of elements.
 

Static Public Member Functions

static std::size_t num_instances (const std::string &file_name, const std::string &element_name)
 A quick check of the number of instances of a type of element.
 

Detailed Description

A general purpose PLY file reader.

This class is internally used by PointCloudIO, SurfaceMeshIO, and GraphIO. Client code should use PointCloudIO, SurfaceMeshIO, and GraphIO.

Member Function Documentation

◆ num_instances()

static std::size_t num_instances ( const std::string & file_name,
const std::string & element_name )
static

A quick check of the number of instances of a type of element.

The typical use is to determine if a PLY file stores a point cloud, a graph, or a surface mesh. Internally it reads the ply file header only (without parsing the entire file).

Parameters
file_nameThe input file.
element_nameA string denoting the type of the element to be checked. Typical elements are "vertex", "face", and "edge".
Returns
The number of instances of the element.
Examples
Tutorial_203_Viewer_wxWidgets/main.cpp, and Tutorial_204_Viewer_Qt/main.cpp.

◆ read()

bool read ( const std::string & file_name,
std::vector< Element > & elements )

Reads a PLY file and stores the model as a set of elements.

Parameters
file_nameThe name of the PLY file to read.
elementsThe vector to store the read elements.
Returns
True if the file was successfully read, false otherwise.

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