Main MRPT website > C++ reference for MRPT 1.5.6
List of all members | Public Member Functions | Private Attributes
mrpt::utils::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
http://www.mrpt.org/Support_for_the_Stanford_3D_models_file_format_PLY
PLY_Importer

Definition at line 71 of file PLY_import_export.h.

#include <mrpt/utils/PLY_import_export.h>

Inheritance diagram for mrpt::utils::PLY_Exporter:
Inheritance graph

Public Member Functions

bool saveToPlyFile (const std::string &filename, bool save_in_binary=false, const CStringList &file_comments=CStringList(), const CStringList &file_obj_info=CStringList()) 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::utils::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

std::string mrpt::utils::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 87 of file PLY_import_export.h.

virtual size_t mrpt::utils::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.

virtual void mrpt::utils::PLY_Exporter::PLY_export_get_vertex ( const size_t  idx,
mrpt::math::TPoint3Df pt,
bool &  pt_has_color,
mrpt::utils::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 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.

virtual size_t mrpt::utils::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.

bool PLY_Exporter::saveToPlyFile ( const std::string filename,
bool  save_in_binary = false,
const CStringList file_comments = CStringList(),
const CStringList file_obj_info = CStringList() 
) const

Saves to a PLY file.

Parameters
[in]filenameThe filename to be saved.
[in]file_commentsIf provided (!=NULL) the list of comment strings stored in the file will be returned.
[in]file_obj_infoIf provided (!=NULL) 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 1993 of file PLY_import_export.cpp.

References mrpt::utils::TColorf::B, face_props, mrpt::utils::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::utils::TColorf::R, mrpt::utils::CStringList::size(), version, vert_props, mrpt::math::TPoint3Df::x, TVertex::x, mrpt::math::TPoint3Df::y, TVertex::y, mrpt::math::TPoint3Df::z, and TVertex::z.

Member Data Documentation

std::string mrpt::utils::PLY_Exporter::m_ply_export_last_error
mutableprivate

Definition at line 111 of file PLY_import_export.h.




Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018