Blender
V4.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
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::io::obj
{
19
20
struct
MTLMaterial;
21
22
/* NOTE: the OBJ parser implementation is planned to get fairly large changes "soon",
23
* so don't read too much into current implementation... */
24
class
OBJParser
{
25
private
:
26
const
OBJImportParams
&import_params_;
27
FILE *obj_file_;
28
Vector<std::string>
mtl_libraries_;
29
size_t
read_buffer_size_;
30
31
public
:
35
OBJParser
(
const
OBJImportParams
&import_params,
size_t
read_buffer_size);
36
~OBJParser
();
37
42
void
parse
(
Vector
<std::unique_ptr<Geometry>> &r_all_geometries,
43
GlobalVertices
&r_global_vertices);
47
Span<std::string>
mtl_libraries
()
const
;
48
49
private
:
50
void
add_mtl_library(
StringRef
path);
51
void
add_default_mtl_library();
52
};
53
54
class
MTLParser
{
55
private
:
56
char
mtl_file_path_[
FILE_MAX
];
60
char
mtl_dir_path_[
FILE_MAX
];
61
62
public
:
66
MTLParser
(
StringRefNull
mtl_library_,
StringRefNull
obj_filepath);
67
71
void
parse_and_store
(
Map
<std::string, std::unique_ptr<MTLMaterial>> &r_materials);
72
};
73
}
// namespace blender::io::obj
BLI_map.hh
FILE_MAX
#define FILE_MAX
Definition
BLI_path_utils.hh:657
BLI_vector.hh
IO_wavefront_obj.hh
blender::Map
Definition
BLI_map.hh:129
blender::Span
Definition
BLI_span.hh:75
blender::StringRefNull
Definition
BLI_string_ref.hh:111
blender::StringRef
Definition
BLI_string_ref.hh:128
blender::Vector
Definition
BLI_vector.hh:65
blender::io::obj::MTLParser
Definition
obj_import_file_reader.hh:54
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:852
blender::io::obj::MTLParser::MTLParser
MTLParser(StringRefNull mtl_library_, StringRefNull obj_filepath)
Definition
obj_import_file_reader.cc:844
blender::io::obj::OBJParser
Definition
obj_import_file_reader.hh:24
blender::io::obj::OBJParser::mtl_libraries
Span< std::string > mtl_libraries() const
Definition
obj_import_file_reader.cc:810
blender::io::obj::OBJParser::~OBJParser
~OBJParser()
Definition
obj_import_file_reader.cc:438
blender::io::obj::OBJParser::OBJParser
OBJParser(const OBJImportParams &import_params, size_t read_buffer_size)
Definition
obj_import_file_reader.cc:424
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:480
blender::io::obj
Definition
obj_export_file_writer.cc:31
obj_import_objects.hh
OBJImportParams
Definition
IO_wavefront_obj.hh:70
blender::io::obj::GlobalVertices
Definition
obj_import_objects.hh:24
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0