diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-07-13 06:55:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-13 06:58:08 +0400 |
commit | 15a6911dd131f5c82117eb2ffa878c951673cd27 (patch) | |
tree | 1945bef39447cdb9a2253e2aa7c0c390ccf0dcb3 /source/blender/bmesh | |
parent | c04f301fc3bf5a21413bb0962c199f8eb49fbdaf (diff) |
BMesh: remove error check on radial loops and consistent naming
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 1c93eccf8bd..3072e1acead 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -956,54 +956,38 @@ bool bmesh_loop_reverse(BMesh *bm, BMFace *f) #endif } -static void bm_elements_systag_enable(void *veles, int tot, int flag) +static void bm_elements_systag_enable(void *veles, int tot, const char api_flag) { BMHeader **eles = veles; int i; for (i = 0; i < tot; i++) { - BM_ELEM_API_FLAG_ENABLE((BMElemF *)eles[i], flag); + BM_ELEM_API_FLAG_ENABLE((BMElemF *)eles[i], api_flag); } } -static void bm_elements_systag_disable(void *veles, int tot, int flag) +static void bm_elements_systag_disable(void *veles, int tot, const char api_flag) { BMHeader **eles = veles; int i; for (i = 0; i < tot; i++) { - BM_ELEM_API_FLAG_DISABLE((BMElemF *)eles[i], flag); + BM_ELEM_API_FLAG_DISABLE((BMElemF *)eles[i], api_flag); } } -static int count_flagged_radial(BMesh *bm, BMLoop *l, int flag) +static int bm_loop_systag_count_radial(BMLoop *l, const char api_flag) { - BMLoop *l2 = l; - int i = 0, c = 0; - + BMLoop *l_iter = l; + int i = 0; do { - if (UNLIKELY(!l2)) { - BMESH_ASSERT(0); - goto error; - } - - i += BM_ELEM_API_FLAG_TEST(l2->f, flag) ? 1 : 0; - l2 = l2->radial_next; - if (UNLIKELY(c >= BM_LOOP_RADIAL_MAX)) { - BMESH_ASSERT(0); - goto error; - } - c++; - } while (l2 != l); + i += BM_ELEM_API_FLAG_TEST(l_iter->f, api_flag) ? 1 : 0; + } while ((l_iter = l_iter->radial_next) != l); return i; - -error: - BMO_error_raise(bm, bm->currentop, BMERR_MESH_ERROR, NULL); - return 0; } -static int UNUSED_FUNCTION(count_flagged_disk)(BMVert *v, int flag) +static int UNUSED_FUNCTION(bm_vert_systag_count_disk)(BMVert *v, const char api_flag) { BMEdge *e = v->e; int i = 0; @@ -1012,13 +996,13 @@ static int UNUSED_FUNCTION(count_flagged_disk)(BMVert *v, int flag) return 0; do { - i += BM_ELEM_API_FLAG_TEST(e, flag) ? 1 : 0; + i += BM_ELEM_API_FLAG_TEST(e, api_flag) ? 1 : 0; } while ((e = bmesh_disk_edge_next(e, v)) != v->e); return i; } -static bool disk_is_flagged(BMVert *v, int flag) +static bool disk_is_flagged(BMVert *v, const char api_flag) { BMEdge *e = v->e; @@ -1036,7 +1020,7 @@ static bool disk_is_flagged(BMVert *v, int flag) return false; do { - if (!BM_ELEM_API_FLAG_TEST(l->f, flag)) + if (!BM_ELEM_API_FLAG_TEST(l->f, api_flag)) return false; } while ((l = l->radial_next) != e->l); } while ((e = bmesh_disk_edge_next(e, v)) != v->e); @@ -1093,7 +1077,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del) f = faces[i]; l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { - int rlen = count_flagged_radial(bm, l_iter, _FLAG_JF); + int rlen = bm_loop_systag_count_radial(l_iter, _FLAG_JF); if (rlen > 2) { err = N_("Input faces do not form a contiguous manifold region"); |