57#ifndef __BASEREADER_HH__
58#define __BASEREADER_HH__
72#include <OpenMesh/Core/System/config.h>
73#include <OpenMesh/Core/IO/Options.hh>
74#include <OpenMesh/Core/IO/importer/BaseImporter.hh>
75#include <OpenMesh/Core/Utils/SingletonT.hh>
110 virtual std::string
get_magic()
const {
return std::string(
""); }
120 virtual bool read(
const std::string& _filename,
130 virtual bool read(std::istream& _is,
140 virtual bool can_u_read(
const std::string& _filename)
const;
146 bool check_extension(
const std::string& _fname,
147 const std::string& _ext)
const;
158static inline std::string &left_trim(std::string &_string) {
159 _string.erase(_string.begin(), std::find_if(_string.begin(), _string.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
170static inline std::string &right_trim(std::string &_string) {
171 _string.erase(std::find_if(_string.rbegin(), _string.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), _string.end());
182static inline std::string &trim(std::string &_string) {
183 return left_trim(right_trim(_string));
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
This namespace contains functions for reading and writing polygonal meshes and a list of supported fi...
Base class for importer modules.
Definition BaseImporter.hh:89
Set options for reader/writer modules.
Definition Options.hh:96
Base class for reader modules.
Definition BaseReader.hh:95
virtual bool read(std::istream &_is, BaseImporter &_bi, Options &_opt)=0
Reads a mesh given by a std::stream.
virtual std::string get_description() const =0
Returns a brief description of the file type that can be parsed.
virtual std::string get_extensions() const =0
Returns a string with the accepted file extensions separated by a whitespace and in small caps.
virtual bool can_u_read(const std::string &_filename) const
Returns true if writer can parse _filename (checks extension).
Definition BaseReader.cc:82
virtual std::string get_magic() const
Return magic bits used to determine file format.
Definition BaseReader.hh:110
virtual bool read(const std::string &_filename, BaseImporter &_bi, Options &_opt)=0
Reads a mesh given by a filename.
virtual ~BaseReader()
Destructor.
Definition BaseReader.hh:99