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:32:05 +0300
committerishbosamiya <ishbosamiya@gmail.com>2021-08-28 13:32:05 +0300
commit8f283d50d7a9a4b38554bc917bdbf58a8b34e1a7 (patch)
tree34306b7b4239277daa43d7d9635cf88e6bccff80 /source/blender
parent611172fd8c88adb3a66fd984f20b1b304f239c34 (diff)
adaptive_cloth: Mesh: compute info separate functions for each type
`compute_info()` now calls separate functions for each element type instead of computing it within that function. This allows other parts of the code to compute info of the element when it is easier to do over creating a mesh diff.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_cloth_remesh.hh43
1 files changed, 36 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index 9b5a4a14c76..cf58d8970c8 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -2889,30 +2889,59 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh {
}
/**
+ * Computes extra data information for given node
+ */
+ void compute_info_node(Node<END> &UNUSED(node))
+ {
+ }
+
+ /**
+ * Computes extra data information for given vert
+ */
+ void compute_info_vert(Vert<EVD> &UNUSED(vert))
+ {
+ }
+
+ /**
+ * Computes extra data information for given edge
+ */
+ void compute_info_edge(Edge<EED> &UNUSED(edge))
+ {
+ }
+
+ /**
+ * Computes extra data information for given face
+ */
+ void compute_info_face(Face<EFD> &face)
+ {
+ this->compute_face_normal(face);
+ }
+
+ /**
* For all added elements within mesh_diff, compute information
* needed by the mesh. For example, face normals, etc.
*/
void compute_info(const MeshDiff<END, EVD, EED, EFD> &mesh_diff)
{
-/* Not using setting anything in these as of right now */
-# if 0
for (const auto &node_index : mesh_diff.get_added_nodes()) {
- const auto &node = this->get_checked_node(node_index);
+ auto &node = this->get_checked_node(node_index);
+ this->compute_info_node(node);
}
for (const auto &vert_index : mesh_diff.get_added_verts()) {
- const auto &vert = this->get_checked_vert(vert_index);
+ auto &vert = this->get_checked_vert(vert_index);
+ this->compute_info_vert(vert);
}
for (const auto &edge_index : mesh_diff.get_added_edges()) {
- const auto &edge = this->get_checked_edge(edge_index);
+ auto &edge = this->get_checked_edge(edge_index);
+ this->compute_info_edge(edge);
}
-# endif
for (const auto &face_index : mesh_diff.get_added_faces()) {
auto &face = this->get_checked_face(face_index);
- this->compute_face_normal(face);
+ this->compute_info_face(face);
}
}