Lagrange
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
load_assimp.h
1/*
2 * Copyright 2023 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#ifdef LAGRANGE_WITH_ASSIMP
15
16 #include <lagrange/fs/filesystem.h>
17 #include <lagrange/io/types.h>
18 #include <lagrange/scene/SimpleScene.h>
19
20 #include <assimp/mesh.h>
21 #include <assimp/postprocess.h>
22 #include <assimp/scene.h>
23 #include <iosfwd>
24 #include <memory>
25
26namespace lagrange::io::internal {
30std::unique_ptr<aiScene> load_assimp(
31 const fs::path& filename,
32 unsigned int flags = aiProcess_CalcTangentSpace |
33 aiProcess_GenUVCoords | aiProcess_PopulateArmatureData);
34
38std::unique_ptr<aiScene> load_assimp(
39 std::istream& input_stream,
40 unsigned int flags = aiProcess_CalcTangentSpace |
41 aiProcess_GenUVCoords | aiProcess_PopulateArmatureData);
42
46template <typename MeshType>
47MeshType convert_mesh_assimp_to_lagrange(const aiMesh& mesh, const LoadOptions& options = {});
48
52template <typename MeshType>
53MeshType load_mesh_assimp(const aiScene& scene, const LoadOptions& options = {});
54
58template <typename SceneType>
59SceneType load_simple_scene_assimp(const aiScene& scene, const LoadOptions& options = {});
60
64template <typename SceneType>
65SceneType load_scene_assimp(const aiScene& scene, const LoadOptions& options = {});
66
67
68} // namespace lagrange::io::internal
69
70#endif
Definition: Mesh.h:48