supereight
Loading...
Searching...
No Matches
mesh_io.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016-2019 Emanuele Vespa
3 * SPDX-FileCopyrightText: 2018-2021 Smart Robotics Lab, Imperial College London, Technical University of Munich
4 * SPDX-FileCopyrightText: 2019-2021 Nils Funk
5 * SPDX-FileCopyrightText: 2020-2021 Sotiris Papatheodorou
6 * SPDX-License-Identifier: BSD-3-Clause
7 */
8
9#ifndef SE_MESHING_IO_HPP
10#define SE_MESHING_IO_HPP
11
12#include <Eigen/Geometry>
13#include <fstream>
14#include <iostream>
18
19namespace se {
20namespace io {
21
24static const std::array<std::string, 3> mesh_extensions = {".obj", ".ply", ".vtk"};
25
29bool has_supported_mesh_extension(const std::string& filename);
30
43template<typename FaceT>
45 const std::string& filename,
46 const Eigen::Affine3f& T_OM = Eigen::Affine3f::Identity());
47
58template<typename FaceT>
60 const std::string& filename,
61 const Eigen::Affine3f& T_OM = Eigen::Affine3f::Identity());
62
73template<typename FaceT>
75 const std::string& filename,
76 const Eigen::Affine3f& T_OM = Eigen::Affine3f::Identity());
77
88template<typename FaceT>
90 const std::string& filename,
91 const Eigen::Affine3f& T_OM = Eigen::Affine3f::Identity());
92
93} // namespace io
94} // namespace se
95
96#include "impl/mesh_io_impl.hpp"
97
98#endif // SE_MESHING_IO_HPP
Definition image.hpp:19
int save_mesh_ply(const Mesh< FaceT > &mesh_M, const std::string &filename, const Eigen::Affine3f &T_OM=Eigen::Affine3f::Identity())
Save a mesh as a PLY file.
static const std::array< std::string, 3 > mesh_extensions
The supported file extensions for mesh files.
Definition mesh_io.hpp:24
int save_mesh_obj(const Mesh< FaceT > &mesh_M, const std::string &filename, const Eigen::Affine3f &T_OM=Eigen::Affine3f::Identity())
Save a mesh as an Wavefront OBJ file.
int save_mesh_vtk(const Mesh< FaceT > &mesh_M, const std::string &filename, const Eigen::Affine3f &T_OM=Eigen::Affine3f::Identity())
Save a mesh as a VTK file.
int save_mesh(const Mesh< FaceT > &mesh_M, const std::string &filename, const Eigen::Affine3f &T_OM=Eigen::Affine3f::Identity())
Save a mesh to a file whose type is determined by the extension of filename.
bool has_supported_mesh_extension(const std::string &filename)
Test whether the suffix of filename is one of the file extensions in se::io::mesh_extensions.
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14