OMToolkit 1.0 The polygonal mesh processing tool.

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Typedefs | Functions
OMToolkit::IO Namespace Reference

## Typedefs
typedef OpenMesh::IO::Options | Options

## Functions
template<class Mesh >
bool | writeMesh (Mesh &mesh, mds::mod::CChannel &channel, Options opt)
template<class Mesh >
bool | writeMesh (Mesh &mesh, std::string filename, Options opt)
template<class Mesh >
bool | writeMesh (Mesh &mesh, std::ostream &stream, std::string format, Options opt)
template<class Mesh >
bool | readMesh (Mesh &mesh, mds::mod::CChannel &channel, Options &opt)
template<class Mesh >
bool | readMesh (Mesh &mesh, std::string filename, Options &opt)
template<class Mesh >
bool | readMesh (Mesh &mesh, std::istream &stream, std::string format, Options &opt)
template<class Mesh , typename Scalar >
bool | exportVertices (Mesh &mesh, Scalar *output_array, bool normals)

## Typedef Documentation

typedef OpenMesh::IO::Options OMToolkit::IO::Options

Helper type forr specifying r/w options

## Function Documentation

template<class Mesh , typename Scalar >

bool OMToolkit::IO::exportVertices | ( | Mesh & | mesh,
|  | Scalar * | output_array,
|  | bool | normals = `false`
| ) |  |

Method exports a mesh vertices into dense 2D array format of each line: Vx Vy Vz [Nx] [Ny] [Nz] V(x,y,z) are coordinates of each vertex N(x,y,z) are coordinates of surface normal on vertex (arbitrary) ARRAY MUST BE INITIALIZED size = (num_vertices * 3 * sizeof(Scalar)) in case of normals == false size = (num_vertices * 6 * sizeof(Scalar)) in case of normals == true

Template Parameters

  Mesh | Input mesh type
  Scalar | Output array type

Parameters

  mesh | Source mesh
  output_array | Output array of Scalar type
  normals | Should be normals added into output mesh?

Returns
  True, if writing was done successfully

template<class Mesh >

bool OMToolkit::IO::readMesh | ( | Mesh & | mesh,
|  | mds::mod::CChannel & | channel,
|  | Options & | opt
| ) |  |

Method reads a mesh from MDSTk input channel Automaticaly reads all available data

Parameters

  mesh | Destination mesh
  channel | MDSTk output channel
  opt | Options for reading (for binary/ascii specification etc.)

Returns
  True, if reading was done successfully

template<class Mesh >

bool OMToolkit::IO::readMesh | ( | Mesh & | mesh,
|  | std::string | filename,
|  | Options & | opt
| ) |  |

Method reads a mesh from a file specified by filename (format is determined from filename) Possible formats are STL, OFF, OM, OBJ, PLY

Parameters

  mesh | Destination mesh
  filename | File name
  opt | Options for reading (for binary/ascii specification etc.)

Returns
  True, if reading was done successfully

template<class Mesh >

bool OMToolkit::IO::readMesh | ( | Mesh & | mesh,
|  | std::istream & | stream,
|  | std::string | format,
|  | Options & | opt
| ) |  |

Method writes a mesh from a STL input stream Possible formats are STL, OFF, OM, OBJ, PLY

Parameters

  mesh | Destination mesh
  stream | Source stream
  format | Format specification - for ex. ".OM"
  opt | Options for reading (for binary/ascii specification etc.)

Returns
  True, if reading was done successfully

template<class Mesh >

bool OMToolkit::IO::writeMesh | ( | Mesh & | mesh,
|  | mds::mod::CChannel & | channel,
|  | Options | opt = `Options::Default`
| ) |  |

Method writes a mesh into MDSTk input channel Automaticaly sets persistency od original auxiliary data If user wants to save his custom properties too, it must be saved as persistent property

Parameters

  mesh | Mesh to store
  channel | MDSTk input channel
  opt | Options for reading (for binary/ascii specification etc.)

Returns
  True, if writing was done successfully

template<class Mesh >

bool OMToolkit::IO::writeMesh | ( | Mesh & | mesh,
|  | std::string | filename,
|  | Options | opt = `Options::Default`
| ) |  |

Method writes a mesh into file specified by filename (format is determined from filename) Possible formats are STL, OFF, OM, OBJ, PLY Automaticaly sets persistency od original auxiliary data If user wants to save his custom properties too, it must be saved as persistent property

Parameters

  mesh | Mesh to store
  filename | File name
  opt | Options for reading (for binary/ascii specification etc.)

Returns
  True, if writing was done successfully

template<class Mesh >

bool OMToolkit::IO::writeMesh | ( | Mesh & | mesh,
|  | std::ostream & | stream,
|  | std::string | format,
|  | Options | opt = `Options::Default`
| ) |  |

Method writes a mesh into STL output stream Possible formats are STL, OFF, OM, OBJ, PLY Automaticaly sets persistency od original auxiliary data If user wants to save his custom properties too, it must be saved as persistent property

Parameters

  mesh | Mesh to store
  stream | Stream where a mesh will be stored
  format | Format specification - for ex. ".OM"
  opt | Options for reading (for binary/ascii specification etc.)

Returns
  True, if writing was done successfully