Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorishbosamiya <ishbosamiya@gmail.com>2021-08-28 13:34:20 +0300
committerishbosamiya <ishbosamiya@gmail.com>2021-08-28 13:34:20 +0300
commitc47d67260e55a7b15196b0c9ae97a859bf3d02d8 (patch)
treee08eaa028b1067f5686e8929deb2cd8629141bcd
parent8f283d50d7a9a4b38554bc917bdbf58a8b34e1a7 (diff)
adaptive_cloth: Mesh: add checked loose edge
Adds a loose edge to the mesh with the given vert indices and ensures that these vert indices do not already have an edge between them and that they exist.
-rw-r--r--source/blender/blenkernel/BKE_cloth_remesh.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index cf58d8970c8..43ea4bd793d 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -2945,6 +2945,22 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
}
}
+ Edge<EED> &add_checked_loose_edge(const VertIndex v1_index, const VertIndex v2_index)
+ {
+ /* Checks to ensure v1 and v2 are valid */
+ {
+ BLI_assert(this->has_vert(v1_index));
+ BLI_assert(this->has_vert(v2_index));
+ BLI_assert(this->get_connecting_edge_index(v1_index, v2_index) == std::nullopt);
+ }
+
+ auto &new_edge = this->add_empty_edge();
+ new_edge.verts = std::make_tuple(v1_index, v2_index);
+ this->add_edge_ref_to_verts(new_edge);
+
+ return new_edge;
+ }
+
private:
/* all private static methods */
/* all private non-static methods */