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:
authorAntony Riakiotakis <kalast@gmail.com>2012-03-22 01:40:42 +0400
committerAntony Riakiotakis <kalast@gmail.com>2012-03-22 01:40:42 +0400
commit95f66f162ce695310872950232b6a00633646e1e (patch)
tree35d244d049192a07eedd2aae537a30361709c620 /source/blender/bmesh/intern/bmesh_walkers.c
parentff7088088f63a2cfb4ab9b2219c29afe751dfed8 (diff)
Fix #30504 selecting self-intersecting face loop won't work correctly.
Added generic secondary hash to walker. In faceloop select it is used to remember if edge has been previously visited, in addition to the hash used for faces. This solves the case where walker stops if it finds an already added face.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_walkers.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_walkers.c b/source/blender/bmesh/intern/bmesh_walkers.c
index 029bc35f2e7..bf646827a51 100644
--- a/source/blender/bmesh/intern/bmesh_walkers.c
+++ b/source/blender/bmesh/intern/bmesh_walkers.c
@@ -86,7 +86,8 @@ void BMW_init(BMWalker *walker, BMesh *bm, int type,
walker->mask_face = mask_face;
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 1");
-
+ walker->secvisithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers sec 1");
+
if (UNLIKELY(type >= BMW_MAXWALKERS || type < 0)) {
fprintf(stderr,
"Invalid walker type in BMW_init; type: %d, "
@@ -125,6 +126,7 @@ void BMW_end(BMWalker *walker)
{
BLI_mempool_destroy(walker->worklist);
BLI_ghash_free(walker->visithash, NULL, NULL);
+ BLI_ghash_free(walker->secvisithash, NULL, NULL);
}
@@ -251,5 +253,7 @@ void BMW_reset(BMWalker *walker)
}
walker->depth = 0;
BLI_ghash_free(walker->visithash, NULL, NULL);
+ BLI_ghash_free(walker->secvisithash, NULL, NULL);
walker->visithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers 1");
+ walker->secvisithash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh walkers sec 1");
}