Loading...
Searching...
No Matches
OpenMesh::IO::BaseWriter Class Referenceabstract

Base class for all writer modules. More...

`#include <OpenMesh/Core/IO/writer/BaseWriter.hh>`

Inheritance diagram for OpenMesh::IO::BaseWriter:
[legend]

## Public Types

typedef unsigned int | Option

## Public Member Functions

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

## Protected Member Functions

bool | check (BaseExporter &_be, Options _opt) const

## Detailed Description

Base class for all writer modules.

The module should register itself at the IOManager by calling the register_module function.

## Member Function Documentation

## binary_size()

virtual size_t OpenMesh::IO::BaseWriter::binary_size | ( | BaseExporter & | ,
|  | Options |
| ) |  | const

inline virtual

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

Reimplemented in OpenMesh::IO::_OBJWriter_, OpenMesh::IO::_STLWriter_, OpenMesh::IO::_VTKWriter_, OpenMesh::IO::_OFFWriter_, OpenMesh::IO::_OMWriter_, and OpenMesh::IO::_PLYWriter_.

## can_u_write()

bool OpenMesh::IO::BaseWriter::can_u_write | ( | const std::string & | _filename | ) | const

virtual

Returns true if writer can write _filename (checks extension).

_filename can also provide an extension without a name for a file e.g. _filename == "om" checks, if the writer can write the "om" extension

Parameters

  _filename | complete name of a file or just the extension

Returns
  true, if writer can write data with the given extension

## get_description()

virtual std::string OpenMesh::IO::BaseWriter::get_description | ( |  | ) | const

pure virtual

Return short description of the supported file format.

Implemented in OpenMesh::IO::_OBJWriter_, OpenMesh::IO::_OFFWriter_, OpenMesh::IO::_OMWriter_, OpenMesh::IO::_PLYWriter_, OpenMesh::IO::_STLWriter_, and OpenMesh::IO::_VTKWriter_.

## get_extensions()

virtual std::string OpenMesh::IO::BaseWriter::get_extensions | ( |  | ) | const

pure virtual

Return file format's extension.

Implemented in OpenMesh::IO::_OBJWriter_, OpenMesh::IO::_OFFWriter_, OpenMesh::IO::_OMWriter_, OpenMesh::IO::_PLYWriter_, OpenMesh::IO::_STLWriter_, and OpenMesh::IO::_VTKWriter_.

## write() [1/2]

virtual bool OpenMesh::IO::BaseWriter::write | ( | const std::string & | _filename,
|  | BaseExporter & | _be,
|  | Options | _opt,
|  | std::streamsize | _precision = `6`
| ) |  | const

pure virtual

Write to a file.

Parameters

  _filename | write to file with the given filename
  _be | BaseExporter, which specifies the data source
  _opt | writing options
  _precision | can be used to specify the precision of the floating point notation.

Implemented in OpenMesh::IO::_OBJWriter_, OpenMesh::IO::_OFFWriter_, OpenMesh::IO::_OMWriter_, OpenMesh::IO::_PLYWriter_, OpenMesh::IO::_STLWriter_, and OpenMesh::IO::_VTKWriter_.

## write() [2/2]

virtual bool OpenMesh::IO::BaseWriter::write | ( | std::ostream & | _os,
|  | BaseExporter & | _be,
|  | Options | _opt,
|  | std::streamsize | _precision = `6`
| ) |  | const

pure virtual

Write to a std::ostream.

Parameters

  _os | write to std::ostream
  _be | BaseExporter, which specifies the data source
  _opt | writing options
  _precision | can be used to specify the precision of the floating point notation.

Implemented in OpenMesh::IO::_OBJWriter_, OpenMesh::IO::_OFFWriter_, OpenMesh::IO::_OMWriter_, OpenMesh::IO::_PLYWriter_, OpenMesh::IO::_STLWriter_, and OpenMesh::IO::_VTKWriter_.

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

- OpenMesh/Core/IO/writer/BaseWriter.hh
- OpenMesh/Core/IO/writer/BaseWriter.cc