From f04f9cc3d02168ce6ef779954f9db39c8c734775 Mon Sep 17 00:00:00 2001 From: Chris Blackbourn Date: Wed, 9 Nov 2022 11:42:30 +1300 Subject: Cleanup: add unique_index_table to UvElementMap In anticipation of UV Copy+Paste, we need fast access to indices of unique UvElements. Can also be used to improve performance and simplify code for UV Sculpt tools and UV Stitch. No user visible changes expected. Maniphest Tasks: T77911 See also: D16278 --- source/blender/blenkernel/BKE_mesh_mapping.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/BKE_mesh_mapping.h') diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h index 9d9c2f57f89..d0813ebb168 100644 --- a/source/blender/blenkernel/BKE_mesh_mapping.h +++ b/source/blender/blenkernel/BKE_mesh_mapping.h @@ -63,6 +63,10 @@ typedef struct UvElement { * If islands are calculated, it also stores UvElements * belonging to the same uv island in sequence and * the number of uvs per island. + * + * \note in C++, #head_table and #unique_index_table would + * be `mutable`, as they are created on demand, and never + * changed after creation. */ typedef struct UvElementMap { /** UvElement Storage. */ @@ -78,6 +82,9 @@ typedef struct UvElementMap { /** If Non-NULL, pointer to local head of each unique UV. */ struct UvElement **head_table; + /** If Non-NULL, pointer to index of each unique UV. */ + int **unique_index_table; + /** Number of islands, or zero if not calculated. */ int total_islands; /** Array of starting index in #storage where each island begins. */ -- cgit v1.2.3 From 2d9d08677ecfa2684a67c39ab1d632865716ccb4 Mon Sep 17 00:00:00 2001 From: Chris Blackbourn Date: Wed, 9 Nov 2022 14:54:37 +1300 Subject: Cleanup: fix types from f04f9cc3d021 --- source/blender/blenkernel/BKE_mesh_mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_mesh_mapping.h') diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h index d0813ebb168..705158bec0b 100644 --- a/source/blender/blenkernel/BKE_mesh_mapping.h +++ b/source/blender/blenkernel/BKE_mesh_mapping.h @@ -83,7 +83,7 @@ typedef struct UvElementMap { struct UvElement **head_table; /** If Non-NULL, pointer to index of each unique UV. */ - int **unique_index_table; + int *unique_index_table; /** Number of islands, or zero if not calculated. */ int total_islands; -- cgit v1.2.3