Easy3D 2.5.3
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. More...
 

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. 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). More...
 

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, and Tutorial_204_Viewer_Qt.

◆ 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.

Returns
The status of the operation
  • true if succeeded
  • false if failed

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