MRPT  1.9.9
List of all members | Public Member Functions | Private Attributes
mrpt::opengl::PLY_Exporter Class Referenceabstract

Detailed Description

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

See also
https://www.mrpt.org/Support_for_the_Stanford_3D_models_file_format_PLY
PLY_Importer

Definition at line 83 of file PLY_import_export.h.

#include <mrpt/opengl/PLY_import_export.h>

Inheritance diagram for mrpt::opengl::PLY_Exporter:

Public Member Functions

bool saveToPlyFile (const std::string &filename, bool save_in_binary=false, const std::vector< std::string > &file_comments=std::vector< std::string >(), const std::vector< std::string > &file_obj_info=std::vector< std::string >()) const
 Saves to a PLY file. More...
 
std::string getSavePLYErrorString () 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 Export virtual methods to implement in base classes
virtual size_t PLY_export_get_vertex_count () const =0
 In a base class, return the number of vertices. More...
 
virtual size_t PLY_export_get_face_count () const =0
 In a base class, return the number of faces. More...
 
virtual void PLY_export_get_vertex (const size_t idx, mrpt::math::TPoint3Df &pt, bool &pt_has_color, mrpt::img::TColorf &pt_color) const =0
 In a base class, will be called after PLY_export_get_vertex_count() once for each exported point. More...
 

Private Attributes

std::string m_ply_export_last_error
 

Member Function Documentation

◆ getSavePLYErrorString()

std::string mrpt::opengl::PLY_Exporter::getSavePLYErrorString ( ) 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 104 of file PLY_import_export.h.

References m_ply_export_last_error.

◆ PLY_export_get_face_count()

virtual size_t mrpt::opengl::PLY_Exporter::PLY_export_get_face_count ( ) const
protectedpure virtual

In a base class, return the number of faces.

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

◆ PLY_export_get_vertex()

virtual void mrpt::opengl::PLY_Exporter::PLY_export_get_vertex ( const size_t  idx,
mrpt::math::TPoint3Df pt,
bool &  pt_has_color,
mrpt::img::TColorf pt_color 
) const
protectedpure virtual

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

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

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

◆ PLY_export_get_vertex_count()

virtual size_t mrpt::opengl::PLY_Exporter::PLY_export_get_vertex_count ( ) const
protectedpure virtual

In a base class, return the number of vertices.

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

◆ saveToPlyFile()

bool PLY_Exporter::saveToPlyFile ( const std::string filename,
bool  save_in_binary = false,
const std::vector< std::string > &  file_comments = std::vector<std::string>(),
const std::vector< std::string > &  file_obj_info = std::vector<std::string>() 
) const

Saves to a PLY file.

Parameters
[in]filenameThe filename to be saved.
[in]file_commentsIf provided (!=nullptr) the list of comment strings stored in the file will be returned.
[in]file_obj_infoIf provided (!=nullptr) the list of "object info" strings stored in the file will be returned.
Returns
false on any error writing the file. To obtain more details on the error you can call getSavePLYErrorString()

Definition at line 1945 of file PLY_import_export.cpp.

References mrpt::img::TColorf::B, face_props, mrpt::img::TColorf::G, TVertex::intensity, PLY_ASCII, PLY_BINARY_BE, PLY_BINARY_LE, ply_close(), ply_describe_property(), ply_element_count(), ply_header_complete(), ply_open_for_writing(), ply_put_comment(), ply_put_element(), ply_put_element_setup(), ply_put_obj_info(), mrpt::img::TColorf::R, vert_props, mrpt::math::TPoint3Df::x, TVertex::x, mrpt::math::TPoint3Df::y, TVertex::y, mrpt::math::TPoint3Df::z, and TVertex::z.

Here is the call graph for this function:

Member Data Documentation

◆ m_ply_export_last_error

std::string mrpt::opengl::PLY_Exporter::m_ply_export_last_error
mutableprivate

Definition at line 131 of file PLY_import_export.h.

Referenced by getSavePLYErrorString().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 4363012a5 Tue Nov 19 10:55:26 2019 +0100 at mar nov 19 11:00:13 CET 2019