00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OM_MESHIO_HH
00028 #define OM_MESHIO_HH
00029
00030
00031
00032
00033
00034 #include <OpenMesh/Core/System/config.hh>
00035
00036 #if defined (OPENMESH_TRIMESH_ARRAY_KERNEL_HH) || \
00037 defined (OPENMESH_POLYMESH_ARRAY_KERNEL_HH)
00038 # error "Include MeshIO.hh before including a mesh type!"
00039 #endif
00040
00041 #include <OpenMesh/Core/IO/SR_store.hh>
00042 #include <OpenMesh/Core/IO/IOManager.hh>
00043 #include <OpenMesh/Core/IO/importer/ImporterT.hh>
00044 #include <OpenMesh/Core/IO/exporter/ExporterT.hh>
00045
00046
00047
00048
00049 namespace OpenMesh {
00050 namespace IO {
00051
00052
00053
00054
00055
00061
00062
00063
00064
00065
00068 template <class Mesh>
00069 bool
00070 read_mesh(Mesh& _mesh,
00071 const std::string& _filename,
00072 bool _clear = true)
00073 {
00074 Options opt;
00075 return read_mesh(_mesh, _filename, opt, _clear);
00076 }
00077
00078
00081 template <class Mesh>
00082 bool
00083 read_mesh(Mesh& _mesh,
00084 const std::string& _filename,
00085 Options& _opt,
00086 bool _clear = true)
00087 {
00088 if (_clear) _mesh.clear();
00089 ImporterT<Mesh> importer(_mesh);
00090 return IOManager().read(_filename, importer, _opt);
00091 }
00092
00093
00094
00095
00096
00099 template <class Mesh>
00100 bool write_mesh(const Mesh& _mesh, const std::string& _filename,
00101 Options _opt = Options::Default)
00102 {
00103 ExporterT<Mesh> exporter(_mesh);
00104 return IOManager().write(_filename, exporter, _opt);
00105 }
00106
00107
00108
00109
00110
00111 template <class Mesh>
00112 size_t binary_size(const Mesh& _mesh, const std::string& _format,
00113 Options _opt = Options::Default)
00114 {
00115 ExporterT<Mesh> exporter(_mesh);
00116 return IOManager().binary_size(_format, exporter, _opt);
00117 }
00118
00119
00120
00121
00123
00124
00125
00126 }
00127 }
00128
00129 #if defined(OM_STATIC_BUILD) || defined(ARCH_DARWIN)
00130 # include <OpenMesh/Core/IO/IOInstances.hh>
00131 #endif
00132
00133 #endif
00134