Mesh loader and saver.
More...
#include <geogram/mesh/mesh_io.h>
Mesh loader and saver.
MeshIOHandler is responsible to load and save meshes in a specific file format. MeshIOHandler is used internally by mesh_load() and mesh_save(), so you don't normally need to use it directly, unless you need to implement a new file format.
Vorpaline currently supports thr following file formats:
MeshIOHandlers are created using method create() which uses the Factory service. Handlers for new file formats can be implemented and registered to the factory using geo_register_MeshIOHandler_creator().
- See also
- MeshIOHandlerFactory
-
geo_register_MeshIOHandler_creator
Definition at line 352 of file mesh_io.h.
◆ create()
static MeshIOHandler* GEO::MeshIOHandler::create |
( |
const std::string & |
format | ) |
|
|
static |
Creates a MeshIOHandler.
- Parameters
-
[in] | format | format of the file |
- Return values
-
nullptr | if format is not a supported file format. |
otherwise,a | pointer to a IO handler. The returned pointer must be stored in an MeshIOHandler_var that does automatic destruction:
SmartPointer< MeshIOHandler > MeshIOHandler_var A smart pointer that contains a MeshIOHandler object.
static MeshIOHandler * create(const std::string &format) Creates a MeshIOHandler.
|
◆ get_handler()
static MeshIOHandler* GEO::MeshIOHandler::get_handler |
( |
const std::string & |
filename | ) |
|
|
static |
Gets the MeshIOHandler for a file.
Determines the file format from the extension of file filename
and creates a MeshIOHandler for this format.
- Parameters
-
[in] | filename | a path to a mesh file |
- Return values
-
nullptr | if format is not a supported file format. |
a | pointer to a IO handler if format is supported. |
nullptr | otherwise |
- See also
- create()
◆ load()
Loads a double precision mesh from a file.
- Parameters
-
[in] | filename | name of the file |
[out] | M | the loaded mesh |
[in] | ioflags | specifies which attributes and elements should be loaded |
◆ save()
virtual bool GEO::MeshIOHandler::save |
( |
const Mesh & |
M, |
|
|
const std::string & |
filename, |
|
|
const MeshIOFlags & |
ioflags = MeshIOFlags() |
|
) |
| |
|
pure virtual |
Saves a mesh to a file.
- Parameters
-
[in] | M | the mesh to save |
[in] | filename | name of the file |
[in] | ioflags | specifies which attributes and elements should be saved |
- Returns
- true on success, false otherwise.
◆ MeshIOHandlerFactory
The documentation for this class was generated from the following file: