diff options
author | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-28 13:34:20 +0300 |
---|---|---|
committer | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-28 13:34:20 +0300 |
commit | c47d67260e55a7b15196b0c9ae97a859bf3d02d8 (patch) | |
tree | e08eaa028b1067f5686e8929deb2cd8629141bcd | |
parent | 8f283d50d7a9a4b38554bc917bdbf58a8b34e1a7 (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.hh | 16 |
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 */ |