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:
authorChris Blackbourn <chrisbblend@gmail.com>2022-11-09 01:42:30 +0300
committerChris Blackbourn <chrisbblend@gmail.com>2022-11-09 01:47:16 +0300
commitf04f9cc3d02168ce6ef779954f9db39c8c734775 (patch)
treeb2c0d2276b70f4f9b9167cc34fc116acda398f6f /source/blender/blenkernel/BKE_mesh_mapping.h
parent75265f27da64d4c18f5c22cd85ef868bc4a573ac (diff)
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
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh_mapping.h')
-rw-r--r--source/blender/blenkernel/BKE_mesh_mapping.h7
1 files changed, 7 insertions, 0 deletions
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. */