diff options
author | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-28 13:30:33 +0300 |
---|---|---|
committer | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-28 13:30:33 +0300 |
commit | 611172fd8c88adb3a66fd984f20b1b304f239c34 (patch) | |
tree | 91cb89a780a0a24f510e2649fe4a177f8efd2902 /source/blender/blenkernel/BKE_cloth_remesh.hh | |
parent | 8e8946c5458b9557e72be3adc85139bafa96714a (diff) |
adaptive_cloth: Mesh: functions to check if mesh has that element
Given the element's index, it check if the element still exists in the
mesh.
Diffstat (limited to 'source/blender/blenkernel/BKE_cloth_remesh.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_cloth_remesh.hh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh index 8f5bdda42ef..9b5a4a14c76 100644 --- a/source/blender/blenkernel/BKE_cloth_remesh.hh +++ b/source/blender/blenkernel/BKE_cloth_remesh.hh @@ -1271,6 +1271,30 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh { return this->faces; } + bool has_node(const NodeIndex node_index) const + { + const auto op_node = this->get_nodes().get(node_index); + return op_node != std::nullopt; + } + + bool has_vert(const VertIndex vert_index) const + { + const auto op_vert = this->get_verts().get(vert_index); + return op_vert != std::nullopt; + } + + bool has_edge(const EdgeIndex edge_index) const + { + const auto op_edge = this->get_edges().get(edge_index); + return op_edge != std::nullopt; + } + + bool has_face(const FaceIndex face_index) const + { + const auto op_face = this->get_faces().get(face_index); + return op_face != std::nullopt; + } + std::optional<EdgeIndex> get_connecting_edge_index(VertIndex vert_1_index, VertIndex vert_2_index) const { |