Main MRPT website > C++ reference for MRPT 1.5.9
List of all members | Public Member Functions | Private Attributes
mrpt::utils::PLY_Importer Class Referenceabstract

Detailed Description

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
http://www.mrpt.org/Support_for_the_Stanford_3D_models_file_format_PLY
PLY_Exporter

Definition at line 26 of file PLY_import_export.h.

#include <mrpt/utils/PLY_import_export.h>

Inheritance diagram for mrpt::utils::PLY_Importer:
Inheritance graph

Public Member Functions

bool loadFromPlyFile (const std::string &filename, CStringList *file_comments=NULL, CStringList *file_obj_info=NULL)
 Loads from a PLY file. More...
 
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. More...
 

Protected Member Functions

PLY Import virtual methods to implement in base classes
virtual void PLY_import_set_vertex_count (const size_t N)=0
 In a base class, reserve memory to prepare subsequent calls to PLY_import_set_vertex. More...
 
virtual void PLY_import_set_face_count (const size_t N)=0
 In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face. More...
 
virtual void PLY_import_set_vertex (const size_t idx, const mrpt::math::TPoint3Df &pt, const mrpt::utils::TColorf *pt_color=NULL)=0
 In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point. More...
 

Private Attributes

std::string m_ply_import_last_error
 

Member Function Documentation

◆ getLoadPLYErrorString()

std::string mrpt::utils::PLY_Importer::getLoadPLYErrorString ( ) const
inline

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

Definition at line 41 of file PLY_import_export.h.

◆ loadFromPlyFile()

bool PLY_Importer::loadFromPlyFile ( const std::string filename,
CStringList file_comments = NULL,
CStringList file_obj_info = NULL 
)

Loads from a PLY file.

Parameters
[in]filenameThe filename to open. It can be either in binary or text format.
[out]file_commentsIf provided (!=NULL) the list of comment strings stored in the file will be returned.
[out]file_obj_infoIf provided (!=NULL) 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()

Definition at line 1893 of file PLY_import_export.cpp.

References TVertex::b, TVertex::g, TVertex::intensity, ply_close(), ply_get_comments(), ply_get_element(), ply_get_element_description(), ply_get_obj_info(), ply_get_property(), ply_open_for_reading(), TVertex::r, VAL_NOT_SET, version, vert_props, TVertex::x, TVertex::y, and TVertex::z.

◆ PLY_import_set_face_count()

virtual void mrpt::utils::PLY_Importer::PLY_import_set_face_count ( const size_t  N)
protectedpure virtual

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

Implemented in mrpt::maps::CPointsMap, mrpt::opengl::CPointCloudColoured, and mrpt::opengl::CPointCloud.

◆ PLY_import_set_vertex()

virtual void mrpt::utils::PLY_Importer::PLY_import_set_vertex ( const size_t  idx,
const mrpt::math::TPoint3Df pt,
const mrpt::utils::TColorf pt_color = NULL 
)
protectedpure virtual

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

Parameters
pt_colorWill be NULL if the loaded file does not provide color info.

Implemented in mrpt::maps::CPointsMap, mrpt::maps::CColouredPointsMap, mrpt::opengl::CPointCloudColoured, and mrpt::opengl::CPointCloud.

◆ PLY_import_set_vertex_count()

virtual void mrpt::utils::PLY_Importer::PLY_import_set_vertex_count ( const size_t  N)
protectedpure virtual

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

Implemented in mrpt::maps::CColouredPointsMap, mrpt::opengl::CPointCloudColoured, mrpt::maps::CWeightedPointsMap, mrpt::maps::CSimplePointsMap, and mrpt::opengl::CPointCloud.

Member Data Documentation

◆ m_ply_import_last_error

std::string mrpt::utils::PLY_Importer::m_ply_import_last_error
private

Definition at line 61 of file PLY_import_export.h.




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020