[Bf-blender-cvs] [6fc993ba44e] temp-gpencil-io: Remove more unused includes, use C++ style for loop

Hans Goudey noreply at git.blender.org
Tue Mar 23 20:05:31 CET 2021


Commit: 6fc993ba44ea03f5316d0c7dd7749ba21e3a824d
Author: Hans Goudey
Date:   Tue Mar 23 14:51:02 2021 -0400
Branches: temp-gpencil-io
https://developer.blender.org/rB6fc993ba44ea03f5316d0c7dd7749ba21e3a824d

Remove more unused includes, use C++ style for loop

===================================================================

M	source/blender/io/CMakeLists.txt
M	source/blender/io/gpencil/intern/gpencil_io_capi.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_pdf.h
M	source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
M	source/blender/io/gpencil/intern/gpencil_io_export_svg.h
M	source/blender/io/gpencil/intern/gpencil_io_import_base.cc
M	source/blender/io/gpencil/intern/gpencil_io_import_svg.cc

===================================================================

diff --git a/source/blender/io/CMakeLists.txt b/source/blender/io/CMakeLists.txt
index 67ac315927e..f11ad7627b9 100644
--- a/source/blender/io/CMakeLists.txt
+++ b/source/blender/io/CMakeLists.txt
@@ -37,4 +37,3 @@ if(WITH_USD)
 endif()
 
 add_subdirectory(gpencil)
-
diff --git a/source/blender/io/gpencil/intern/gpencil_io_capi.cc b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
index 8ed26f32abb..34539a66fe8 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_capi.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
@@ -24,10 +24,6 @@
 #include <stdio.h>
 
 #include "BLI_listbase.h"
-#include "BLI_math.h"
-#include "BLI_path_util.h"
-#include "BLI_string.h"
-#include "BLI_utildefines.h"
 
 #include "DNA_gpencil_types.h"
 #include "DNA_screen_types.h"
@@ -38,8 +34,6 @@
 #include "BKE_main.h"
 #include "BKE_scene.h"
 
-#include "ED_markers.h"
-
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_query.h"
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
index a7a0f94abd8..64eb6f78464 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc
@@ -21,12 +21,7 @@
  * \ingroup bgpencil
  */
 
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_math.h"
-#include "BLI_string.h"
-#include "BLI_utildefines.h"
+#include "BLI_math_vector.h"
 
 #include "DNA_gpencil_types.h"
 #include "DNA_material_types.h"
@@ -45,6 +40,7 @@
 #include "DEG_depsgraph_query.h"
 
 #include "ED_gpencil.h"
+#include "ED_view3d.h"
 
 #ifdef WIN32
 #  include "utfconv.h"
@@ -52,8 +48,6 @@
 
 #include "UI_view2d.h"
 
-#include "ED_view3d.h"
-
 #include "gpencil_io.h"
 #include "gpencil_io_export_pdf.h"
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.h b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.h
index d0167fca235..009c05a8b49 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.h
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.h
@@ -22,8 +22,6 @@
  * \ingroup bgpencil
  */
 
-#include "DNA_material_types.h"
-
 #include "gpencil_io_export_base.h"
 #include "hpdf.h"
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
index 5ffb2ad9396..bd9bb7b19c1 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.cc
@@ -20,13 +20,8 @@
 /** \file
  * \ingroup bgpencil
  */
-#include <iostream>
-#include <list>
-#include <string>
 
-#include "MEM_guardedalloc.h"
-
-#include "BLI_math.h"
+#include "BLI_math_vector.h"
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
@@ -45,6 +40,7 @@
 #include "DEG_depsgraph_query.h"
 
 #include "ED_gpencil.h"
+#include "ED_view3d.h"
 
 #ifdef WIN32
 #  include "utfconv.h"
@@ -52,8 +48,6 @@
 
 #include "UI_view2d.h"
 
-#include "ED_view3d.h"
-
 #include "gpencil_io.h"
 #include "gpencil_io_export_svg.h"
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_svg.h b/source/blender/io/gpencil/intern/gpencil_io_export_svg.h
index 97c76b014f9..f564736c16e 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_export_svg.h
+++ b/source/blender/io/gpencil/intern/gpencil_io_export_svg.h
@@ -23,8 +23,6 @@
  */
 #include "BLI_path_util.h"
 
-#include "DNA_material_types.h"
-
 #include "gpencil_io_export_base.h"
 #include "pugixml.hpp"
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_base.cc b/source/blender/io/gpencil/intern/gpencil_io_import_base.cc
index 6de100246a6..b49b4c969ad 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_import_base.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_import_base.cc
@@ -32,7 +32,6 @@
 #include "BKE_material.h"
 
 #include "ED_gpencil.h"
-#include "ED_view3d.h"
 
 #include "gpencil_io_import_base.h"
 
diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
index 6fcf6e29597..f7e2c031e5a 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
@@ -20,13 +20,7 @@
 /** \file
  * \ingroup bgpencil
  */
-#include <iostream>
-#include <list>
-#include <string>
 
-#include "MEM_guardedalloc.h"
-
-#include "BLI_blenlib.h"
 #include "BLI_float3.hh"
 #include "BLI_math.h"
 #include "BLI_span.hh"
@@ -199,29 +193,28 @@ void GpencilImporterSVG::create_stroke(bGPdata *gpd,
   for (int i = 0; i < path->npts - 1; i += 3) {
     float *p = &path->pts[i * 2];
     float a = 0.0f;
-    for (int v = 0; v < edges; v++) {
-      bGPDspoint *pt = &gps->points[start_index];
-      pt->strength = shape->opacity;
-      pt->pressure = 1.0f;
-      pt->z = 0.0f;
+    for (bGPDspoint &pt : MutableSpan(gps->points, gps->totpoints)) {
+      pt.strength = shape->opacity;
+      pt.pressure = 1.0f;
+      pt.z = 0.0f;
       /* TODO: (antoniov) Can be improved loading curve data instead of loading strokes. */
-      interp_v2_v2v2v2v2_cubic(&pt->x, &p[0], &p[2], &p[4], &p[6], a);
+      interp_v2_v2v2v2v2_cubic(&pt.x, &p[0], &p[2], &p[4], &p[6], a);
 
       /* Scale from milimeters. */
-      mul_v3_fl(&pt->x, 0.001f);
-      mul_m4_v3(matrix, &pt->x);
+      mul_v3_fl(&pt.x, 0.001f);
+      mul_m4_v3(matrix, &pt.x);
 
       /* Apply color to vertex color. */
       if (is_fill) {
         NSVGpaint fill = shape->fill;
-        convert_color(fill.color, pt->vert_color);
+        convert_color(fill.color, pt.vert_color);
       }
       if (is_stroke) {
         NSVGpaint stroke = shape->stroke;
-        convert_color(stroke.color, pt->vert_color);
-        gps->fill_opacity_fac = pt->vert_color[3];
+        convert_color(stroke.color, pt.vert_color);
+        gps->fill_opacity_fac = pt.vert_color[3];
       }
-      pt->vert_color[3] = 1.0f;
+      pt.vert_color[3] = 1.0f;
 
       a += step;
       start_index++;



More information about the Bf-blender-cvs mailing list