Class PLY_Importer

Inheritance Relationships

Derived Types

Class Documentation

class PLY_Importer

A virtual base class that implements the capability of importing 3D point clouds and faces from a file in the Stanford PLY format.

See also

PLY_Exporter

Subclassed by mrpt::viz::CPointCloud, mrpt::viz::CPointCloudColoured

PLY Import virtual methods to implement in base classes

virtual void PLY_import_set_vertex_count(size_t N) = 0

In a base class, reserve memory to prepare subsequent calls to PLY_import_set_vertex

virtual void PLY_import_set_face_count(size_t N) = 0

In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face

virtual void PLY_import_set_vertex(size_t idx, const mrpt::math::TPoint3Df &pt, const mrpt::img::TColorf *pt_color = nullptr) = 0

In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point.

Parameters:

pt_color – Will be nullptr if the loaded file does not provide color info.

virtual void PLY_import_set_vertex_timestamp(size_t idx, const double unixTimestamp) = 0

Public Functions

virtual ~PLY_Importer() = default
bool loadFromPlyFile(const std::string &filename, std::vector<std::string> *file_comments = nullptr, std::vector<std::string> *file_obj_info = nullptr)

Loads from a PLY file.

Parameters:
  • filename[in] The filename to open. It can be either in binary or text format.

  • file_comments[out] If provided (!=nullptr) the list of comment strings stored in the file will be returned.

  • file_obj_info[out]

    If provided (!=nullptr) the list of “object

    info” strings stored in the file will be returned.

Returns:

false on any error in the file format or reading it. To obtain more details on the error you can call getLoadPLYErrorString()

inline std::string getLoadPLYErrorString() const

Return a description of the error if loadFromPlyFile() returned false, or an empty string if the file was loaded without problems.