Mesh loader and saver.
More...
#include <geogram/mesh/mesh_io.h>
|
| virtual bool | load (const std::string &filename, Mesh &M, const MeshIOFlags &ioflags=MeshIOFlags())=0 |
| | Loads a double precision mesh from a file.
|
| |
| virtual bool | save (const Mesh &M, const std::string &filename, const MeshIOFlags &ioflags=MeshIOFlags())=0 |
| | Saves a mesh to a file.
|
| |
| void | ref () const |
| | Increments the reference count.
|
| |
| void | unref () const |
| | Decrements the reference count.
|
| |
| bool | is_shared () const |
| | Check if the object is shared.
|
| |
| int | nb_refs () const |
| | Gets the number of references that point to this object.
|
| |
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.
◆ MeshIOHandler()
| GEO::MeshIOHandler::MeshIOHandler |
( |
| ) |
|
|
inlineprotected |
◆ 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:
static MeshIOHandler * create(const std::string &format) Creates a MeshIOHandler.
A smart pointer with reference-counted copy semantics.
|
◆ 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.
◆ MeshIOHandler_var
◆ MeshIOHandlerFactory
◆ cell_region_
◆ edge_region_
◆ facet_region_
◆ vertex_region_
The documentation for this class was generated from the following file: