DGtal 1.4.0
|
Aim: Defined to import OFF and OFS surface mesh. It allows to import a Mesh object and takes into accouts the optional color faces. More...
#include <DGtal/io/readers/MeshReader.h>
Static Public Member Functions | |
static bool | importOFFFile (const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false, bool onlyFaceVertex=false) |
static bool | importOFSFile (const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool invertVertexOrder=false, double scale=1.0) |
static bool | importOBJFile (const std::string &filename, DGtal::Mesh< TPoint > &aMesh, bool onlyFaceVertex=false) |
static bool | verifyIndicesUniqueness (const std::vector< typename DGtal::Mesh< TPoint >::Index > &indices) |
static std::map< std::string, DGtal::Color > | readMaterial (std::istream &input) |
Aim: Defined to import OFF and OFS surface mesh. It allows to import a Mesh object and takes into accouts the optional color faces.
Description of class 'MeshReader'
The importation can be done automatically according the input file extension with the operator <<
Example of typical use: Add these include files:
And automatic import the Mesh through the filename extension:
Then you can also display the resulting with a Viewer3D:
Definition at line 98 of file MeshReader.h.
|
static |
Reads an input file as an OBJ file format and outputs the corresponding surface mesh.
[in] | filename | the input filename of the OBJ file to be read. |
[out] | aMesh | the output mesh. |
[in] | onlyFaceVertex | flag used to import only vertces associated to a face. |
|
static |
Main method to import OFF meshes file (Geomview Object File Format)
[in] | filename | the file name to import. |
[out] | aMesh | the mesh object to be imported. |
[in] | invertVertexOrder | used to invert (default value=false) the order of imported points (important for normal |
[in] | onlyFaceVertex | flag used to import only vertces associated to a face. |
Referenced by TEST_CASE().
|
static |
Main method to import OFS meshes file (an equivalent of OFF format)
filename | the file name to import. |
aMesh | (return) the mesh object to be imported. |
invertVertexOrder | used to invert (default value=false) the order of imported points (important for normal orientation). |
scale | used to avoid to display tiny shapes (since OFS shapes are generally included in a 1x1x1 cube) |
|
static |
Reads an input material file associated ot an OBJ file format and outputs the corresponding materials as a map assiating name and diffuse color.
[in,out] | input | the input stream where the OBJ file is read. |
|
static |
Checks that each index in indices is unique.
indices | a vector of integer indices |