#include <objloader.h>
Inheritance diagram for sheep::OBJLoader:

Public Member Functions | |
| OBJLoader () | |
| virtual void | Load (const std::string &filename, IMeshBuilder &builder, int option_mask=DEFAULT_CONFIGURATION_BIT, ProgressMonitor *progmon=0) throw (LoadingException) |
Private Types | |
| typedef std::map< std::string, IMeshBuilder::FeatureId > | string_to_feature_id_map |
| enum | symbol { END_OF_FILE = 256, END_OF_LINE, IDENTIFIER, INTEGER, DOUBLE, D, F, G, ILLUM, KA, KD, KS, MAP_KD, MTLLIB, NEWMTL, O, S, TR, USEMTL, V, VN, VT } |
Private Member Functions | |
| void | parse_error () |
| int | look_ahead () |
| void | eat_leading_blanks () |
| void | eat_blanks () |
| void | eat_line () |
| void | accept_char (int ref) |
| void | accept_newline () |
| int | accept_integer () |
| double | accept_double () |
| std::string | accept_string () |
| bool | is_eol () |
| void | select_submesh () |
| void | parse_file () |
| void | parse_f_statement () |
| void | parse_mtllib_statement () |
| void | parse_usemtl_statement () |
| void | parse_v_statement () |
| void | parse_vt_statement () |
| void | parse_vn_statement () |
| void | load_material_file (const std::string &filename) |
| void | parse_material_file () |
| void | parse_ka_statement () |
| void | parse_kd_statement () |
| void | parse_ks_statement () |
| void | parse_map_kd_statement () |
| void | parse_newmtl_statement () |
Private Attributes | |
| KeywordTable | m_keyword_table |
| std::string | m_path |
| IMeshBuilder::IGeometryBuilder * | m_geombuilder |
| IMeshBuilder::IMaterialBuilder * | m_matbuilder |
| int | m_option_mask |
| ProgressMonitor * | m_progmon |
| May be 0. | |
| FILE * | m_file |
| int | m_line |
| string_to_feature_id_map | m_material_id |
| std::vector< Vector3 > | m_vertices |
| All features are stored in these vectors as the file is parsed. | |
| std::vector< Vector3 > | m_normals |
| std::vector< Vector2 > | m_texcoords |
| std::map< int, IMeshBuilder::FeatureId > | m_global_vertex_id |
| bool | m_create_submesh |
| If true, create a new submesh before processing new faces. | |
| bool | m_set_submesh_material |
| If true, apply the material specified by 'm_material_id' to the new submesh. | |
| IMeshBuilder::FeatureId | m_submesh_material_id |
| Id of the material to apply to the new submesh. | |
| bool | m_inside_submesh_def |
| If true, we are currently in the middle of a submesh definition. | |
| bool | m_inside_material_def |
| If true, we are currently in the middle of a material definition. | |
|
|
Definition at line 113 of file objloader.h. |
|
|
Definition at line 75 of file objloader.h. |
|
|
Definition at line 41 of file objloader.cpp. References D, F, G, ILLUM, sheep::KeywordTable::Insert(), KA, KD, KS, MAP_KD, MTLLIB, NEWMTL, S, TR, USEMTL, V, VN, and VT. |
|
|
Definition at line 204 of file objloader.h. Referenced by parse_f_statement(). |
|
|
Definition at line 203 of file objloader.cpp. References look_ahead(), and parse_error(). Referenced by parse_ka_statement(), parse_kd_statement(), parse_ks_statement(), parse_v_statement(), parse_vn_statement(), and parse_vt_statement(). |
|
|
Definition at line 187 of file objloader.cpp. References look_ahead(), and parse_error(). Referenced by parse_f_statement(). |
|
|
Definition at line 217 of file objloader.h. Referenced by parse_f_statement(), parse_ka_statement(), parse_kd_statement(), parse_ks_statement(), parse_map_kd_statement(), parse_mtllib_statement(), parse_newmtl_statement(), parse_usemtl_statement(), parse_v_statement(), parse_vn_statement(), and parse_vt_statement(). |
|
|
Definition at line 219 of file objloader.cpp. References parse_error(). Referenced by parse_file(), parse_map_kd_statement(), parse_material_file(), parse_mtllib_statement(), parse_newmtl_statement(), and parse_usemtl_statement(). |
|
|
Definition at line 146 of file objloader.cpp. Referenced by parse_f_statement(), parse_ka_statement(), parse_kd_statement(), parse_ks_statement(), parse_map_kd_statement(), parse_mtllib_statement(), parse_newmtl_statement(), parse_usemtl_statement(), parse_v_statement(), parse_vn_statement(), and parse_vt_statement(). |
|
|
Definition at line 112 of file objloader.cpp. Referenced by parse_file(), and parse_material_file(). |
|
|
Definition at line 171 of file objloader.cpp. Referenced by parse_file(), and parse_material_file(). |
|
|
Definition at line 229 of file objloader.h. Referenced by parse_f_statement(), parse_mtllib_statement(), parse_usemtl_statement(), parse_v_statement(), and parse_vt_statement(). |
|
||||||||||||||||||||
|
|
Definition at line 635 of file objloader.cpp. References sheep::IMeshBuilder::IMaterialBuilder::EndMaterial(), m_inside_material_def, parse_material_file(), and sheep::TryOpeningFile(). Referenced by parse_mtllib_statement(). |
|
|
Definition at line 192 of file objloader.h. Referenced by accept_double(), accept_integer(), parse_f_statement(), parse_file(), and parse_material_file(). |
|
|
Definition at line 107 of file objloader.cpp. Referenced by accept_double(), accept_integer(), accept_string(), parse_f_statement(), parse_ka_statement(), parse_kd_statement(), parse_ks_statement(), and parse_map_kd_statement(). |
|
|
|
Definition at line 281 of file objloader.cpp. References accept_string(), eat_leading_blanks(), eat_line(), F, sheep::KeywordTable::GetSymbol(), look_ahead(), MTLLIB, parse_f_statement(), parse_mtllib_statement(), parse_usemtl_statement(), parse_v_statement(), parse_vn_statement(), parse_vt_statement(), select_submesh(), sheep::ProgressMonitor::SetJobProgress(), USEMTL, V, VN, and VT. Referenced by Load(). |
|
|
Definition at line 697 of file objloader.cpp. References accept_double(), accept_newline(), eat_blanks(), m_inside_material_def, parse_error(), and sheep::IMeshBuilder::IMaterialBuilder::SetAmbientColor(). Referenced by parse_material_file(). |
|
|
Definition at line 717 of file objloader.cpp. References accept_double(), accept_newline(), eat_blanks(), m_inside_material_def, parse_error(), and sheep::IMeshBuilder::IMaterialBuilder::SetDiffuseColor(). Referenced by parse_material_file(). |
|
|
Definition at line 737 of file objloader.cpp. References accept_double(), accept_newline(), eat_blanks(), m_inside_material_def, parse_error(), and sheep::IMeshBuilder::IMaterialBuilder::SetSpecularColor(). Referenced by parse_material_file(). |
|
|
Definition at line 757 of file objloader.cpp. References accept_newline(), accept_string(), eat_blanks(), sheep::IMeshBuilder::IMaterialBuilder::EndMaterial(), m_inside_material_def, parse_error(), sheep::IMeshBuilder::IMaterialBuilder::SetTexture(), and sheep::TryLoadingImage(). Referenced by parse_material_file(). |
|
|
Definition at line 666 of file objloader.cpp. References accept_string(), eat_leading_blanks(), eat_line(), sheep::KeywordTable::GetSymbol(), KA, KD, KS, look_ahead(), MAP_KD, NEWMTL, parse_ka_statement(), parse_kd_statement(), parse_ks_statement(), parse_map_kd_statement(), and parse_newmtl_statement(). Referenced by load_material_file(). |
|
|
Definition at line 516 of file objloader.cpp. References accept_newline(), accept_string(), eat_blanks(), is_eol(), and load_material_file(). Referenced by parse_file(). |
|
|
Definition at line 798 of file objloader.cpp. References accept_newline(), accept_string(), sheep::IMeshBuilder::IMaterialBuilder::BeginMaterial(), eat_blanks(), sheep::IMeshBuilder::IMaterialBuilder::EndMaterial(), m_inside_material_def, and m_material_id. Referenced by parse_material_file(). |
|
|
Definition at line 539 of file objloader.cpp. References accept_newline(), accept_string(), eat_blanks(), is_eol(), m_create_submesh, m_material_id, m_set_submesh_material, and m_submesh_material_id. Referenced by parse_file(). |
|
|
Definition at line 574 of file objloader.cpp. References accept_double(), accept_newline(), eat_blanks(), is_eol(), sheep::Vector3::m_x, sheep::Vector3::m_y, and sheep::Vector3::m_z. Referenced by parse_file(). |
|
|
Definition at line 615 of file objloader.cpp. References accept_double(), accept_newline(), eat_blanks(), sheep::Vector3::m_x, sheep::Vector3::m_y, sheep::Vector3::m_z, and sheep::Vector3::Normalize(). Referenced by parse_file(). |
|
|
Definition at line 596 of file objloader.cpp. References accept_double(), accept_newline(), eat_blanks(), is_eol(), sheep::Vector2::m_x, and sheep::Vector2::m_y. Referenced by parse_file(). |
|
|
Definition at line 255 of file objloader.cpp. References sheep::IMeshBuilder::IGeometryBuilder::BeginSubMesh(), sheep::IMeshBuilder::IGeometryBuilder::EndSubMesh(), m_create_submesh, m_global_vertex_id, m_inside_submesh_def, m_set_submesh_material, m_submesh_material_id, and sheep::IMeshBuilder::IGeometryBuilder::SetMaterial(). Referenced by parse_file(). |
|
|
If true, create a new submesh before processing new faces.
Definition at line 126 of file objloader.h. Referenced by Load(), parse_usemtl_statement(), and select_submesh(). |
|
|
Definition at line 110 of file objloader.h. |
|
|
Definition at line 103 of file objloader.h. |
|
|
This vector is used to avoid inserting duplicate vertices into the current mesh. It is cleared each time a new mesh is created. Definition at line 124 of file objloader.h. Referenced by parse_f_statement(), and select_submesh(). |
|
|
If true, we are currently in the middle of a material definition.
Definition at line 130 of file objloader.h. Referenced by load_material_file(), parse_ka_statement(), parse_kd_statement(), parse_ks_statement(), parse_map_kd_statement(), and parse_newmtl_statement(). |
|
|
If true, we are currently in the middle of a submesh definition.
Definition at line 129 of file objloader.h. Referenced by Load(), and select_submesh(). |
|
|
Definition at line 99 of file objloader.h. |
|
|
Definition at line 111 of file objloader.h. |
|
|
Definition at line 104 of file objloader.h. |
|
|
Definition at line 115 of file objloader.h. Referenced by parse_newmtl_statement(), and parse_usemtl_statement(). |
|
|
Definition at line 119 of file objloader.h. |
|
|
Definition at line 106 of file objloader.h. |
|
|
Definition at line 101 of file objloader.h. |
|
|
May be 0.
Definition at line 108 of file objloader.h. |
|
|
If true, apply the material specified by 'm_material_id' to the new submesh.
Definition at line 127 of file objloader.h. Referenced by Load(), parse_usemtl_statement(), and select_submesh(). |
|
|
Id of the material to apply to the new submesh.
Definition at line 128 of file objloader.h. Referenced by Load(), parse_usemtl_statement(), and select_submesh(). |
|
|
Definition at line 120 of file objloader.h. |
|
|
All features are stored in these vectors as the file is parsed.
Definition at line 118 of file objloader.h. |
1.3.6