OMToolkit  1.0
The polygonal mesh processing tool.
 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
MeshInput mesh type
ScalarOutput array type
Parameters
meshSource mesh
output_arrayOutput array of Scalar type
normalsShould 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
meshDestination mesh
channelMDSTk output channel
optOptions 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
meshDestination mesh
filenameFile name
optOptions 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
meshDestination mesh
streamSource stream
formatFormat specification - for ex. ".OM"
optOptions 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
meshMesh to store
channelMDSTk input channel
optOptions 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
meshMesh to store
filenameFile name
optOptions 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
meshMesh to store
streamStream where a mesh will be stored
formatFormat specification - for ex. ".OM"
optOptions for reading (for binary/ascii specification etc.)
Returns
True, if writing was done successfully