[Bf-blender-cvs] [a85a52f064c] newboolean: Fix wrong use of initializer in C++. Fix unused parameter.

Howard Trickey noreply at git.blender.org
Fri Jul 31 01:14:31 CEST 2020


Commit: a85a52f064cb28d4388bbfbc892e9dbf846187fe
Author: Howard Trickey
Date:   Thu Jul 30 19:13:53 2020 -0400
Branches: newboolean
https://developer.blender.org/rBa85a52f064cb28d4388bbfbc892e9dbf846187fe

Fix wrong use of initializer in C++. Fix unused parameter.

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

M	source/blender/blenlib/intern/boolean.cc
M	source/blender/blenlib/intern/mesh_intersect.cc

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

diff --git a/source/blender/blenlib/intern/boolean.cc b/source/blender/blenlib/intern/boolean.cc
index 51d83d875ad..6372c86b153 100644
--- a/source/blender/blenlib/intern/boolean.cc
+++ b/source/blender/blenlib/intern/boolean.cc
@@ -426,7 +426,7 @@ class Cell {
   /* Call this when it is possible that this Cell has zero volume,
    * and if it does, set zero_volume_ to true.
    */
-  void check_for_zero_volume(int this_cell_index, const PatchesInfo &pinfo, const Mesh &mesh);
+  void check_for_zero_volume(const PatchesInfo &pinfo, const Mesh &mesh);
 };
 
 static std::ostream &operator<<(std::ostream &os, const Cell &cell)
@@ -464,7 +464,7 @@ static bool tris_have_same_verts(const Mesh &mesh, int t1, int t2)
  * patches are geometrically identical triangles (perhaps flipped versions of each other).
  * If this Cell has zero volume, set its zero_volume_ member to true.
  */
-void Cell::check_for_zero_volume(int this_cell_index, const PatchesInfo &pinfo, const Mesh &mesh)
+void Cell::check_for_zero_volume(const PatchesInfo &pinfo, const Mesh &mesh)
 {
   if (patches_.size() == 2) {
     const Patch &p1 = pinfo.patch(patches_[0]);
@@ -928,7 +928,7 @@ static void find_cells_from_edge(const Mesh &tm,
       Cell &cell = cinfo.cell(c);
       cell.add_patch(r_index);
       cell.add_patch(rnext_index);
-      cell.check_for_zero_volume(c, pinfo, tm);
+      cell.check_for_zero_volume(pinfo, tm);
       if (dbg_level > 0) {
         std::cout << "  made new cell " << c << "\n";
         std::cout << "  p" << r_index << "." << (r_flipped ? "cell_below" : "cell_above") << " = c"
@@ -942,7 +942,7 @@ static void find_cells_from_edge(const Mesh &tm,
       *rnext_prev_cell = c;
       Cell &cell = cinfo.cell(c);
       cell.add_patch(rnext_index);
-      cell.check_for_zero_volume(c, pinfo, tm);
+      cell.check_for_zero_volume(pinfo, tm);
       if (dbg_level > 0) {
         std::cout << "  p" << rnext_index << "." << (rnext_flipped ? "cell_above" : "cell_below")
                   << " = c" << c << "\n";
@@ -953,7 +953,7 @@ static void find_cells_from_edge(const Mesh &tm,
       *r_follow_cell = c;
       Cell &cell = cinfo.cell(c);
       cell.add_patch(r_index);
-      cell.check_for_zero_volume(c, pinfo, tm);
+      cell.check_for_zero_volume(pinfo, tm);
       if (dbg_level > 0) {
         std::cout << "  p" << r_index << "." << (r_flipped ? "cell_below" : "cell_above") << " = c"
                   << c << "\n";
diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc
index a51d7cbac5d..203cbd7c1fc 100644
--- a/source/blender/blenlib/intern/mesh_intersect.cc
+++ b/source/blender/blenlib/intern/mesh_intersect.cc
@@ -2454,6 +2454,18 @@ struct SubdivideTrisData {
    * overlap pairs have that same indexA (they will be continguous).
    */
   Vector<OverlapTriRange> overlap_tri_range;
+
+  SubdivideTrisData(Array<Mesh> &r_tri_subdivided,
+                    const Mesh &tm,
+                    Span<BVHTreeOverlap> overlap,
+                    MArena *arena)
+      : r_tri_subdivided(r_tri_subdivided),
+        tm(tm),
+        overlap(overlap),
+        arena(arena),
+        overlap_tri_range{}
+  {
+  }
 };
 
 static void calc_subdivided_tri_range_func(void *__restrict userdata,
@@ -2505,8 +2517,10 @@ static void calc_subdivided_tris(Array<Mesh> &r_tri_subdivided,
     std::cout << "\nCALC_SUBDIVIDED_TRIS\n\n";
   }
   Span<BVHTreeOverlap> overlap = ov.overlap();
-  SubdivideTrisData data = SubdivideTrisData{
-      .r_tri_subdivided = r_tri_subdivided, .tm = tm, .overlap = overlap, .arena = arena};
+  SubdivideTrisData data(r_tri_subdivided, tm, overlap, arena);
+  data.r_tri_subdivided = r_tri_subdivided;
+  data.overlap = overlap;
+  data.arena = arena;
   int overlap_tot = overlap.size();
   data.overlap_tri_range = Vector<OverlapTriRange>();
   data.overlap_tri_range.reserve(overlap_tot);



More information about the Bf-blender-cvs mailing list