Blender
V5.3
source
blender
io
wavefront_obj
importer
obj_import_file_reader.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#pragma once
10
11
#include "
IO_wavefront_obj.hh
"
12
13
#include "
BLI_map.hh
"
14
#include "
BLI_vector.hh
"
15
16
#include "
obj_import_objects.hh
"
17
18
namespace
blender
{
19
struct
BLI_mmap_file
;
20
}
21
22
namespace
blender::io::obj
{
23
24
struct
MTLMaterial
;
25
26
class
OBJParser
{
27
private
:
28
const
OBJImportParams
&import_params_;
29
Vector<std::string>
mtl_libraries_;
30
BLI_mmap_file
*mmap_file_ =
nullptr
;
31
std::string line_buffer_;
32
33
public
:
37
OBJParser
(
const
OBJImportParams
&import_params);
38
~OBJParser
();
39
44
void
parse
(
Vector
<std::unique_ptr<Geometry>> &r_all_geometries,
45
GlobalVertices
&r_global_vertices);
49
Span<std::string>
mtl_libraries
()
const
;
50
51
private
:
52
void
add_mtl_library(
StringRef
path);
53
void
add_default_mtl_library();
54
StringRef
read_next_obj_line(
StringRef
&buffer);
55
void
parse_string_buffer(
StringRef
&buffer_str,
56
Vector
<std::unique_ptr<Geometry>> &r_all_geometries,
57
GlobalVertices
&r_global_vertices,
58
Geometry
*&curr_geom);
59
};
60
61
class
MTLParser
{
62
private
:
63
char
mtl_file_path_[
FILE_MAX
];
67
char
mtl_dir_path_[
FILE_MAX
];
68
69
public
:
73
MTLParser
(
StringRefNull
mtl_library_,
StringRefNull
obj_filepath);
74
78
void
parse_and_store
(
Map
<std::string, std::unique_ptr<MTLMaterial>> &r_materials);
79
};
80
}
// namespace blender::io::obj
BLI_map.hh
FILE_MAX
#define FILE_MAX
Definition
BLI_path_utils.hh:696
BLI_vector.hh
IO_wavefront_obj.hh
blender::Map
Definition
BLI_map.hh:129
blender::Span
Definition
BLI_span.hh:74
blender::StringRefNull
Definition
BLI_string_ref.hh:144
blender::StringRef
Definition
BLI_string_ref.hh:165
blender::Vector
Definition
BLI_vector.hh:76
blender::io::obj::MTLParser::parse_and_store
void parse_and_store(Map< std::string, std::unique_ptr< MTLMaterial > > &r_materials)
Definition
obj_import_file_reader.cc:892
blender::io::obj::MTLParser::MTLParser
MTLParser(StringRefNull mtl_library_, StringRefNull obj_filepath)
Definition
obj_import_file_reader.cc:880
blender::io::obj::OBJParser::OBJParser
OBJParser(const OBJImportParams &import_params)
Definition
obj_import_file_reader.cc:443
blender::io::obj::OBJParser::mtl_libraries
Span< std::string > mtl_libraries() const
Definition
obj_import_file_reader.cc:846
blender::io::obj::OBJParser::parse
void parse(Vector< std::unique_ptr< Geometry > > &r_all_geometries, GlobalVertices &r_global_vertices)
Definition
obj_import_file_reader.cc:698
blender::io::obj
Definition
obj_export_file_writer.cc:42
blender
BMesh Iterators.
Definition
ANIM_action.hh:30
obj_import_objects.hh
blender::BLI_mmap_file
Definition
BLI_mmap.cc:32
blender::OBJImportParams
Definition
IO_wavefront_obj.hh:84
blender::io::obj::Geometry
Definition
obj_import_objects.hh:132
blender::io::obj::GlobalVertices
Definition
obj_import_objects.hh:24
blender::io::obj::MTLMaterial
Definition
obj_export_mtl.hh:54
Generated on
for Blender by
doxygen
1.18.0