OpenMesh
OpenMesh::IO::_PLYWriter_ Class Reference

Implementation of the PLY format writer. More...

#include <OpenMesh/Core/IO/writer/PLYWriter.hh>

Inheritance diagram for OpenMesh::IO::_PLYWriter_:
Collaboration diagram for OpenMesh::IO::_PLYWriter_:

Public Types

enum  ValueType {
  Unsupported = 0 , ValueTypeFLOAT32 , ValueTypeFLOAT , ValueTypeINT32 ,
  ValueTypeINT , ValueTypeUINT , ValueTypeUCHAR , ValueTypeCHAR ,
  ValueTypeUINT8 , ValueTypeUSHORT , ValueTypeSHORT , ValueTypeDOUBLE
}
 
- Public Types inherited from OpenMesh::IO::BaseWriter
typedef unsigned int Option
 

Public Member Functions

virtual ~_PLYWriter_ ()
 Destructor.
 
std::string get_description () const override
 Return short description of the supported file format. More...
 
std::string get_extensions () const override
 Return file format's extension. More...
 
bool write (const std::string &, BaseExporter &, const Options &_writeOptions, std::streamsize _precision=6) const override
 Write to a file. More...
 
bool write (std::ostream &, BaseExporter &, const Options &_writeOptions, std::streamsize _precision=6) const override
 Write to a std::ostream. More...
 
size_t binary_size (BaseExporter &_be, const Options &_opt) const override
 Returns expected size of file if binary format is supported else 0. More...
 
- Public Member Functions inherited from OpenMesh::IO::BaseWriter
virtual ~BaseWriter ()
 Destructor.
 
virtual std::string get_description () const =0
 Return short description of the supported file format. More...
 
virtual std::string get_extensions () const =0
 Return file format's extension. More...
 
virtual bool can_u_write (const std::string &_filename) const
 Returns true if writer can write _filename (checks extension). More...
 
virtual bool write (const std::string &_filename, BaseExporter &_be, const Options &_writeOptions, std::streamsize _precision=6) const =0
 Write to a file. More...
 
virtual bool write (std::ostream &_os, BaseExporter &_be, const Options &_writeOptions, std::streamsize _precision=6) const =0
 Write to a std::ostream. More...
 
virtual size_t binary_size (BaseExporter &, const Options &) const
 Returns expected size of file if binary format is supported else 0. More...
 

Protected Member Functions

void writeValue (ValueType _type, std::ostream &_out, signed char value) const
 
void writeValue (ValueType _type, std::ostream &_out, unsigned char value) const
 
void writeValue (ValueType _type, std::ostream &_out, short value) const
 
void writeValue (ValueType _type, std::ostream &_out, unsigned short value) const
 
void writeValue (ValueType _type, std::ostream &_out, int value) const
 
void writeValue (ValueType _type, std::ostream &_out, unsigned int value) const
 
void writeValue (ValueType _type, std::ostream &_out, float value) const
 
void writeValue (ValueType _type, std::ostream &_out, double value) const
 
bool write_ascii (std::ostream &_out, BaseExporter &, Options) const
 
bool write_binary (std::ostream &_out, BaseExporter &, Options) const
 
void write_header (std::ostream &_out, BaseExporter &_be, Options &_opt, std::vector< CustomProperty > &_ovProps, std::vector< CustomProperty > &_ofProps) const
 write header into the stream _out. Returns custom properties (vertex and face) which are written into the header
 
- Protected Member Functions inherited from OpenMesh::IO::BaseWriter
bool check (BaseExporter &_be, const Options &_writeOptions) const
 

Detailed Description

Implementation of the PLY format writer.

This class is singleton'ed by SingletonT to PLYWriter.

currently supported options:

  • VertexColors
  • FaceColors
  • Binary
  • Binary -> MSB

Member Function Documentation

◆ binary_size()

size_t OpenMesh::IO::_PLYWriter_::binary_size ( BaseExporter ,
const Options  
) const
overridevirtual

Returns expected size of file if binary format is supported else 0.

Reimplemented from OpenMesh::IO::BaseWriter.

◆ get_description()

std::string OpenMesh::IO::_PLYWriter_::get_description ( ) const
inlineoverridevirtual

Return short description of the supported file format.

Implements OpenMesh::IO::BaseWriter.

◆ get_extensions()

std::string OpenMesh::IO::_PLYWriter_::get_extensions ( ) const
inlineoverridevirtual

Return file format's extension.

Implements OpenMesh::IO::BaseWriter.

◆ write() [1/2]

bool OpenMesh::IO::_PLYWriter_::write ( const std::string &  _filename,
BaseExporter _be,
const Options _writeOptions,
std::streamsize  _precision = 6 
) const
overridevirtual

Write to a file.

Parameters
_filenamewrite to file with the given filename
_beBaseExporter, which specifies the data source
_writeOptionswriting options
_precisioncan be used to specify the precision of the floating point notation.

Implements OpenMesh::IO::BaseWriter.

◆ write() [2/2]

bool OpenMesh::IO::_PLYWriter_::write ( std::ostream &  _os,
BaseExporter _be,
const Options _writeOptions,
std::streamsize  _precision = 6 
) const
overridevirtual

Write to a std::ostream.

Parameters
_oswrite to std::ostream
_beBaseExporter, which specifies the data source
_writeOptionswriting options
_precisioncan be used to specify the precision of the floating point notation.

Implements OpenMesh::IO::BaseWriter.


The documentation for this class was generated from the following files:

Project OpenMesh, ©  Visual Computing Institute, RWTH Aachen. Documentation generated using doxygen .