[Bf-blender-cvs] [89e7d6b02fd] soc-2021-adaptive-cloth: adaptive_cloth: MeshDiff: append one MeshDiff to another

ishbosamiya noreply at git.blender.org
Mon Aug 30 09:15:08 CEST 2021


Commit: 89e7d6b02fd613c23632bcddcdccc8d4345d0078
Author: ishbosamiya
Date:   Sat Aug 28 16:09:23 2021 +0530
Branches: soc-2021-adaptive-cloth
https://developer.blender.org/rB89e7d6b02fd613c23632bcddcdccc8d4345d0078

adaptive_cloth: MeshDiff: append one MeshDiff to another

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

M	source/blender/blenkernel/BKE_cloth_remesh.hh

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

diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index ada7cb6808d..eb106c2511d 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -3455,6 +3455,26 @@ template<typename END, typename EVD, typename EED, typename EFD> class MeshDiff
     return this->deleted_faces;
   }
 
+  /**
+   * Appends other into the current MeshDiff.
+   *
+   * It is generally a good idea to run
+   * `remove_non_existing_elements()` after this function to ensure
+   * correct `MeshDiff` does not contain invalid elements.
+   */
+  void append(const MeshDiff<END, EVD, EED, EFD> &other)
+  {
+    this->deleted_nodes.extend(other.deleted_nodes.as_span());
+    this->deleted_verts.extend(other.deleted_verts.as_span());
+    this->deleted_edges.extend(other.deleted_edges.as_span());
+    this->deleted_faces.extend(other.deleted_faces.as_span());
+
+    this->added_nodes.extend(other.added_nodes.as_span());
+    this->added_verts.extend(other.added_verts.as_span());
+    this->added_edges.extend(other.added_edges.as_span());
+    this->added_faces.extend(other.added_faces.as_span());
+  }
+
   /**
    * Removes elements from added elements that no longer exist in the
    * mesh.



More information about the Bf-blender-cvs mailing list