Lagrange
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
load_mesh.h
1/*
2 * Copyright 2017 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14/*
15 * This file does not contain function definition because those require other expensive headers
16 * and we want to minimize the size of this header, as it's used in almost all tests.
17 *
18 * If you have any issues with a load_mesh function not being defined for your specific
19 * mesh type, you can #include <lagrange/io/load_mesh.impl.h> instead.
20 */
21
22#include <lagrange/common.h>
23#include <lagrange/fs/filesystem.h>
24#include <lagrange/legacy/inline.h>
25#include <lagrange/MeshTrait.h>
26
27#include <memory>
28#include <vector>
29
30namespace lagrange::io {
31LAGRANGE_LEGACY_INLINE
32namespace legacy {
33
34template <typename MeshType>
35std::unique_ptr<MeshType> load_mesh_basic(const fs::path& filename);
36
37template <typename MeshType>
38std::vector<std::unique_ptr<MeshType>> load_obj_meshes(const fs::path& filename);
39
40template <typename MeshType>
41std::unique_ptr<MeshType> load_obj_mesh(const fs::path& filename);
42
43template <
44 typename MeshType,
45 std::enable_if_t<lagrange::MeshTraitHelper::is_mesh<MeshType>::value>* = nullptr>
46std::unique_ptr<MeshType> load_mesh(const fs::path& filename);
47
48} // namespace legacy
49} // namespace lagrange::io
Definition: Mesh.h:48
Mesh input/output.
Definition: detect_file_format.h:18
MeshType load_mesh(std::istream &input_stream, const LoadOptions &options={})
Load a mesh from a stream.
Definition: load_mesh.cpp:37