Lagrange
|
Classes | |
struct | LoadOptions |
Options used when loading a mesh or a scene. More... | |
struct | SaveOptions |
Options used when saving a mesh or a scene. More... | |
Enumerations | |
enum class | FileEncoding { Binary , Ascii } |
enum class | FileFormat { Obj , Ply , Gltf , Msh , Fbx , Unknown } |
Functions | |
template<typename MeshType , std::enable_if_t<!lagrange::MeshTraitHelper::is_mesh< MeshType >::value > * = nullptr> | |
MeshType | load_mesh (std::istream &input_stream, const LoadOptions &options={}) |
Load a mesh from a stream. More... | |
template<typename MeshType , std::enable_if_t<!lagrange::MeshTraitHelper::is_mesh< MeshType >::value > * = nullptr> | |
MeshType | load_mesh (const fs::path &filename, const LoadOptions &={}) |
Load a mesh from a file. More... | |
template<typename MeshType > | |
MeshType | load_mesh_fbx (std::istream &input_stream, const LoadOptions &options={}) |
Loads a mesh from an input stream in fbx format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_fbx (const fs::path &filename, const LoadOptions &options={}) |
Loads a mesh from a file in fbx format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_gltf (std::istream &input_stream, const LoadOptions &options={}) |
Loads a mesh from an input stream in glTF or GLB format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_gltf (const fs::path &filename, const LoadOptions &options={}) |
Loads a mesh from a file in glTF or GLB format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_msh (std::istream &input_stream, const LoadOptions &options={}) |
Loads a mesh from a stream in MSH format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_msh (const fs::path &filename, const LoadOptions &options={}) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a mesh from a file in MSH format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_obj (std::istream &input_stream_obj, const LoadOptions &options={}) |
Loads a mesh from a file in MSH format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_obj (const fs::path &filename, const LoadOptions &options={}) |
Loads a mesh from a file in MSH format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_ply (std::istream &input_stream, const LoadOptions &options={}) |
Loads a mesh from a stream in PLY format. More... | |
template<typename MeshType > | |
MeshType | load_mesh_ply (const fs::path &filename, const LoadOptions &options={}) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a mesh from a file in PLY format. More... | |
template<typename SceneType > | |
SceneType | load_scene (const fs::path &filename, const LoadOptions &options={}) |
Load a scene. More... | |
template<typename SceneType > | |
SceneType | load_scene (std::istream &input_stream, const LoadOptions &options={}) |
Load a scene from a stream. More... | |
template<typename SceneType > | |
SceneType | load_scene_fbx (const fs::path &filename, const LoadOptions &options={}) |
Load an fbx scene. More... | |
template<typename SceneType > | |
SceneType | load_scene_fbx (std::istream &input_stream, const LoadOptions &options={}) |
Load an fbx scene. More... | |
template<typename SceneType > | |
SceneType | load_scene_gltf (const fs::path &filename, const LoadOptions &options={}) |
Load a scene using gltf. More... | |
template<typename SceneType > | |
SceneType | load_scene_gltf (std::istream &input_stream, const LoadOptions &options={}) |
Load a scene using gltf. More... | |
template<typename SceneType > | |
SceneType | load_scene_obj (const fs::path &filename, const LoadOptions &options={}) |
Load an obj into a scene. More... | |
template<typename SceneType > | |
SceneType | load_scene_obj (std::istream &input_stream_obj, std::istream &input_stream_mtl, const LoadOptions &options={}) |
Loadn obj into a scene. More... | |
template<typename SceneType > | |
SceneType | load_simple_scene (const fs::path &filename, const LoadOptions &options={}) |
Load a simple scene. More... | |
template<typename SceneType > | |
SceneType | load_simple_scene_fbx (std::istream &input_stream, const LoadOptions &options={}) |
Load a simple scene from fbx. More... | |
template<typename SceneType > | |
SceneType | load_simple_scene_fbx (const fs::path &filename, const LoadOptions &options={}) |
Load a simple scene from fbx. More... | |
template<typename SceneType > | |
SceneType | load_simple_scene_gltf (std::istream &input_stream, const LoadOptions &options={}) |
Load a simple scene with gltf. More... | |
template<typename SceneType > | |
SceneType | load_simple_scene_gltf (const fs::path &filename, const LoadOptions &options={}) |
Load a simple scene with gltf. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh (std::ostream &output_stream, const SurfaceMesh< Scalar, Index > &mesh, FileFormat format, const SaveOptions &options={}) |
Save a mesh to a stream. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh (const fs::path &filename, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
Save a mesh to a file. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_gltf (std::ostream &output_stream, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
Saves a mesh to an output stream in glTF or GLB format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_gltf (const fs::path &filename, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
Saves a mesh to a file in glTF or GLB format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_msh (std::ostream &output_stream, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
Saves a mesh to a stream in MSH format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_msh (const fs::path &filename, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Saves a mesh to a stream in MSH format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_obj (std::ostream &output_stream, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
Saves a mesh to a stream in OBJ format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_obj (const fs::path &filename, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Saves a mesh to a file in OBJ format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_ply (std::ostream &output_stream, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
Saves a mesh to a stream in PLY format. More... | |
template<typename Scalar , typename Index > | |
void | save_mesh_ply (const fs::path &filename, const SurfaceMesh< Scalar, Index > &mesh, const SaveOptions &options={}) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Saves a mesh to a file in PLY format. More... | |
template<typename Scalar , typename Index > | |
void | save_scene (const fs::path &filename, const scene::Scene< Scalar, Index > &scene, const SaveOptions &options={}) |
Save a scene to a file. More... | |
template<typename Scalar , typename Index > | |
void | save_scene (std::ostream &output_stream, const scene::Scene< Scalar, Index > &scene, FileFormat format, const SaveOptions &options={}) |
Save a scene to a stream. More... | |
template<typename Scalar , typename Index > | |
void | save_scene_gltf (std::ostream &output_stream, const scene::Scene< Scalar, Index > &scene, const SaveOptions &options={}) |
Save a scene to a gltf or glb file. More... | |
template<typename Scalar , typename Index > | |
void | save_scene_gltf (const fs::path &filename, const scene::Scene< Scalar, Index > &scene, const SaveOptions &options={}) |
Save a scene to a gltf or glb file. More... | |
template<typename Scalar , typename Index , size_t Dimension = 3> | |
void | save_simple_scene (const fs::path &filename, const scene::SimpleScene< Scalar, Index, Dimension > &scene, const SaveOptions &options={}) |
Save a mesh to a file. More... | |
template<typename Scalar , typename Index , size_t Dimension = 3> | |
void | save_simple_scene_gltf (std::ostream &output_stream, const scene::SimpleScene< Scalar, Index, Dimension > &scene, const SaveOptions &options={}) |
Save a simple scene to a gltf or glb file. More... | |
template<typename Scalar , typename Index , size_t Dimension = 3> | |
void | save_simple_scene_gltf (const fs::path &filename, const scene::SimpleScene< Scalar, Index, Dimension > &scene, const SaveOptions &options={}) |
Save a simple scene to a gltf or glb file. More... | |
template<typename Scalar , typename Index > | |
bool | involve_indexed_attribute (const SurfaceMesh< Scalar, Index > &mesh, span< const AttributeId > attr_ids) |
template<typename Scalar , typename Index > | |
std::tuple< SurfaceMesh< Scalar, Index >, std::vector< AttributeId > > | remap_indexed_attributes (const SurfaceMesh< Scalar, Index > &in_mesh, span< const AttributeId > in_attr_ids) |
LA_SURFACE_MESH_X (load_mesh_fbx, 0) | |
LA_SIMPLE_SCENE_X (load_simple_scene_fbx, 0) | |
LA_SCENE_X (load_scene_fbx, 0) | |
LA_SURFACE_MESH_X (load_mesh_gltf, 0) | |
LA_SIMPLE_SCENE_X (load_simple_scene_gltf, 0) | |
LA_SCENE_X (load_scene_gltf, 0) | |
LA_SURFACE_MESH_X (load_mesh, 0) | |
std::string_view | get_suffix (std::string_view name) |
template<typename Scalar , typename Index , typename ValueType , AttributeElement element> | |
void | extract_normal (happly::Element &ply_element, const std::string_view name, SurfaceMesh< Scalar, Index > &mesh) |
template<typename Scalar , typename Index , typename ValueType > | |
void | extract_vertex_uv (happly::Element &vertex_element, const std::string_view name, SurfaceMesh< Scalar, Index > &mesh) |
template<typename Scalar , typename Index , typename ValueType , AttributeElement element> | |
void | extract_color (happly::Element &ply_element, const std::string_view name, SurfaceMesh< Scalar, Index > &mesh) |
template<AttributeElement element, typename Scalar , typename Index > | |
void | extract_property (happly::Element &ply_element, const std::string &name, SurfaceMesh< Scalar, Index > &mesh) |
template<typename Scalar , typename Index > | |
void | extract_vertex_properties (happly::Element &vertex_element, SurfaceMesh< Scalar, Index > &mesh, const LoadOptions &options) |
template<typename Scalar , typename Index > | |
void | extract_facet_properties (happly::Element &facet_element, SurfaceMesh< Scalar, Index > &mesh, const LoadOptions &options) |
LA_SCENE_X (load_scene_obj, 0) | |
LA_SCENE_X (load_scene, 0) | |
LA_SIMPLE_SCENE_X (load_simple_scene, 0) | |
template<typename Scalar , typename Index , size_t Dimension> | |
tinygltf::Model | scene2model (const scene::SimpleScene< Scalar, Index, Dimension > &lscene, const SaveOptions &options) |
LA_SIMPLE_SCENE_X (save_simple_scene_gltf, 0) | |
template<typename Scalar , typename Index > | |
tinygltf::Model | lagrange_scene_to_gltf_model (const scene::Scene< Scalar, Index > &lscene, const SaveOptions &options) |
LA_SCENE_X (save_scene_gltf, 0) | |
LA_SURFACE_MESH_X (save_mesh, 0) | |
LA_SCENE_X (save_scene, 0) | |
LA_SIMPLE_SCENE_X (save_simple_scene, 0) | |
template<typename Scalar , typename Index > | |
void | stitch_mesh (SurfaceMesh< Scalar, Index > &mesh) |
Mesh input/output.
MeshType load_mesh | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Load a mesh from a stream.
A mesh loader will automatically be selected based on the contents of the stream.
MeshType | The mesh type to load. |
[in] | input_stream | The input stream. |
[in] | options | Extra options related to loading. |
SurfaceMesh
object loaded from the input stream. MeshType load_mesh | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load a mesh from a file.
The loader will be chosen depending on the file extension.
[in] | filename | Input file name. |
[in] | options | Extra options related to loading. |
SurfaceMesh
object loaded from the input file. MeshType load_mesh_fbx | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from an input stream in fbx format.
If the scene contains multiple meshes, they will be merged into one.
input_stream | Input data stream. |
options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_fbx | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from a file in fbx format.
If the scene contains multiple meshes, they will be merged into one.
[in] | filename | Input filename. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_gltf | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from an input stream in glTF or GLB format.
If the scene contains multiple meshes, they will be merged into one.
input_stream | Input data stream. |
options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_gltf | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from a file in glTF or GLB format.
If the scene contains multiple meshes, they will be merged into one.
[in] | filename | Input filename. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_msh | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from a stream in MSH format.
[in] | input_stream | Input stream. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_msh | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a mesh from a file in MSH format.
[in] | filename | Input filename. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_obj | ( | std::istream & | input_stream_obj, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from a file in MSH format.
[in] | input_stream_obj | Input stream. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_obj | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from a file in MSH format.
[in] | filename | Input filename. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_ply | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Loads a mesh from a stream in PLY format.
[in,out] | input_stream | Input stream. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
MeshType load_mesh_ply | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Loads a mesh from a file in PLY format.
[in] | filename | Input filename. |
[in] | options | Load options. |
MeshType | Mesh type to load. |
SceneType load_scene | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load a scene.
[in] | filename | Input scene file. |
[in] | options | Extra options related to loading. |
Scene
object created from the input scene file. SceneType load_scene | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Load a scene from a stream.
[in] | input_stream | The input stream. |
[in] | options | Extra options related to loading. |
Scene
object loaded from the input stream. SceneType load_scene_fbx | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load an fbx scene.
[in] | filename | input file name |
[in] | options |
SceneType load_scene_fbx | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Load an fbx scene.
[in] | input_stream | Input stream containing the scene data |
[in] | options |
SceneType load_scene_gltf | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load a scene using gltf.
[in] | filename | input file name |
[in] | options |
SceneType load_scene_gltf | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Load a scene using gltf.
[in] | input_stream | Input stream containing the scene data |
[in] | options |
SceneType load_scene_obj | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load an obj into a scene.
[in] | filename | input file name |
[in] | options |
SceneType load_scene_obj | ( | std::istream & | input_stream_obj, |
std::istream & | input_stream_mtl, | ||
const LoadOptions & | options = {} |
||
) |
Loadn obj into a scene.
[in] | input_stream_obj | Input stream containing the obj file data |
[in] | input_stream_mtl | Input stream containing the mtl file data |
[in] | options |
SceneType load_simple_scene | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load a simple scene.
[in] | filename | Input scene file. |
[in] | options | Extra options related to loading. |
SimpleScene
object created from the input scene file. SceneType load_simple_scene_fbx | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Load a simple scene from fbx.
[in] | filename | input file |
[in] | options |
SceneType load_simple_scene_fbx | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load a simple scene from fbx.
[in] | filename | input file |
[in] | options |
SceneType load_simple_scene_gltf | ( | std::istream & | input_stream, |
const LoadOptions & | options = {} |
||
) |
Load a simple scene with gltf.
[in] | input_stream | input stream data |
[in] | options |
SceneType load_simple_scene_gltf | ( | const fs::path & | filename, |
const LoadOptions & | options = {} |
||
) |
Load a simple scene with gltf.
[in] | filename | input file |
[in] | options |
void save_mesh | ( | std::ostream & | output_stream, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
FileFormat | format, | ||
const SaveOptions & | options = {} |
||
) |
void save_mesh | ( | const fs::path & | filename, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
Save a mesh to a file.
[in] | filename | path to output |
[in] | mesh | mesh to save |
[in] | options | Extra options related to saving. |
void save_mesh_gltf | ( | std::ostream & | output_stream, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
void save_mesh_gltf | ( | const fs::path & | filename, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
void save_mesh_msh | ( | std::ostream & | output_stream, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
Saves a mesh to a stream in MSH format.
If the mesh cannot be saved, an exception is raised (e.g., invalid output stream, incorrect mesh dimension, or facet size < 3).
[in,out] | output_stream | Output stream. |
[in] | mesh | Input mesh. |
[in] | options | Option settings. |
void save_mesh_msh | ( | const fs::path & | filename, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Saves a mesh to a stream in MSH format.
If the mesh cannot be saved, an exception is raised (e.g., incorrect mesh dimension, or facet size < 3).
[in] | filename | Output filename. |
[in] | mesh | Mesh to write. |
[in] | options | Save options. |
void save_mesh_obj | ( | std::ostream & | output_stream, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
Saves a mesh to a stream in OBJ format.
If the mesh cannot be saved, an exception is raised (e.g., invalid output stream, incorrect mesh dimension, or facet size < 3).
[in,out] | output_stream | Output stream. |
[in] | mesh | Mesh to write. |
[in] | options | Save options. |
void save_mesh_obj | ( | const fs::path & | filename, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Saves a mesh to a file in OBJ format.
If the mesh cannot be saved, an exception is raised (e.g., incorrect mesh dimension, or facet size < 3).
[in] | filename | Output filename. |
[in] | mesh | Mesh to write. |
[in] | options | Save options. |
void save_mesh_ply | ( | std::ostream & | output_stream, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
void save_mesh_ply | ( | const fs::path & | filename, |
const SurfaceMesh< Scalar, Index > & | mesh, | ||
const SaveOptions & | options = {} |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Saves a mesh to a file in PLY format.
[in] | filename | Output filename. |
[in] | mesh | Mesh to write. |
[in] | options | Save options. |
void save_scene | ( | const fs::path & | filename, |
const scene::Scene< Scalar, Index > & | scene, | ||
const SaveOptions & | options = {} |
||
) |
Save a scene to a file.
[in] | filename | path to output |
[in] | scene | scene to save |
[in] | options | SaveOptions, check the struct for more details. |
void save_scene | ( | std::ostream & | output_stream, |
const scene::Scene< Scalar, Index > & | scene, | ||
FileFormat | format, | ||
const SaveOptions & | options = {} |
||
) |
Save a scene to a stream.
[in] | output_stream | Stream to output |
[in] | scene | Scene to save |
[in] | format | FileFormat to use. |
[in] | options | SaveOptions, check the struct for more details. |
void save_scene_gltf | ( | std::ostream & | output_stream, |
const scene::Scene< Scalar, Index > & | scene, | ||
const SaveOptions & | options = {} |
||
) |
Save a scene to a gltf or glb file.
output_stream | Stream to output data |
scene | Scene to save |
options | SaveOptions, check the struct for more details. |
void save_scene_gltf | ( | const fs::path & | filename, |
const scene::Scene< Scalar, Index > & | scene, | ||
const SaveOptions & | options = {} |
||
) |
Save a scene to a gltf or glb file.
filename | path to output file |
scene | Scene to save |
options | SaveOptions, check the struct for more details. |
void save_simple_scene | ( | const fs::path & | filename, |
const scene::SimpleScene< Scalar, Index, Dimension > & | scene, | ||
const SaveOptions & | options = {} |
||
) |
Save a mesh to a file.
[in] | filename | path to output |
[in] | scene | mesh to save |
[in] | options | SaveOptions, check the struct for more details. |
void save_simple_scene_gltf | ( | std::ostream & | output_stream, |
const scene::SimpleScene< Scalar, Index, Dimension > & | scene, | ||
const SaveOptions & | options = {} |
||
) |
Save a simple scene to a gltf or glb file.
output_stream | Stream to output data |
scene | Scene to save |
options | SaveOptions, check the struct for more details. |
void save_simple_scene_gltf | ( | const fs::path & | filename, |
const scene::SimpleScene< Scalar, Index, Dimension > & | scene, | ||
const SaveOptions & | options = {} |
||
) |
Save a simple scene to a gltf or glb file.
filename | path to output file |
scene | Scene to save |
options | SaveOptions, check the struct for more details. |