1#ifndef OPENMESH_PYTHON_INPUTOUTPUT_HH
2#define OPENMESH_PYTHON_INPUTOUTPUT_HH
24BOOST_PYTHON_FUNCTION_OVERLOADS(read_mesh_overloads,
IO::read_mesh, 3, 4)
25BOOST_PYTHON_FUNCTION_OVERLOADS(write_mesh_overloads, IO::write_mesh, 2, 4)
44 def(
"read_mesh", read_mesh_poly);
45 def(
"read_mesh", read_mesh_poly_options, read_mesh_overloads());
46 def(
"read_mesh", read_mesh_tri);
47 def(
"read_mesh", read_mesh_tri_options, read_mesh_overloads());
49 def(
"write_mesh", write_mesh_poly, write_mesh_overloads());
50 def(
"write_mesh", write_mesh_tri, write_mesh_overloads());
56 scope scope_options = class_<IO::Options>(
"Options")
57 .def(init<IO::Options::Flag>())
61 .def(
"check", &IO::Options::check)
62 .def(
"is_binary", &IO::Options::is_binary)
63 .def(
"vertex_has_normal", &IO::Options::vertex_has_normal)
64 .def(
"vertex_has_color", &IO::Options::vertex_has_color)
65 .def(
"vertex_has_texcoord", &IO::Options::vertex_has_texcoord)
66 .def(
"edge_has_color", &IO::Options::edge_has_color)
67 .def(
"face_has_normal", &IO::Options::face_has_normal)
68 .def(
"face_has_color", &IO::Options::face_has_color)
69 .def(
"face_has_texcoord", &IO::Options::face_has_texcoord)
70 .def(
"color_has_alpha", &IO::Options::color_has_alpha)
71 .def(
"color_is_float", &IO::Options::color_is_float)
78 .def_readonly(
"Default", &FLAG_DEFAULT)
79 .def_readonly(
"Binary", &FLAG_BINARY)
80 .def_readonly(
"MSB", &FLAG_MSB)
81 .def_readonly(
"LSB", &FLAG_LSB)
82 .def_readonly(
"Swap", &FLAG_SWAP)
83 .def_readonly(
"VertexNormal", &FLAG_VERTEXNORMAL)
84 .def_readonly(
"VertexColor", &FLAG_VERTEXCOLOR)
85 .def_readonly(
"VertexTexCoord", &FLAG_VERTEXTEXCOORD)
86 .def_readonly(
"EdgeColor", &FLAG_EDGECOLOR)
87 .def_readonly(
"FaceNormal", &FLAG_FACENORMAL)
88 .def_readonly(
"FaceColor", &FLAG_FACECOLOR)
89 .def_readonly(
"FaceTexCoord", &FLAG_FACETEXCOORD)
90 .def_readonly(
"ColorAlpha", &FLAG_COLORALPHA)
91 .def_readonly(
"ColorFloat", &FLAG_COLORFLOAT)
94 enum_<IO::Options::Flag>(
"Flag")
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
bool write_mesh(const Mesh &_mesh, const std::string &_filename, Options _opt=Options::Default, std::streamsize _precision=6)
Write a mesh to the file _filename.
Definition MeshIO.hh:199
bool read_mesh(Mesh &_mesh, const std::string &_filename)
Read a mesh from file _filename.
Definition MeshIO.hh:104
void expose_io()
Expose the input/output functions and options to Python.
Definition InputOutput.hh:30
Set options for reader/writer modules.
Definition Options.hh:96
void cleanup(void)
Restore state after default constructor.
Definition Options.hh:147
bool is_empty(void) const
Returns true if all bits are zero.
Definition Options.hh:155
void clear(void)
Clear all bits.
Definition Options.hh:151
Flag
Definitions of Options for reading and writing.
Definition Options.hh:103
@ ColorFloat
Has (r) / store (w) float values for colors (currently only implemented for PLY and OFF files)
Definition Options.hh:117
@ FaceNormal
Has (r) / store (w) face normals.
Definition Options.hh:113
@ Swap
Swap byte order in binary mode.
Definition Options.hh:108
@ FaceColor
Has (r) / store (w) face colors.
Definition Options.hh:114
@ FaceTexCoord
Has (r) / store (w) face texture coordinates.
Definition Options.hh:115
@ MSB
Assume big endian byte ordering.
Definition Options.hh:106
@ Binary
Set binary mode for r/w.
Definition Options.hh:105
@ Default
No options.
Definition Options.hh:104
@ ColorAlpha
Has (r) / store (w) alpha values for colors.
Definition Options.hh:116
@ LSB
Assume little endian byte ordering.
Definition Options.hh:107
@ VertexNormal
Has (r) / store (w) vertex normals.
Definition Options.hh:109
@ VertexTexCoord
Has (r) / store (w) texture coordinates.
Definition Options.hh:111
@ EdgeColor
Has (r) / store (w) edge colors.
Definition Options.hh:112
@ VertexColor
Has (r) / store (w) vertex colors.
Definition Options.hh:110
Polygonal mesh based on the ArrayKernel.
Definition PolyMesh_ArrayKernelT.hh:100
Triangle mesh based on the ArrayKernel.
Definition TriMesh_ArrayKernelT.hh:100