Commit: a732abd99b65c4f17bddd1aa3b946836b274765c Author: Ankit Meel Date: Sun Aug 16 19:32:52 2020 +0530 Branches: soc-2020-io-performance https://developer.blender.org/rBa732abd99b65c4f17bddd1aa3b946836b274765c
Clean up: use const, header cleanup. Also fix build issues that the last two commits introduced. https://github.com/include-what-you-use/include-what-you-use =================================================================== M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.cc M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.hh M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.cc M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.hh M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.cc M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.hh M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.cc M source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.hh M source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc M source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.hh M source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.cc M source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.hh M source/blender/io/wavefront_obj/intern/wavefront_obj_importer.cc =================================================================== diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.cc index 37e743db0dd..102a655615e 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.cc @@ -24,12 +24,11 @@ #include "BKE_blender_version.h" #include "BLI_array.hh" -#include "BLI_math_inline.h" - -#include "DNA_object_types.h" #include "wavefront_obj_ex_file_writer.hh" +#include "wavefront_obj_ex_mesh.hh" #include "wavefront_obj_ex_mtl.hh" +#include "wavefront_obj_ex_nurbs.hh" #include "wavefront_obj_im_mtl.hh" namespace blender::io::obj { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.hh index a4f10a3f14c..20bee120e3f 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.hh +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_file_writer.hh @@ -23,12 +23,14 @@ #pragma once -#include "IO_wavefront_obj.h" +#include "DNA_meshdata_types.h" -#include "wavefront_obj_ex_mesh.hh" -#include "wavefront_obj_ex_nurbs.hh" +#include "IO_wavefront_obj.h" +#include "BLI_vector.hh" namespace blender::io::obj { +class OBJMesh; +class OBJNurbs; /* Types of index offsets. */ enum eIndexOffsets { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.cc index 3e70ea07f16..06a54d8e739 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.cc @@ -22,12 +22,13 @@ */ #include "BKE_customdata.h" -#include "BKE_deform.h" +#include "BKE_lib_id.h" +#include "BKE_material.h" +#include "BKE_mesh.h" #include "BKE_mesh_mapping.h" #include "BKE_object.h" #include "BLI_listbase.h" -#include "BLI_map.hh" #include "BLI_math.h" #include "bmesh.h" @@ -35,7 +36,8 @@ #include "DEG_depsgraph_query.h" -#include "DNA_layer_types.h" +#include "DNA_mesh_types.h" +#include "DNA_object_types.h" #include "DNA_material_types.h" #include "DNA_modifier_types.h" @@ -110,7 +112,7 @@ void OBJMesh::triangulate_mesh_eval() struct BMeshFromMeshParams bm_convert_params = {true, 0, 0, 0}; /* Lower threshold where triangulation of a face starts, i.e. a quadrilateral will be * triangulated here. */ - int triangulate_min_verts = 4; + const int triangulate_min_verts = 4; BMesh *bmesh = BKE_mesh_to_bmesh_ex(export_mesh_eval_, &bm_create_params, &bm_convert_params); BM_mesh_triangulate(bmesh, @@ -212,7 +214,7 @@ void OBJMesh::calc_smooth_groups() poly_smooth_groups_ = nullptr; } int tot_smooth_groups = 0; - bool use_bitflags = export_params_.smooth_groups_bitflags; + const bool use_bitflags = export_params_.smooth_groups_bitflags; poly_smooth_groups_ = BKE_mesh_calc_smoothgroups(export_mesh_eval_->medge, export_mesh_eval_->totedge, export_mesh_eval_->mpoly, @@ -258,7 +260,7 @@ const char *OBJMesh::get_object_data_name() const */ const char *OBJMesh::get_object_material_name(short mat_nr) const { - Material *mat = BKE_object_material_get(export_object_eval_, mat_nr); + const Material *mat = BKE_object_material_get(export_object_eval_, mat_nr); return mat->id.name + 2; } @@ -400,7 +402,7 @@ const char *OBJMesh::get_poly_deform_group_name(const MPoly &mpoly, /* Indices of the vector index into deform groups of an object; values are the number of vertex * members in one deform group. */ Vector<int> deform_group_members{}; - uint tot_deform_groups = BLI_listbase_count(&export_object_eval_->defbase); + const uint tot_deform_groups = BLI_listbase_count(&export_object_eval_->defbase); deform_group_members.resize(tot_deform_groups, 0); /* Whether at least one vertex in the polygon belongs to any group. */ bool found_group = false; diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.hh index a1d3ebe6dc7..cb4e8377d7f 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.hh +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mesh.hh @@ -23,17 +23,13 @@ #pragma once -#include "BKE_lib_id.h" -#include "BKE_material.h" -#include "BKE_mesh.h" - #include "BLI_array.hh" #include "BLI_utility_mixins.hh" #include "BLI_vector.hh" +#include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" -#include "DNA_object_types.h" #include "IO_wavefront_obj.h" diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.cc index f24ce0f14aa..ae3b641fbcf 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.cc @@ -22,19 +22,21 @@ */ #include "BKE_image.h" -#include "BKE_material.h" #include "BKE_node.h" #include "BLI_float3.hh" #include "BLI_map.hh" -#include "BLI_math.h" +#include "BLI_path_util.h" #include "DNA_material_types.h" #include "DNA_node_types.h" #include "NOD_node_tree_ref.hh" +#include "wavefront_obj_ex_mesh.hh" #include "wavefront_obj_ex_mtl.hh" +#include "wavefront_obj_im_mtl.hh" + namespace blender::io::obj { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.hh index 6193604b6db..2b18f820fcc 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.hh +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_mtl.hh @@ -23,11 +23,6 @@ #pragma once -#include "NOD_node_tree_ref.hh" - -#include "BLI_path_util.h" - -#include "wavefront_obj_ex_mesh.hh" #include "wavefront_obj_im_mtl.hh" namespace blender::io::obj { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.cc index 3f569c7cdfe..332b72196c6 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.cc @@ -22,7 +22,6 @@ */ #include "BLI_math.h" -#include "BLI_vector.hh" #include "DEG_depsgraph.h" #include "DEG_depsgraph_query.h" @@ -45,8 +44,7 @@ OBJNurbs::OBJNurbs(Depsgraph *depsgraph, } /** - * Store the product of export axes settings and an object's world transform matrix in - * world_and_axes_transform[4][4]. + * Store the product of export axes settings and an object's world transform matrix. */ void OBJNurbs::store_world_axes_transform() { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.hh index c471bd1c128..8ecb36d3ad0 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.hh +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_ex_nurbs.hh @@ -23,9 +23,6 @@ #pragma once -#include "BKE_context.h" -#include "BKE_curve.h" - #include "BLI_utility_mixins.hh" #include "DNA_curve_types.h" diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc index 2b4b01b826f..b60060dfad6 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_exporter.cc @@ -36,7 +36,6 @@ #include "wavefront_obj_ex_file_writer.hh" #include "wavefront_obj_ex_mesh.hh" -#include "wavefront_obj_ex_mtl.hh" #include "wavefront_obj_ex_nurbs.hh" #include "wavefront_obj_exporter.hh" diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.hh index d09f78c2e60..f29b063b5d9 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.hh +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.hh @@ -24,12 +24,10 @@ #pragma once #include "BKE_lib_id.h" -#include "BKE_mesh.h" #include "BLI_utility_mixins.hh" -#include "bmesh.h" - +#include "wavefront_obj_im_mtl.hh" #include "wavefront_obj_im_objects.hh" namespace blender::io::obj { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.cc index 1467b7ff8bb..fa38d232e4e 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.cc @@ -21,6 +21,8 @@ * \ingroup obj */ +#include "BKE_object.h" + #include "DNA_curve_types.h" #include "wavefront_obj_im_nurbs.hh" diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.hh b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.hh index 31f49a81787..592b4f4fb61 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.hh +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_im_nurbs.hh @@ -29,6 +29,8 @@ #include "BLI_utility_mixins.hh" +#include "DNA_curve_types.h" + #include "wavefront_obj_im_objects.hh" namespace blender::io::obj { diff --git a/source/blender/io/wavefront_obj/intern/wavefront_obj_importer.cc b/source/blender/io/wavefront_obj/intern/wavefront_obj_importer.cc index e5394082985..b62b3d55c45 100644 --- a/source/blender/io/wavefront_obj/intern/wavefront_obj_importer.cc +++ b/source/blender/io/wavefront_obj/intern/wavefront_obj_importer.cc @@ -21,17 +21,13 @@ * \ingroup obj */ -#include <fstream> -#include <iostream> +#include <string> -#include "BLI_array.hh" #include "BLI_float2.hh" #include "BLI_float3.hh" #include "BLI_map.hh" -#include "BLI_string.h" #include "BLI_string_ref.hh" -#include "bmesh.h" #include "wavefront_obj_im_file_reader.hh" #include "wavefront_obj_im_mesh.hh" _______________________________________________ Bf-blender-cvs mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-blender-cvs
