class mrpt::viz::PLY_Importer

Overview

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:

https://www.mrpt.org/Support_for_the_Stanford_3D_models_file_format_PLY

PLY_Exporter

#include <mrpt/viz/PLY_import_export.h>

class PLY_Importer
{
public:
    // methods

    bool loadFromPlyFile(
        const std::string& filename,
        std::vector<std::string>* file_comments = nullptr,
        std::vector<std::string>* file_obj_info = nullptr
        );

    std::string getLoadPLYErrorString() const;
};

// direct descendants

class CPointsMap;
class CPointCloud;
class CPointCloudColoured;

Methods

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

The filename to open. It can be either in binary or text format.

file_comments

If provided (!=nullptr) the list of comment strings stored in the file will be returned.

file_obj_info

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()

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.