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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-09 21:12:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-09 21:12:24 +0400
commit347e2b6cb075d5526a8cb948102618560ff7a379 (patch)
treeb43144dcafbc0da11acc08ec43f7968648978950 /source
parent06b3d4f7bbd92d16d14928fbc7d540e774e84f26 (diff)
code cleanup: make bmesh var names more consistent
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/intern/bmesh_core.c410
-rw-r--r--source/blender/bmesh/intern/bmesh_core.h6
-rw-r--r--source/blender/bmesh/intern/bmesh_interp.c22
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.c164
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c18
-rw-r--r--source/blender/bmesh/intern/bmesh_structure.c10
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c6
-rw-r--r--source/blender/bmesh/operators/bmo_connect.c8
-rw-r--r--source/blender/bmesh/operators/bmo_removedoubles.c10
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c164
-rw-r--r--source/blender/bmesh/tools/bmesh_decimate_dissolve.c6
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c12
13 files changed, 420 insertions, 420 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c
index 643e73e02b4..cb37e6ce4fe 100644
--- a/source/blender/bmesh/intern/bmesh_core.c
+++ b/source/blender/bmesh/intern/bmesh_core.c
@@ -942,7 +942,7 @@ static bool disk_is_flagged(BMVert *v, int flag)
*/
BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
{
- BMFace *f, *newf;
+ BMFace *f, *f_new;
#ifdef USE_BMESH_HOLES
BMLoopList *lst;
ListBase holes = {NULL, NULL};
@@ -1036,15 +1036,15 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
}
/* create region face */
- newf = tote ? BM_face_create_ngon(bm, v1, v2, edges, tote, 0) : NULL;
- if (UNLIKELY(!newf || BMO_error_occurred(bm))) {
+ f_new = tote ? BM_face_create_ngon(bm, v1, v2, edges, tote, 0) : NULL;
+ if (UNLIKELY(!f_new || BMO_error_occurred(bm))) {
if (!BMO_error_occurred(bm))
err = N_("Invalid boundary region to join faces");
goto error;
}
/* copy over loop data */
- l_iter = l_first = BM_FACE_FIRST_LOOP(newf);
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f_new);
do {
BMLoop *l2 = l_iter->radial_next;
@@ -1064,34 +1064,34 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
}
} while ((l_iter = l_iter->next) != l_first);
- BM_elem_attrs_copy(bm, bm, faces[0], newf);
+ BM_elem_attrs_copy(bm, bm, faces[0], f_new);
#ifdef USE_BMESH_HOLES
/* add holes */
- BLI_movelisttolist(&newf->loops, &holes);
+ BLI_movelisttolist(&f_new->loops, &holes);
#endif
/* update loop face pointer */
#ifdef USE_BMESH_HOLES
- for (lst = newf->loops.first; lst; lst = lst->next)
+ for (lst = f_new->loops.first; lst; lst = lst->next)
#endif
{
#ifdef USE_BMESH_HOLES
l_iter = l_first = lst->first;
#else
- l_iter = l_first = BM_FACE_FIRST_LOOP(newf);
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f_new);
#endif
do {
- l_iter->f = newf;
+ l_iter->f = f_new;
} while ((l_iter = l_iter->next) != l_first);
}
bm_elements_systag_disable(faces, totface, _FLAG_JF);
- BM_ELEM_API_FLAG_DISABLE(newf, _FLAG_JF);
+ BM_ELEM_API_FLAG_DISABLE(f_new, _FLAG_JF);
/* handle multi-res data */
if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) {
- l_iter = l_first = BM_FACE_FIRST_LOOP(newf);
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f_new);
do {
for (i = 0; i < totface; i++) {
BM_loop_interp_multires(bm, l_iter, faces[i]);
@@ -1120,8 +1120,8 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del)
BLI_array_free(deledges);
BLI_array_free(delverts);
- BM_CHECK_ELEMENT(newf);
- return newf;
+ BM_CHECK_ELEMENT(f_new);
+ return f_new;
error:
bm_elements_systag_disable(faces, totface, _FLAG_JF);
@@ -1210,18 +1210,18 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
BMFace *f2;
BMLoop *l_iter, *l_first;
- BMLoop *v1loop = NULL, *v2loop = NULL, *f1loop = NULL, *f2loop = NULL;
+ BMLoop *l_v1 = NULL, *l_v2 = NULL, *l_f1 = NULL, *l_f2 = NULL;
BMEdge *e;
int i, len, f1len, f2len;
/* verify that v1 and v2 are in face */
len = f->len;
for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f); i < len; i++, l_iter = l_iter->next) {
- if (l_iter->v == v1) v1loop = l_iter;
- else if (l_iter->v == v2) v2loop = l_iter;
+ if (l_iter->v == v1) l_v1 = l_iter;
+ else if (l_iter->v == v2) l_v2 = l_iter;
}
- if (!v1loop || !v2loop) {
+ if (!l_v1 || !l_v2) {
return NULL;
}
@@ -1229,28 +1229,28 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
e = BM_edge_create(bm, v1, v2, example, no_double ? BM_CREATE_NO_DOUBLE : 0);
f2 = bm_face_create__sfme(bm, f);
- f1loop = bm_loop_create(bm, v2, e, f, v2loop, 0);
- f2loop = bm_loop_create(bm, v1, e, f2, v1loop, 0);
+ l_f1 = bm_loop_create(bm, v2, e, f, l_v2, 0);
+ l_f2 = bm_loop_create(bm, v1, e, f2, l_v1, 0);
- f1loop->prev = v2loop->prev;
- f2loop->prev = v1loop->prev;
- v2loop->prev->next = f1loop;
- v1loop->prev->next = f2loop;
+ l_f1->prev = l_v2->prev;
+ l_f2->prev = l_v1->prev;
+ l_v2->prev->next = l_f1;
+ l_v1->prev->next = l_f2;
- f1loop->next = v1loop;
- f2loop->next = v2loop;
- v1loop->prev = f1loop;
- v2loop->prev = f2loop;
+ l_f1->next = l_v1;
+ l_f2->next = l_v2;
+ l_v1->prev = l_f1;
+ l_v2->prev = l_f2;
#ifdef USE_BMESH_HOLES
lst = f->loops.first;
lst2 = f2->loops.first;
- lst2->first = lst2->last = f2loop;
- lst->first = lst->last = f1loop;
+ lst2->first = lst2->last = l_f2;
+ lst->first = lst->last = l_f1;
#else
/* find which of the faces the original first loop is in */
- l_iter = l_first = f1loop;
+ l_iter = l_first = l_f1;
first_loop_f1 = 0;
do {
if (l_iter == f->l_first)
@@ -1261,23 +1261,23 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
/* original first loop was in f1, find a suitable first loop for f2
* which is as similar as possible to f1. the order matters for tools
* such as duplifaces. */
- if (f->l_first->prev == f1loop)
- f2->l_first = f2loop->prev;
- else if (f->l_first->next == f1loop)
- f2->l_first = f2loop->next;
+ if (f->l_first->prev == l_f1)
+ f2->l_first = l_f2->prev;
+ else if (f->l_first->next == l_f1)
+ f2->l_first = l_f2->next;
else
- f2->l_first = f2loop;
+ f2->l_first = l_f2;
}
else {
/* original first loop was in f2, further do same as above */
f2->l_first = f->l_first;
- if (f->l_first->prev == f2loop)
- f->l_first = f1loop->prev;
- else if (f->l_first->next == f2loop)
- f->l_first = f1loop->next;
+ if (f->l_first->prev == l_f2)
+ f->l_first = l_f1->prev;
+ else if (f->l_first->next == l_f2)
+ f->l_first = l_f1->next;
else
- f->l_first = f1loop;
+ f->l_first = l_f1;
}
#endif
@@ -1293,8 +1293,8 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
} while ((l_iter = l_iter->next) != l_first);
/* link up the new loops into the new edges radial */
- bmesh_radial_append(e, f1loop);
- bmesh_radial_append(e, f2loop);
+ bmesh_radial_append(e, l_f1);
+ bmesh_radial_append(e, l_f2);
f2->len = f2len;
@@ -1306,7 +1306,7 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
f->len = f1len;
- if (r_l) *r_l = f2loop;
+ if (r_l) *r_l = l_f2;
#ifdef USE_BMESH_HOLES
if (holes) {
@@ -1349,77 +1349,77 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2,
*/
BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
{
- BMLoop *nextl;
- BMEdge *ne;
- BMVert *nv, *ov;
+ BMLoop *l_next;
+ BMEdge *e_new;
+ BMVert *v_new, *v_old;
int i, valence1 = 0, valence2 = 0;
bool edok;
BLI_assert(bmesh_vert_in_edge(e, tv) != false);
- ov = bmesh_edge_other_vert_get(e, tv);
+ v_old = bmesh_edge_other_vert_get(e, tv);
- valence1 = bmesh_disk_count(ov);
+ valence1 = bmesh_disk_count(v_old);
valence2 = bmesh_disk_count(tv);
- nv = BM_vert_create(bm, tv->co, tv, 0);
- ne = BM_edge_create(bm, nv, tv, e, 0);
+ v_new = BM_vert_create(bm, tv->co, tv, 0);
+ e_new = BM_edge_create(bm, v_new, tv, e, 0);
- bmesh_disk_edge_remove(ne, tv);
- bmesh_disk_edge_remove(ne, nv);
+ bmesh_disk_edge_remove(e_new, tv);
+ bmesh_disk_edge_remove(e_new, v_new);
/* remove e from tv's disk cycle */
bmesh_disk_edge_remove(e, tv);
- /* swap out tv for nv in e */
- bmesh_edge_swapverts(e, tv, nv);
+ /* swap out tv for v_new in e */
+ bmesh_edge_swapverts(e, tv, v_new);
- /* add e to nv's disk cycle */
- bmesh_disk_edge_append(e, nv);
+ /* add e to v_new's disk cycle */
+ bmesh_disk_edge_append(e, v_new);
- /* add ne to nv's disk cycle */
- bmesh_disk_edge_append(ne, nv);
+ /* add e_new to v_new's disk cycle */
+ bmesh_disk_edge_append(e_new, v_new);
- /* add ne to tv's disk cycle */
- bmesh_disk_edge_append(ne, tv);
+ /* add e_new to tv's disk cycle */
+ bmesh_disk_edge_append(e_new, tv);
/* verify disk cycles */
- edok = bmesh_disk_validate(valence1, ov->e, ov);
+ edok = bmesh_disk_validate(valence1, v_old->e, v_old);
BMESH_ASSERT(edok != false);
edok = bmesh_disk_validate(valence2, tv->e, tv);
BMESH_ASSERT(edok != false);
- edok = bmesh_disk_validate(2, nv->e, nv);
+ edok = bmesh_disk_validate(2, v_new->e, v_new);
BMESH_ASSERT(edok != false);
/* Split the radial cycle if present */
- nextl = e->l;
+ l_next = e->l;
e->l = NULL;
- if (nextl) {
- BMLoop *nl, *l;
- int radlen = bmesh_radial_length(nextl);
+ if (l_next) {
+ BMLoop *l_new, *l;
+ int radlen = bmesh_radial_length(l_next);
int first1 = 0, first2 = 0;
/* Take the next loop. Remove it from radial. Split it. Append to appropriate radials */
- while (nextl) {
- l = nextl;
+ while (l_next) {
+ l = l_next;
l->f->len++;
- nextl = nextl != nextl->radial_next ? nextl->radial_next : NULL;
+ l_next = l_next != l_next->radial_next ? l_next->radial_next : NULL;
bmesh_radial_loop_remove(l, NULL);
- nl = bm_loop_create(bm, NULL, NULL, l->f, l, 0);
- nl->prev = l;
- nl->next = (l->next);
- nl->prev->next = nl;
- nl->next->prev = nl;
- nl->v = nv;
+ l_new = bm_loop_create(bm, NULL, NULL, l->f, l, 0);
+ l_new->prev = l;
+ l_new->next = (l->next);
+ l_new->prev->next = l_new;
+ l_new->next->prev = l_new;
+ l_new->v = v_new;
/* assign the correct edge to the correct loop */
- if (bmesh_verts_in_edge(nl->v, nl->next->v, e)) {
- nl->e = e;
- l->e = ne;
+ if (bmesh_verts_in_edge(l_new->v, l_new->next->v, e)) {
+ l_new->e = e;
+ l->e = e_new;
- /* append l into ne's rad cycle */
+ /* append l into e_new's rad cycle */
if (!first1) {
first1 = 1;
l->radial_next = l->radial_prev = NULL;
@@ -1430,14 +1430,14 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
l->radial_next = l->radial_prev = NULL;
}
- bmesh_radial_append(nl->e, nl);
+ bmesh_radial_append(l_new->e, l_new);
bmesh_radial_append(l->e, l);
}
- else if (bmesh_verts_in_edge(nl->v, nl->next->v, ne)) {
- nl->e = ne;
+ else if (bmesh_verts_in_edge(l_new->v, l_new->next->v, e_new)) {
+ l_new->e = e_new;
l->e = e;
- /* append l into ne's rad cycle */
+ /* append l into e_new's rad cycle */
if (!first1) {
first1 = 1;
l->radial_next = l->radial_prev = NULL;
@@ -1448,7 +1448,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
l->radial_next = l->radial_prev = NULL;
}
- bmesh_radial_append(nl->e, nl);
+ bmesh_radial_append(l_new->e, l_new);
bmesh_radial_append(l->e, l);
}
@@ -1457,14 +1457,14 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
/* verify length of radial cycle */
edok = bmesh_radial_validate(radlen, e->l);
BMESH_ASSERT(edok != false);
- edok = bmesh_radial_validate(radlen, ne->l);
+ edok = bmesh_radial_validate(radlen, e_new->l);
BMESH_ASSERT(edok != false);
/* verify loop->v and loop->next->v pointers for e */
for (i = 0, l = e->l; i < radlen; i++, l = l->radial_next) {
BMESH_ASSERT(l->e == e);
//BMESH_ASSERT(l->radial_next == l);
- BMESH_ASSERT(!(l->prev->e != ne && l->next->e != ne));
+ BMESH_ASSERT(!(l->prev->e != e_new && l->next->e != e_new));
edok = bmesh_verts_in_edge(l->v, l->next->v, e);
BMESH_ASSERT(edok != false);
@@ -1477,12 +1477,12 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
BM_CHECK_ELEMENT(l->e);
BM_CHECK_ELEMENT(l->f);
}
- /* verify loop->v and loop->next->v pointers for ne */
- for (i = 0, l = ne->l; i < radlen; i++, l = l->radial_next) {
- BMESH_ASSERT(l->e == ne);
+ /* verify loop->v and loop->next->v pointers for e_new */
+ for (i = 0, l = e_new->l; i < radlen; i++, l = l->radial_next) {
+ BMESH_ASSERT(l->e == e_new);
// BMESH_ASSERT(l->radial_next == l);
BMESH_ASSERT(!(l->prev->e != e && l->next->e != e));
- edok = bmesh_verts_in_edge(l->v, l->next->v, ne);
+ edok = bmesh_verts_in_edge(l->v, l->next->v, e_new);
BMESH_ASSERT(edok != false);
BMESH_ASSERT(l->v != l->next->v);
BMESH_ASSERT(l->e != l->next->e);
@@ -1494,20 +1494,20 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
}
}
- BM_CHECK_ELEMENT(ne);
- BM_CHECK_ELEMENT(nv);
- BM_CHECK_ELEMENT(ov);
+ BM_CHECK_ELEMENT(e_new);
+ BM_CHECK_ELEMENT(v_new);
+ BM_CHECK_ELEMENT(v_old);
BM_CHECK_ELEMENT(e);
BM_CHECK_ELEMENT(tv);
- if (r_e) *r_e = ne;
- return nv;
+ if (r_e) *r_e = e_new;
+ return v_new;
}
/**
* \brief Join Edge Kill Vert (JEKV)
*
- * Takes an edge \a ke and pointer to one of its vertices \a kv
+ * Takes an edge \a e_kill and pointer to one of its vertices \a v_kill
* and collapses the edge on that vertex.
*
* \par Examples:
@@ -1535,25 +1535,25 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e)
* faces with just 2 edges. It is up to the caller to decide what to do with
* these faces.
*/
-BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_double)
+BMEdge *bmesh_jekv(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool check_edge_double)
{
- BMEdge *oe;
- BMVert *ov, *tv;
- BMLoop *killoop, *l;
+ BMEdge *e_old;
+ BMVert *v_old, *tv;
+ BMLoop *l_kill, *l;
int len, radlen = 0, i, valence1, valence2;
bool edok, halt = false;
- if (bmesh_vert_in_edge(ke, kv) == 0) {
+ if (bmesh_vert_in_edge(e_kill, v_kill) == 0) {
return NULL;
}
- len = bmesh_disk_count(kv);
+ len = bmesh_disk_count(v_kill);
if (len == 2) {
- oe = bmesh_disk_edge_next(ke, kv);
- tv = bmesh_edge_other_vert_get(ke, kv);
- ov = bmesh_edge_other_vert_get(oe, kv);
- halt = bmesh_verts_in_edge(kv, tv, oe); /* check for double edges */
+ e_old = bmesh_disk_edge_next(e_kill, v_kill);
+ tv = bmesh_edge_other_vert_get(e_kill, v_kill);
+ v_old = bmesh_edge_other_vert_get(e_old, v_kill);
+ halt = bmesh_verts_in_edge(v_kill, tv, e_old); /* check for double edges */
if (halt) {
return NULL;
@@ -1561,56 +1561,56 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_doub
else {
BMEdge *e_splice;
- /* For verification later, count valence of ov and tv */
- valence1 = bmesh_disk_count(ov);
+ /* For verification later, count valence of v_old and tv */
+ valence1 = bmesh_disk_count(v_old);
valence2 = bmesh_disk_count(tv);
if (check_edge_double) {
- e_splice = BM_edge_exists(tv, ov);
+ e_splice = BM_edge_exists(tv, v_old);
}
- /* remove oe from kv's disk cycle */
- bmesh_disk_edge_remove(oe, kv);
- /* relink oe->kv to be oe->tv */
- bmesh_edge_swapverts(oe, kv, tv);
- /* append oe to tv's disk cycle */
- bmesh_disk_edge_append(oe, tv);
- /* remove ke from tv's disk cycle */
- bmesh_disk_edge_remove(ke, tv);
-
- /* deal with radial cycle of ke */
- radlen = bmesh_radial_length(ke->l);
- if (ke->l) {
- /* first step, fix the neighboring loops of all loops in ke's radial cycle */
- for (i = 0, killoop = ke->l; i < radlen; i++, killoop = killoop->radial_next) {
+ /* remove e_old from v_kill's disk cycle */
+ bmesh_disk_edge_remove(e_old, v_kill);
+ /* relink e_old->v_kill to be e_old->tv */
+ bmesh_edge_swapverts(e_old, v_kill, tv);
+ /* append e_old to tv's disk cycle */
+ bmesh_disk_edge_append(e_old, tv);
+ /* remove e_kill from tv's disk cycle */
+ bmesh_disk_edge_remove(e_kill, tv);
+
+ /* deal with radial cycle of e_kill */
+ radlen = bmesh_radial_length(e_kill->l);
+ if (e_kill->l) {
+ /* first step, fix the neighboring loops of all loops in e_kill's radial cycle */
+ for (i = 0, l_kill = e_kill->l; i < radlen; i++, l_kill = l_kill->radial_next) {
/* relink loops and fix vertex pointer */
- if (killoop->next->v == kv) {
- killoop->next->v = tv;
+ if (l_kill->next->v == v_kill) {
+ l_kill->next->v = tv;
}
- killoop->next->prev = killoop->prev;
- killoop->prev->next = killoop->next;
- if (BM_FACE_FIRST_LOOP(killoop->f) == killoop) {
- BM_FACE_FIRST_LOOP(killoop->f) = killoop->next;
+ l_kill->next->prev = l_kill->prev;
+ l_kill->prev->next = l_kill->next;
+ if (BM_FACE_FIRST_LOOP(l_kill->f) == l_kill) {
+ BM_FACE_FIRST_LOOP(l_kill->f) = l_kill->next;
}
- killoop->next = NULL;
- killoop->prev = NULL;
+ l_kill->next = NULL;
+ l_kill->prev = NULL;
/* fix len attribute of face */
- killoop->f->len--;
+ l_kill->f->len--;
}
- /* second step, remove all the hanging loops attached to ke */
- radlen = bmesh_radial_length(ke->l);
+ /* second step, remove all the hanging loops attached to e_kill */
+ radlen = bmesh_radial_length(e_kill->l);
if (LIKELY(radlen)) {
BMLoop **loops = BLI_array_alloca(loops, radlen);
- killoop = ke->l;
+ l_kill = e_kill->l;
/* this should be wrapped into a bme_free_radial function to be used by bmesh_KF as well... */
for (i = 0; i < radlen; i++) {
- loops[i] = killoop;
- killoop = killoop->radial_next;
+ loops[i] = l_kill;
+ l_kill = l_kill->radial_next;
}
for (i = 0; i < radlen; i++) {
bm->totloop--;
@@ -1618,27 +1618,27 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_doub
}
}
- /* Validate radial cycle of oe */
- edok = bmesh_radial_validate(radlen, oe->l);
+ /* Validate radial cycle of e_old */
+ edok = bmesh_radial_validate(radlen, e_old->l);
BMESH_ASSERT(edok != false);
}
/* deallocate edge */
- bm_kill_only_edge(bm, ke);
+ bm_kill_only_edge(bm, e_kill);
/* deallocate vertex */
- bm_kill_only_vert(bm, kv);
+ bm_kill_only_vert(bm, v_kill);
- /* Validate disk cycle lengths of ov, tv are unchanged */
- edok = bmesh_disk_validate(valence1, ov->e, ov);
+ /* Validate disk cycle lengths of v_old, tv are unchanged */
+ edok = bmesh_disk_validate(valence1, v_old->e, v_old);
BMESH_ASSERT(edok != false);
edok = bmesh_disk_validate(valence2, tv->e, tv);
BMESH_ASSERT(edok != false);
- /* Validate loop cycle of all faces attached to 'oe' */
- for (i = 0, l = oe->l; i < radlen; i++, l = l->radial_next) {
- BMESH_ASSERT(l->e == oe);
- edok = bmesh_verts_in_edge(l->v, l->next->v, oe);
+ /* Validate loop cycle of all faces attached to 'e_old' */
+ for (i = 0, l = e_old->l; i < radlen; i++, l = l->radial_next) {
+ BMESH_ASSERT(l->e == e_old);
+ edok = bmesh_verts_in_edge(l->v, l->next->v, e_old);
BMESH_ASSERT(edok != false);
edok = bmesh_loop_validate(l->f);
BMESH_ASSERT(edok != false);
@@ -1652,15 +1652,15 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_doub
if (check_edge_double) {
if (e_splice) {
/* removes e_splice */
- BM_edge_splice(bm, e_splice, oe);
+ BM_edge_splice(bm, e_splice, e_old);
}
}
- BM_CHECK_ELEMENT(ov);
+ BM_CHECK_ELEMENT(v_old);
BM_CHECK_ELEMENT(tv);
- BM_CHECK_ELEMENT(oe);
+ BM_CHECK_ELEMENT(e_old);
- return oe;
+ return e_old;
}
}
return NULL;
@@ -1699,7 +1699,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_doub
*/
BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
{
- BMLoop *l_iter, *f1loop = NULL, *f2loop = NULL;
+ BMLoop *l_iter, *l_f1 = NULL, *l_f2 = NULL;
int newlen = 0, i, f1len = 0, f2len = 0, edok;
/* can't join a face to itself */
@@ -1716,23 +1716,23 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
f1len = f1->len;
f2len = f2->len;
- if (!((f1loop = BM_face_edge_share_loop(f1, e)) &&
- (f2loop = BM_face_edge_share_loop(f2, e))))
+ if (!((l_f1 = BM_face_edge_share_loop(f1, e)) &&
+ (l_f2 = BM_face_edge_share_loop(f2, e))))
{
return NULL;
}
/* validate direction of f2's loop cycle is compatible */
- if (f1loop->v == f2loop->v) {
+ if (l_f1->v == l_f2->v) {
return NULL;
}
/* validate that for each face, each vertex has another edge in its disk cycle that is
* not e, and not shared. */
- if (bmesh_radial_face_find(f1loop->next->e, f2) ||
- bmesh_radial_face_find(f1loop->prev->e, f2) ||
- bmesh_radial_face_find(f2loop->next->e, f1) ||
- bmesh_radial_face_find(f2loop->prev->e, f1) )
+ if (bmesh_radial_face_find(l_f1->next->e, f2) ||
+ bmesh_radial_face_find(l_f1->prev->e, f2) ||
+ bmesh_radial_face_find(l_f2->next->e, f1) ||
+ bmesh_radial_face_find(l_f2->prev->e, f1) )
{
return NULL;
}
@@ -1751,12 +1751,12 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
}
for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f1); i < f1len; i++, l_iter = l_iter->next) {
- if (l_iter != f1loop) {
+ if (l_iter != l_f1) {
BM_elem_flag_enable(l_iter->v, BM_ELEM_INTERNAL_TAG);
}
}
for (i = 0, l_iter = BM_FACE_FIRST_LOOP(f2); i < f2len; i++, l_iter = l_iter->next) {
- if (l_iter != f2loop) {
+ if (l_iter != l_f2) {
/* as soon as a duplicate is found, bail out */
if (BM_elem_flag_test(l_iter->v, BM_ELEM_INTERNAL_TAG)) {
return NULL;
@@ -1765,15 +1765,15 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
}
/* join the two loop */
- f1loop->prev->next = f2loop->next;
- f2loop->next->prev = f1loop->prev;
+ l_f1->prev->next = l_f2->next;
+ l_f2->next->prev = l_f1->prev;
- f1loop->next->prev = f2loop->prev;
- f2loop->prev->next = f1loop->next;
+ l_f1->next->prev = l_f2->prev;
+ l_f2->prev->next = l_f1->next;
- /* if f1loop was baseloop, make f1loop->next the base. */
- if (BM_FACE_FIRST_LOOP(f1) == f1loop)
- BM_FACE_FIRST_LOOP(f1) = f1loop->next;
+ /* if l_f1 was baseloop, make l_f1->next the base. */
+ if (BM_FACE_FIRST_LOOP(f1) == l_f1)
+ BM_FACE_FIRST_LOOP(f1) = l_f1->next;
/* increase length of f1 */
f1->len += (f2->len - 2);
@@ -1784,18 +1784,18 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
l_iter->f = f1;
/* remove edge from the disk cycle of its two vertices */
- bmesh_disk_edge_remove(f1loop->e, f1loop->e->v1);
- bmesh_disk_edge_remove(f1loop->e, f1loop->e->v2);
+ bmesh_disk_edge_remove(l_f1->e, l_f1->e->v1);
+ bmesh_disk_edge_remove(l_f1->e, l_f1->e->v2);
/* deallocate edge and its two loops as well as f2 */
if (bm->etoolflagpool) {
- BLI_mempool_free(bm->etoolflagpool, f1loop->e->oflags);
+ BLI_mempool_free(bm->etoolflagpool, l_f1->e->oflags);
}
- BLI_mempool_free(bm->epool, f1loop->e);
+ BLI_mempool_free(bm->epool, l_f1->e);
bm->totedge--;
- BLI_mempool_free(bm->lpool, f1loop);
+ BLI_mempool_free(bm->lpool, l_f1);
bm->totloop--;
- BLI_mempool_free(bm->lpool, f2loop);
+ BLI_mempool_free(bm->lpool, l_f2);
bm->totloop--;
if (bm->ftoolflagpool) {
BLI_mempool_free(bm->ftoolflagpool, f2->oflags);
@@ -1889,7 +1889,7 @@ bool bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len
BMLoop *l;
BMEdge *e;
int i, maxindex;
- BMLoop *nl;
+ BMLoop *l_new;
visithash = BLI_ghash_ptr_new(__func__);
@@ -1908,9 +1908,9 @@ bool bmesh_vert_separate(BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len
BLI_ghash_insert(visithash, e, SET_INT_IN_POINTER(maxindex));
BM_ITER_ELEM (l, &liter, e, BM_LOOPS_OF_EDGE) {
- nl = (l->v == v) ? l->prev : l->next;
- if (!BLI_ghash_haskey(visithash, nl->e)) {
- BLI_array_append(stack, nl->e);
+ l_new = (l->v == v) ? l->prev : l->next;
+ if (!BLI_ghash_haskey(visithash, l_new->e)) {
+ BLI_array_append(stack, l_new->e);
}
}
}
@@ -2072,7 +2072,7 @@ bool BM_edge_splice(BMesh *bm, BMEdge *e, BMEdge *e_target)
*/
bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
{
- BMEdge *ne;
+ BMEdge *e_new;
int radlen;
BLI_assert(l_sep->e == e);
@@ -2088,15 +2088,15 @@ bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
e->l = l_sep->radial_next;
}
- ne = BM_edge_create(bm, e->v1, e->v2, e, 0);
+ e_new = BM_edge_create(bm, e->v1, e->v2, e, 0);
bmesh_radial_loop_remove(l_sep, e);
- bmesh_radial_append(ne, l_sep);
- l_sep->e = ne;
+ bmesh_radial_append(e_new, l_sep);
+ l_sep->e = e_new;
BLI_assert(bmesh_radial_length(e->l) == radlen - 1);
- BLI_assert(bmesh_radial_length(ne->l) == 1);
+ BLI_assert(bmesh_radial_length(e_new->l) == 1);
- BM_CHECK_ELEMENT(ne);
+ BM_CHECK_ELEMENT(e_new);
BM_CHECK_ELEMENT(e);
return true;
@@ -2105,57 +2105,57 @@ bool bmesh_edge_separate(BMesh *bm, BMEdge *e, BMLoop *l_sep)
/**
* \brief Un-glue Region Make Vert (URMV)
*
- * Disconnects a face from its vertex fan at loop \a sl
+ * Disconnects a face from its vertex fan at loop \a l_sep
*
* \return The newly created BMVert
*/
-BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl)
+BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep)
{
BMVert **vtar;
int len, i;
- BMVert *nv = NULL;
- BMVert *sv = sl->v;
+ BMVert *v_new = NULL;
+ BMVert *v_sep = l_sep->v;
/* peel the face from the edge radials on both sides of the
* loop vert, disconnecting the face from its fan */
- bmesh_edge_separate(bm, sl->e, sl);
- bmesh_edge_separate(bm, sl->prev->e, sl->prev);
+ bmesh_edge_separate(bm, l_sep->e, l_sep);
+ bmesh_edge_separate(bm, l_sep->prev->e, l_sep->prev);
- if (bmesh_disk_count(sv) == 2) {
- /* If there are still only two edges out of sv, then
+ if (bmesh_disk_count(v_sep) == 2) {
+ /* If there are still only two edges out of v_sep, then
* this whole URMV was just a no-op, so exit now. */
- return sv;
+ return v_sep;
}
/* Update the disk start, so that v->e points to an edge
* not touching the split loop. This is so that BM_vert_split
- * will leave the original sv on some *other* fan (not the
+ * will leave the original v_sep on some *other* fan (not the
* one-face fan that holds the unglue face). */
- while (sv->e == sl->e || sv->e == sl->prev->e) {
- sv->e = bmesh_disk_edge_next(sv->e, sv);
+ while (v_sep->e == l_sep->e || v_sep->e == l_sep->prev->e) {
+ v_sep->e = bmesh_disk_edge_next(v_sep->e, v_sep);
}
/* Split all fans connected to the vert, duplicating it for
* each fans. */
- bmesh_vert_separate(bm, sv, &vtar, &len);
+ bmesh_vert_separate(bm, v_sep, &vtar, &len);
/* There should have been at least two fans cut apart here,
* otherwise the early exit would have kicked in. */
BLI_assert(len >= 2);
- nv = sl->v;
+ v_new = l_sep->v;
/* Desired result here is that a new vert should always be
* created for the unglue face. This is so we can glue any
* extras back into the original vert. */
- BLI_assert(nv != sv);
- BLI_assert(sv == vtar[0]);
+ BLI_assert(v_new != v_sep);
+ BLI_assert(v_sep == vtar[0]);
/* If there are more than two verts as a result, glue together
* all the verts except the one this URMV intended to create */
if (len > 2) {
for (i = 0; i < len; i++) {
- if (vtar[i] == nv) {
+ if (vtar[i] == v_new) {
break;
}
}
@@ -2174,18 +2174,18 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl)
MEM_freeN(vtar);
- return nv;
+ return v_new;
}
/**
* \brief Unglue Region Make Vert (URMV)
*
- * Disconnects sf from the vertex fan at \a sv
+ * Disconnects f_sep from the vertex fan at \a v_sep
*
* \return The newly created BMVert
*/
-BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv)
+BMVert *bmesh_urmv(BMesh *bm, BMFace *f_sep, BMVert *v_sep)
{
- BMLoop *l = BM_face_vert_share_loop(sf, sv);
+ BMLoop *l = BM_face_vert_share_loop(f_sep, v_sep);
return bmesh_urmv_loop(bm, l);
}
diff --git a/source/blender/bmesh/intern/bmesh_core.h b/source/blender/bmesh/intern/bmesh_core.h
index d8cfc973394..a1f378aaa5d 100644
--- a/source/blender/bmesh/intern/bmesh_core.h
+++ b/source/blender/bmesh/intern/bmesh_core.h
@@ -73,9 +73,9 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1,
);
BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e);
-BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const bool check_edge_splice);
+BMEdge *bmesh_jekv(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool check_edge_splice);
BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e);
-BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv);
-BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl);
+BMVert *bmesh_urmv(BMesh *bm, BMFace *f_sep, BMVert *v_sep);
+BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep);
#endif /* __BMESH_CORE_H__ */
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c
index 44b8baace4c..d0ab0ea5d60 100644
--- a/source/blender/bmesh/intern/bmesh_interp.c
+++ b/source/blender/bmesh/intern/bmesh_interp.c
@@ -126,7 +126,7 @@ void BM_data_interp_face_vert_edge(BMesh *bm, BMVert *v1, BMVert *UNUSED(v2), BM
{
void *src[2];
float w[2];
- BMLoop *v1loop = NULL, *vloop = NULL, *v2loop = NULL;
+ BMLoop *l_v1 = NULL, *l_v = NULL, *l_v2 = NULL;
BMLoop *l_iter = NULL;
if (!e1->l) {
@@ -139,23 +139,23 @@ void BM_data_interp_face_vert_edge(BMesh *bm, BMVert *v1, BMVert *UNUSED(v2), BM
l_iter = e1->l;
do {
if (l_iter->v == v1) {
- v1loop = l_iter;
- vloop = v1loop->next;
- v2loop = vloop->next;
+ l_v1 = l_iter;
+ l_v = l_v1->next;
+ l_v2 = l_v->next;
}
else if (l_iter->v == v) {
- v1loop = l_iter->next;
- vloop = l_iter;
- v2loop = l_iter->prev;
+ l_v1 = l_iter->next;
+ l_v = l_iter;
+ l_v2 = l_iter->prev;
}
- if (!v1loop || !v2loop)
+ if (!l_v1 || !l_v2)
return;
- src[0] = v1loop->head.data;
- src[1] = v2loop->head.data;
+ src[0] = l_v1->head.data;
+ src[1] = l_v2->head.data;
- CustomData_bmesh_interp(&bm->ldata, src, w, NULL, 2, vloop->head.data);
+ CustomData_bmesh_interp(&bm->ldata, src, w, NULL, 2, l_v->head.data);
} while ((l_iter = l_iter->radial_next) != e1->l);
}
diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c
index d98598cac89..afb3fc8112c 100644
--- a/source/blender/bmesh/intern/bmesh_mods.c
+++ b/source/blender/bmesh/intern/bmesh_mods.c
@@ -300,14 +300,14 @@ BMEdge *BM_verts_connect(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f)
BM_ITER_ELEM (f_iter, &fiter, v1, BM_FACES_OF_VERT) {
BM_ITER_ELEM (v_iter, &viter, f_iter, BM_FACES_OF_VERT) {
if (v_iter == v2) {
- BMLoop *nl;
+ BMLoop *l_new;
- f_iter = BM_face_split(bm, f_iter, v1, v2, &nl, NULL, false);
+ f_iter = BM_face_split(bm, f_iter, v1, v2, &l_new, NULL, false);
if (r_f) {
*r_f = f_iter;
}
- return nl->e;
+ return l_new->e;
}
}
}
@@ -339,51 +339,51 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
BMEdge *example, const bool no_double)
{
const bool has_mdisp = CustomData_has_layer(&bm->ldata, CD_MDISPS);
- BMFace *nf, *of;
+ BMFace *f_new, *f_tmp;
BLI_assert(v1 != v2);
/* do we have a multires layer? */
if (has_mdisp) {
- of = BM_face_copy(bm, f, false, false);
+ f_tmp = BM_face_copy(bm, f, false, false);
}
#ifdef USE_BMESH_HOLES
- nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, no_double);
+ f_new = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, no_double);
#else
- nf = bmesh_sfme(bm, f, v1, v2, r_l, example, no_double);
+ f_new = bmesh_sfme(bm, f, v1, v2, r_l, example, no_double);
#endif
- if (nf) {
- BM_elem_attrs_copy(bm, bm, f, nf);
- copy_v3_v3(nf->no, f->no);
+ if (f_new) {
+ BM_elem_attrs_copy(bm, bm, f, f_new);
+ copy_v3_v3(f_new->no, f->no);
/* handle multires update */
- if (has_mdisp && (nf != f)) {
+ if (has_mdisp && (f_new != f)) {
BMLoop *l_iter;
BMLoop *l_first;
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
do {
- BM_loop_interp_multires(bm, l_iter, of);
+ BM_loop_interp_multires(bm, l_iter, f_tmp);
} while ((l_iter = l_iter->next) != l_first);
- l_iter = l_first = BM_FACE_FIRST_LOOP(nf);
+ l_iter = l_first = BM_FACE_FIRST_LOOP(f_new);
do {
- BM_loop_interp_multires(bm, l_iter, of);
+ BM_loop_interp_multires(bm, l_iter, f_tmp);
} while ((l_iter = l_iter->next) != l_first);
- BM_face_kill(bm, of);
+ BM_face_kill(bm, f_tmp);
#if 0
/* BM_face_multires_bounds_smooth doesn't flip displacement correct */
BM_face_multires_bounds_smooth(bm, f);
- BM_face_multires_bounds_smooth(bm, nf);
+ BM_face_multires_bounds_smooth(bm, f_new);
#endif
}
}
- return nf;
+ return f_new;
}
/**
@@ -406,62 +406,62 @@ BMFace *BM_face_split(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, BMLoop **r_l
BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[][3], int n,
BMLoop **r_l, BMEdge *example)
{
- BMFace *nf, *of;
+ BMFace *f_new, *f_tmp;
BMLoop *l_dummy;
- BMEdge *e, *newe;
- BMVert *newv;
+ BMEdge *e, *e_new;
+ BMVert *v_new;
int i, j;
BLI_assert(v1 != v2);
- of = BM_face_copy(bm, f, true, true);
+ f_tmp = BM_face_copy(bm, f, true, true);
if (!r_l)
r_l = &l_dummy;
#ifdef USE_BMESH_HOLES
- nf = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, false);
+ f_new = bmesh_sfme(bm, f, v1, v2, r_l, NULL, example, false);
#else
- nf = bmesh_sfme(bm, f, v1, v2, r_l, example, false);
+ f_new = bmesh_sfme(bm, f, v1, v2, r_l, example, false);
#endif
- /* bmesh_sfme returns in r_l a Loop for nf going from v1 to v2.
+ /* bmesh_sfme returns in r_l a Loop for f_new going from v1 to v2.
* The radial_next is for f and goes from v2 to v1 */
- if (nf) {
- BM_elem_attrs_copy(bm, bm, f, nf);
- copy_v3_v3(nf->no, f->no);
+ if (f_new) {
+ BM_elem_attrs_copy(bm, bm, f, f_new);
+ copy_v3_v3(f_new->no, f->no);
e = (*r_l)->e;
for (i = 0; i < n; i++) {
- newv = bmesh_semv(bm, v2, e, &newe);
- BLI_assert(newv != NULL);
- /* bmesh_semv returns in newe the edge going from newv to tv */
- copy_v3_v3(newv->co, cos[i]);
+ v_new = bmesh_semv(bm, v2, e, &e_new);
+ BLI_assert(v_new != NULL);
+ /* bmesh_semv returns in e_new the edge going from v_new to tv */
+ copy_v3_v3(v_new->co, cos[i]);
- /* interpolate the loop data for the loops with (v == newv), using orig face */
+ /* interpolate the loop data for the loops with (v == v_new), using orig face */
for (j = 0; j < 2; j++) {
- BMEdge *e_iter = (j == 0) ? e : newe;
+ BMEdge *e_iter = (j == 0) ? e : e_new;
BMLoop *l_iter = e_iter->l;
do {
- if (l_iter->v == newv) {
+ if (l_iter->v == v_new) {
/* this interpolates both loop and vertex data */
- BM_loop_interp_from_face(bm, l_iter, of, true, true);
+ BM_loop_interp_from_face(bm, l_iter, f_tmp, true, true);
}
} while ((l_iter = l_iter->radial_next) != e_iter->l);
}
- e = newe;
+ e = e_new;
}
}
- BM_face_verts_kill(bm, of);
+ BM_face_verts_kill(bm, f_tmp);
- return nf;
+ return f_new;
}
/**
* \brief Vert Collapse Faces
*
- * Collapses vertex \a kv that has only two manifold edges
+ * Collapses vertex \a v_kill that has only two manifold edges
* onto a vertex it shares an edge with.
* \a fac defines the amount of interpolation for Custom Data.
*
@@ -472,8 +472,8 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[
* Except this takes a factor and merges custom data.
*
* \param bm The bmesh
- * \param ke The edge to collapse
- * \param kv The vertex to collapse into the edge
+ * \param e_kill The edge to collapse
+ * \param v_kill The vertex to collapse into the edge
* \param fac The factor along the edge
* \param join_faces When true the faces around the vertex will be joined
* otherwise collapse the vertex by merging the 2 edges this vert touches into one.
@@ -481,11 +481,11 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, float cos[
*
* \returns The New Edge
*/
-BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
+BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, float fac,
const bool join_faces, const bool kill_degenerate_faces)
{
- BMEdge *ne = NULL;
- BMVert *tv = bmesh_edge_other_vert_get(ke, kv);
+ BMEdge *e_new = NULL;
+ BMVert *tv = bmesh_edge_other_vert_get(e_kill, v_kill);
BMEdge *e2;
BMVert *tv2;
@@ -497,17 +497,17 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
float w[2];
/* Only intended to be called for 2-valence vertices */
- BLI_assert(bmesh_disk_count(kv) <= 2);
+ BLI_assert(bmesh_disk_count(v_kill) <= 2);
/* first modify the face loop data */
w[0] = 1.0f - fac;
w[1] = fac;
- if (ke->l) {
- l_iter = ke->l;
+ if (e_kill->l) {
+ l_iter = e_kill->l;
do {
- if (l_iter->v == tv && l_iter->next->v == kv) {
+ if (l_iter->v == tv && l_iter->next->v == v_kill) {
tvloop = l_iter;
kvloop = l_iter->next;
@@ -515,30 +515,30 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
src[1] = tvloop->head.data;
CustomData_bmesh_interp(&bm->ldata, src, w, NULL, 2, kvloop->head.data);
}
- } while ((l_iter = l_iter->radial_next) != ke->l);
+ } while ((l_iter = l_iter->radial_next) != e_kill->l);
}
/* now interpolate the vertex data */
- BM_data_interp_from_verts(bm, kv, tv, kv, fac);
+ BM_data_interp_from_verts(bm, v_kill, tv, v_kill, fac);
- e2 = bmesh_disk_edge_next(ke, kv);
- tv2 = BM_edge_other_vert(e2, kv);
+ e2 = bmesh_disk_edge_next(e_kill, v_kill);
+ tv2 = BM_edge_other_vert(e2, v_kill);
if (join_faces) {
BMFace **faces = NULL;
BMFace *f;
BLI_array_staticdeclare(faces, 8);
- BM_ITER_ELEM (f, &iter, kv, BM_FACES_OF_VERT) {
+ BM_ITER_ELEM (f, &iter, v_kill, BM_FACES_OF_VERT) {
BLI_array_append(faces, f);
}
if (BLI_array_count(faces) >= 2) {
BMFace *f2 = BM_faces_join(bm, faces, BLI_array_count(faces), true);
if (f2) {
- BMLoop *nl = NULL;
- if (BM_face_split(bm, f2, tv, tv2, &nl, NULL, false)) {
- ne = nl->e;
+ BMLoop *l_new = NULL;
+ if (BM_face_split(bm, f2, tv, tv2, &l_new, NULL, false)) {
+ e_new = l_new->e;
}
}
}
@@ -549,16 +549,16 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
/* single face or no faces */
/* same as BM_vert_collapse_edge() however we already
* have vars to perform this operation so don't call. */
- ne = bmesh_jekv(bm, ke, kv, true);
- /* ne = BM_edge_exists(tv, tv2); */ /* same as return above */
+ e_new = bmesh_jekv(bm, e_kill, v_kill, true);
+ /* e_new = BM_edge_exists(tv, tv2); */ /* same as return above */
- if (ne && kill_degenerate_faces) {
+ if (e_new && kill_degenerate_faces) {
BLI_array_declare(bad_faces);
BMFace **bad_faces = NULL;
BMIter fiter;
BMFace *f;
- BMVert *verts[2] = {ne->v1, ne->v2};
+ BMVert *verts[2] = {e_new->v1, e_new->v2};
int i;
for (i = 0; i < 2; i++) {
@@ -577,7 +577,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
}
}
- return ne;
+ return e_new;
}
@@ -588,37 +588,37 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
*
* \return The New Edge
*/
-BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
+BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill,
const bool kill_degenerate_faces)
{
/* nice example implementation but we want loops to have their customdata
* accounted for */
#if 0
- BMEdge *ne = NULL;
+ BMEdge *e_new = NULL;
/* Collapse between 2 edges */
/* in this case we want to keep all faces and not join them,
* rather just get rid of the vertex - see bug [#28645] */
- BMVert *tv = bmesh_edge_other_vert_get(ke, kv);
+ BMVert *tv = bmesh_edge_other_vert_get(e_kill, v_kill);
if (tv) {
- BMEdge *e2 = bmesh_disk_edge_next(ke, kv);
+ BMEdge *e2 = bmesh_disk_edge_next(e_kill, v_kill);
if (e2) {
- BMVert *tv2 = BM_edge_other_vert(e2, kv);
+ BMVert *tv2 = BM_edge_other_vert(e2, v_kill);
if (tv2) {
/* only action, other calls here only get the edge to return */
- ne = bmesh_jekv(bm, ke, kv);
+ e_new = bmesh_jekv(bm, e_kill, v_kill);
- /* ne = BM_edge_exists(tv, tv2); */ /* same as return above */
+ /* e_new = BM_edge_exists(tv, tv2); */ /* same as return above */
}
}
}
- return ne;
+ return e_new;
#else
/* with these args faces are never joined, same as above
* but account for loop customdata */
- return BM_vert_collapse_faces(bm, ke, kv, 1.0f, false, kill_degenerate_faces);
+ return BM_vert_collapse_faces(bm, e_kill, v_kill, 1.0f, false, kill_degenerate_faces);
#endif
}
@@ -637,7 +637,7 @@ BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
*/
BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float percent)
{
- BMVert *nv, *v2;
+ BMVert *v_new, *v2;
BMFace **oldfaces = NULL;
BMEdge *e_dummy;
BLI_array_staticdeclare(oldfaces, 32);
@@ -668,21 +668,21 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
}
v2 = bmesh_edge_other_vert_get(e, v);
- nv = bmesh_semv(bm, v, e, r_e);
+ v_new = bmesh_semv(bm, v, e, r_e);
- BLI_assert(nv != NULL);
+ BLI_assert(v_new != NULL);
- sub_v3_v3v3(nv->co, v2->co, v->co);
- madd_v3_v3v3fl(nv->co, v->co, nv->co, percent);
+ sub_v3_v3v3(v_new->co, v2->co, v->co);
+ madd_v3_v3v3fl(v_new->co, v->co, v_new->co, percent);
if (r_e) {
(*r_e)->head.hflag = e->head.hflag;
BM_elem_attrs_copy(bm, bm, e, *r_e);
}
- /* v->nv->v2 */
- BM_data_interp_face_vert_edge(bm, v2, v, nv, e, percent);
- BM_data_interp_from_verts(bm, v, v2, nv, percent);
+ /* v->v_new->v2 */
+ BM_data_interp_face_vert_edge(bm, v2, v, v_new, e, percent);
+ BM_data_interp_from_verts(bm, v, v2, v_new, percent);
if (do_mdisp) {
int i, j;
@@ -742,7 +742,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce
BLI_array_free(oldfaces);
}
- return nv;
+ return v_new;
}
/**
@@ -752,13 +752,13 @@ BMVert *BM_edge_split_n(BMesh *bm, BMEdge *e, int numcuts)
{
int i;
float percent;
- BMVert *nv = NULL;
+ BMVert *v_new = NULL;
for (i = 0; i < numcuts; i++) {
percent = 1.0f / (float)(numcuts + 1 - i);
- nv = BM_edge_split(bm, e, e->v2, NULL, percent);
+ v_new = BM_edge_split(bm, e, e->v2, NULL, percent);
}
- return nv;
+ return v_new;
}
#if 0
diff --git a/source/blender/bmesh/intern/bmesh_mods.h b/source/blender/bmesh/intern/bmesh_mods.h
index 358268cb589..93d6ca10edb 100644
--- a/source/blender/bmesh/intern/bmesh_mods.h
+++ b/source/blender/bmesh/intern/bmesh_mods.h
@@ -47,9 +47,9 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f,
float cos[][3], int n,
BMLoop **r_l, BMEdge *example);
-BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
+BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, float fac,
const bool join_faces, const bool kill_degenerate_faces);
-BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
+BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill,
const bool kill_degenerate_faces);
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index 6c008dedd53..70df0b56607 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -680,7 +680,7 @@ bool BM_edge_is_wire(BMEdge *e)
*/
bool BM_vert_is_manifold(BMVert *v)
{
- BMEdge *e, *oe;
+ BMEdge *e, *e_old;
BMLoop *l;
int len, count, flag;
@@ -691,7 +691,7 @@ bool BM_vert_is_manifold(BMVert *v)
/* count edges while looking for non-manifold edges */
len = 0;
- oe = e = v->e;
+ e_old = e = v->e;
do {
/* loose edge or edge shared by more than two faces,
* edges with 1 face user are OK, otherwise we could
@@ -700,14 +700,14 @@ bool BM_vert_is_manifold(BMVert *v)
return false;
}
len++;
- } while ((e = bmesh_disk_edge_next(e, v)) != oe);
+ } while ((e = bmesh_disk_edge_next(e, v)) != e_old);
count = 1;
flag = 1;
e = NULL;
- oe = v->e;
- l = oe->l;
- while (e != oe) {
+ e_old = v->e;
+ l = e_old->l;
+ while (e != e_old) {
l = (l->v == v) ? l->prev : l->next;
e = l->e;
count++; /* count the edges */
@@ -716,13 +716,13 @@ bool BM_vert_is_manifold(BMVert *v)
/* we've hit the edge of an open mesh, reset once */
flag = 0;
count = 1;
- oe = e;
+ e_old = e;
e = NULL;
- l = oe->l;
+ l = e_old->l;
}
else if (l->radial_next == l) {
/* break the loop */
- e = oe;
+ e = e_old;
}
else {
l = l->radial_next;
diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c
index 2f568a498c5..0398f9c558f 100644
--- a/source/blender/bmesh/intern/bmesh_structure.c
+++ b/source/blender/bmesh/intern/bmesh_structure.c
@@ -63,15 +63,15 @@ BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v)
return NULL;
}
-bool bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv)
+bool bmesh_edge_swapverts(BMEdge *e, BMVert *v_orig, BMVert *v_new)
{
- if (e->v1 == orig) {
- e->v1 = newv;
+ if (e->v1 == v_orig) {
+ e->v1 = v_new;
e->v1_disk_link.next = e->v1_disk_link.prev = NULL;
return true;
}
- else if (e->v2 == orig) {
- e->v2 = newv;
+ else if (e->v2 == v_orig) {
+ e->v2 = v_new;
e->v2_disk_link.next = e->v2_disk_link.prev = NULL;
return true;
}
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index ac6d4089372..a50b708961c 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -163,7 +163,7 @@ static void *bmw_ShellWalker_step(BMWalker *walker)
static void *bmw_ShellWalker_step(BMWalker *walker)
{
BMEdge *curedge, *next = NULL;
- BMVert *ov = NULL;
+ BMVert *v_old = NULL;
bool restrictpass = true;
BMwShellWalker shellWalk = *((BMwShellWalker *)BMW_current_state(walker));
@@ -183,7 +183,7 @@ static void *bmw_ShellWalker_step(BMWalker *walker)
{
BMwShellWalker *newstate;
- ov = BM_edge_other_vert(curedge, shellWalk.base);
+ v_old = BM_edge_other_vert(curedge, shellWalk.base);
/* push a new state onto the stac */
newState = BMW_state_add(walker);
@@ -191,7 +191,7 @@ static void *bmw_ShellWalker_step(BMWalker *walker)
/* populate the new stat */
- newState->base = ov;
+ newState->base = v_old;
newState->curedge = curedge;
}
}
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index 329f3783085..498ef530a85 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -228,8 +228,8 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
BMO_ITER (e, &siter, op->slots_in, "edges", BM_EDGE) {
if (!BMO_elem_flag_test(bm, e, EDGE_DONE)) {
- BMVert *v, *ov;
- /* BMEdge *e2, *e3, *oe = e; */ /* UNUSED */
+ BMVert *v, *v_old;
+ /* BMEdge *e2, *e3, *e_old = e; */ /* UNUSED */
BMEdge *e2, *e3;
if (c > 2) {
@@ -265,7 +265,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
e2 = e;
e = e2;
- ov = v;
+ v_old = v;
do {
if (c == 0) {
BLI_array_append(ee1, e2);
@@ -301,7 +301,7 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
}
/* test for connected loops, and set cl1 or cl2 if so */
- if (v == ov) {
+ if (v == v_old) {
if (c == 0) {
cl1 = 1;
}
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c
index 7beac676868..8b65764fe1c 100644
--- a/source/blender/bmesh/operators/bmo_removedoubles.c
+++ b/source/blender/bmesh/operators/bmo_removedoubles.c
@@ -40,7 +40,7 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot
{
BMIter liter;
BMLoop *l;
- BMVert *v2, *doub;
+ BMVert *v2, *v_double;
bool split = false;
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
@@ -51,15 +51,15 @@ static void remdoubles_splitface(BMFace *f, BMesh *bm, BMOperator *op, BMOpSlot
(v2 != l->prev->v) &&
(v2 != l->next->v))
{
- doub = l->v;
+ v_double = l->v;
split = true;
break;
}
}
- if (split && doub != v2) {
- BMLoop *nl;
- BMFace *f2 = BM_face_split(bm, f, doub, v2, &nl, NULL, false);
+ if (split && v_double != v2) {
+ BMLoop *l_new;
+ BMFace *f2 = BM_face_split(bm, f, v_double, v2, &l_new, NULL, false);
remdoubles_splitface(f, bm, op, slot_targetmap);
remdoubles_splitface(f2, bm, op, slot_targetmap);
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index 36ad8ef506b..edd7b50b9a3 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -71,29 +71,29 @@
/* connects face with smallest len, which I think should always be correct for
* edge subdivision */
-static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_nf)
+static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace **r_f_new)
{
BMIter iter, iter2;
BMVert *v;
- BMLoop *nl;
- BMFace *face, *curf = NULL;
+ BMLoop *l_new;
+ BMFace *f, *f_cur = NULL;
/* this isn't the best thing in the world. it doesn't handle cases where there's
* multiple faces yet. that might require a convexity test to figure out which
* face is "best" and who knows what for non-manifold conditions. */
- for (face = BM_iter_new(&iter, bm, BM_FACES_OF_VERT, v1); face; face = BM_iter_step(&iter)) {
- for (v = BM_iter_new(&iter2, bm, BM_VERTS_OF_FACE, face); v; v = BM_iter_step(&iter2)) {
+ for (f = BM_iter_new(&iter, bm, BM_FACES_OF_VERT, v1); f; f = BM_iter_step(&iter)) {
+ for (v = BM_iter_new(&iter2, bm, BM_VERTS_OF_FACE, f); v; v = BM_iter_step(&iter2)) {
if (v == v2) {
- if (!curf || face->len < curf->len) curf = face;
+ if (!f_cur || f->len < f_cur->len) f_cur = f;
}
}
}
- if (curf) {
- face = BM_face_split(bm, curf, v1, v2, &nl, NULL, false);
+ if (f_cur) {
+ f = BM_face_split(bm, f_cur, v1, v2, &l_new, NULL, false);
- if (r_nf) *r_nf = face;
- return nl ? nl->e : NULL;
+ if (r_f_new) *r_f_new = f;
+ return l_new ? l_new->e : NULL;
}
return NULL;
@@ -242,31 +242,31 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge,
static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const SubDParams *params,
BMVert *vsta, BMVert *vend)
{
- BMEdge *eed = edge, *newe, temp = *edge;
- BMVert *v, ov1 = *edge->v1, ov2 = *edge->v2, *v1 = edge->v1, *v2 = edge->v2;
+ BMEdge *eed = edge, *e_new, e_tmp = *edge;
+ BMVert *v, v1_tmp = *edge->v1, v2_tmp = *edge->v2, *v1 = edge->v1, *v2 = edge->v2;
int i, numcuts = params->numcuts;
- temp.v1 = &ov1;
- temp.v2 = &ov2;
+ e_tmp.v1 = &v1_tmp;
+ e_tmp.v2 = &v2_tmp;
for (i = 0; i < numcuts; i++) {
- v = subdivideedgenum(bm, eed, &temp, i, params->numcuts, params, &newe, vsta, vend);
+ v = subdivideedgenum(bm, eed, &e_tmp, i, params->numcuts, params, &e_new, vsta, vend);
BMO_elem_flag_enable(bm, v, SUBD_SPLIT);
BMO_elem_flag_enable(bm, eed, SUBD_SPLIT);
- BMO_elem_flag_enable(bm, newe, SUBD_SPLIT);
+ BMO_elem_flag_enable(bm, e_new, SUBD_SPLIT);
BMO_elem_flag_enable(bm, v, ELE_SPLIT);
BMO_elem_flag_enable(bm, eed, ELE_SPLIT);
- BMO_elem_flag_enable(bm, newe, SUBD_SPLIT);
+ BMO_elem_flag_enable(bm, e_new, SUBD_SPLIT);
BM_CHECK_ELEMENT(v);
if (v->e) BM_CHECK_ELEMENT(v->e);
if (v->e && v->e->l) BM_CHECK_ELEMENT(v->e->l->f);
}
- alter_co(bm, v1, &temp, params, 0, &ov1, &ov2);
- alter_co(bm, v2, &temp, params, 1.0, &ov1, &ov2);
+ alter_co(bm, v1, &e_tmp, params, 0, &v1_tmp, &v2_tmp);
+ alter_co(bm, v2, &e_tmp, params, 1.0, &v1_tmp, &v2_tmp);
}
/* note: the patterns are rotated as necessary to
@@ -286,7 +286,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const SubDParams *par
static void quad_1edge_split(BMesh *bm, BMFace *UNUSED(face),
BMVert **verts, const SubDParams *params)
{
- BMFace *nf;
+ BMFace *f_new;
int i, add, numcuts = params->numcuts;
/* if it's odd, the middle face is a quad, otherwise it's a triangle */
@@ -296,16 +296,16 @@ static void quad_1edge_split(BMesh *bm, BMFace *UNUSED(face),
if (i == numcuts / 2) {
add -= 1;
}
- connect_smallest_face(bm, verts[i], verts[numcuts + add], &nf);
+ connect_smallest_face(bm, verts[i], verts[numcuts + add], &f_new);
}
}
else {
add = 2;
for (i = 0; i < numcuts; i++) {
- connect_smallest_face(bm, verts[i], verts[numcuts + add], &nf);
+ connect_smallest_face(bm, verts[i], verts[numcuts + add], &f_new);
if (i == numcuts / 2) {
add -= 1;
- connect_smallest_face(bm, verts[i], verts[numcuts + add], &nf);
+ connect_smallest_face(bm, verts[i], verts[numcuts + add], &f_new);
}
}
@@ -332,13 +332,13 @@ static const SubDPattern quad_1edge = {
static void quad_2edge_split_path(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
+ BMFace *f_new;
int i, numcuts = params->numcuts;
for (i = 0; i < numcuts; i++) {
- connect_smallest_face(bm, verts[i], verts[numcuts + (numcuts - i)], &nf);
+ connect_smallest_face(bm, verts[i], verts[numcuts + (numcuts - i)], &f_new);
}
- connect_smallest_face(bm, verts[numcuts * 2 + 3], verts[numcuts * 2 + 1], &nf);
+ connect_smallest_face(bm, verts[numcuts * 2 + 3], verts[numcuts * 2 + 1], &f_new);
}
static const SubDPattern quad_2edge_path = {
@@ -360,27 +360,27 @@ static const SubDPattern quad_2edge_path = {
static void quad_2edge_split_innervert(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
- BMVert *v, *lastv;
- BMEdge *e, *ne, olde;
+ BMFace *f_new;
+ BMVert *v, *v_last;
+ BMEdge *e, *e_new, e_tmp;
int i, numcuts = params->numcuts;
- lastv = verts[numcuts];
+ v_last = verts[numcuts];
for (i = numcuts - 1; i >= 0; i--) {
- e = connect_smallest_face(bm, verts[i], verts[numcuts + (numcuts - i)], &nf);
+ e = connect_smallest_face(bm, verts[i], verts[numcuts + (numcuts - i)], &f_new);
- olde = *e;
- v = bm_subdivide_edge_addvert(bm, e, &olde, params, 0.5f, 0.5f, &ne, e->v1, e->v2);
+ e_tmp = *e;
+ v = bm_subdivide_edge_addvert(bm, e, &e_tmp, params, 0.5f, 0.5f, &e_new, e->v1, e->v2);
if (i != numcuts - 1) {
- connect_smallest_face(bm, lastv, v, &nf);
+ connect_smallest_face(bm, v_last, v, &f_new);
}
- lastv = v;
+ v_last = v;
}
- connect_smallest_face(bm, lastv, verts[numcuts * 2 + 2], &nf);
+ connect_smallest_face(bm, v_last, verts[numcuts * 2 + 2], &f_new);
}
static const SubDPattern quad_2edge_innervert = {
@@ -402,15 +402,15 @@ static const SubDPattern quad_2edge_innervert = {
static void quad_2edge_split_fan(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
+ BMFace *f_new;
/* BMVert *v; */ /* UNUSED */
- /* BMVert *lastv = verts[2]; */ /* UNUSED */
- /* BMEdge *e, *ne; */ /* UNUSED */
+ /* BMVert *v_last = verts[2]; */ /* UNUSED */
+ /* BMEdge *e, *e_new; */ /* UNUSED */
int i, numcuts = params->numcuts;
for (i = 0; i < numcuts; i++) {
- connect_smallest_face(bm, verts[i], verts[numcuts * 2 + 2], &nf);
- connect_smallest_face(bm, verts[numcuts + (numcuts - i)], verts[numcuts * 2 + 2], &nf);
+ connect_smallest_face(bm, verts[i], verts[numcuts * 2 + 2], &f_new);
+ connect_smallest_face(bm, verts[numcuts + (numcuts - i)], verts[numcuts * 2 + 2], &f_new);
}
}
@@ -435,21 +435,21 @@ static const SubDPattern quad_2edge_fan = {
static void quad_3edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
+ BMFace *f_new;
int i, add = 0, numcuts = params->numcuts;
for (i = 0; i < numcuts; i++) {
if (i == numcuts / 2) {
if (numcuts % 2 != 0) {
- connect_smallest_face(bm, verts[numcuts - i - 1 + add], verts[i + numcuts + 1], &nf);
+ connect_smallest_face(bm, verts[numcuts - i - 1 + add], verts[i + numcuts + 1], &f_new);
}
add = numcuts * 2 + 2;
}
- connect_smallest_face(bm, verts[numcuts - i - 1 + add], verts[i + numcuts + 1], &nf);
+ connect_smallest_face(bm, verts[numcuts - i - 1 + add], verts[i + numcuts + 1], &f_new);
}
for (i = 0; i < numcuts / 2 + 1; i++) {
- connect_smallest_face(bm, verts[i], verts[(numcuts - i) + numcuts * 2 + 1], &nf);
+ connect_smallest_face(bm, verts[i], verts[(numcuts - i) + numcuts * 2 + 1], &f_new);
}
}
@@ -474,9 +474,9 @@ static const SubDPattern quad_3edge = {
static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
+ BMFace *f_new;
BMVert *v, *v1, *v2;
- BMEdge *e, *ne, temp;
+ BMEdge *e, *e_new, e_tmp;
BMVert **lines;
int numcuts = params->numcuts;
int i, j, a, b, s = numcuts + 2 /* , totv = numcuts * 4 + 4 */;
@@ -501,25 +501,25 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts
a = i;
b = numcuts + 1 + numcuts + 1 + (numcuts - i - 1);
- e = connect_smallest_face(bm, verts[a], verts[b], &nf);
+ e = connect_smallest_face(bm, verts[a], verts[b], &f_new);
if (!e)
continue;
BMO_elem_flag_enable(bm, e, ELE_INNER);
- BMO_elem_flag_enable(bm, nf, ELE_INNER);
+ BMO_elem_flag_enable(bm, f_new, ELE_INNER);
v1 = lines[(i + 1) * s] = verts[a];
v2 = lines[(i + 1) * s + s - 1] = verts[b];
- temp = *e;
+ e_tmp = *e;
for (a = 0; a < numcuts; a++) {
- v = subdivideedgenum(bm, e, &temp, a, numcuts, params, &ne,
+ v = subdivideedgenum(bm, e, &e_tmp, a, numcuts, params, &e_new,
v1, v2);
BMESH_ASSERT(v != NULL);
- BMO_elem_flag_enable(bm, ne, ELE_INNER);
+ BMO_elem_flag_enable(bm, e_new, ELE_INNER);
lines[(i + 1) * s + a + 1] = v;
}
}
@@ -528,12 +528,12 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts
for (j = 1; j < numcuts + 1; j++) {
a = i * s + j;
b = (i - 1) * s + j;
- e = connect_smallest_face(bm, lines[a], lines[b], &nf);
+ e = connect_smallest_face(bm, lines[a], lines[b], &f_new);
if (!e)
continue;
BMO_elem_flag_enable(bm, e, ELE_INNER);
- BMO_elem_flag_enable(bm, nf, ELE_INNER);
+ BMO_elem_flag_enable(bm, f_new, ELE_INNER);
}
}
@@ -555,11 +555,11 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts
static void tri_1edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
+ BMFace *f_new;
int i, numcuts = params->numcuts;
for (i = 0; i < numcuts; i++) {
- connect_smallest_face(bm, verts[i], verts[numcuts + 1], &nf);
+ connect_smallest_face(bm, verts[i], verts[numcuts + 1], &f_new);
}
}
@@ -584,9 +584,9 @@ static const SubDPattern tri_1edge = {
static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
const SubDParams *params)
{
- BMFace *nf;
- BMEdge *e, *ne, temp;
- BMVert ***lines, *v, ov1, ov2;
+ BMFace *f_new;
+ BMEdge *e, *e_new, e_tmp;
+ BMVert ***lines, *v, v1_tmp, v2_tmp;
void *stackarr[1];
int i, j, a, b, numcuts = params->numcuts;
@@ -607,26 +607,26 @@ static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
lines[i + 1] = MEM_callocN(sizeof(void *) * (2 + i), "triangle vert table row");
a = numcuts * 2 + 2 + i;
b = numcuts + numcuts - i;
- e = connect_smallest_face(bm, verts[a], verts[b], &nf);
+ e = connect_smallest_face(bm, verts[a], verts[b], &f_new);
if (!e) goto cleanup;
BMO_elem_flag_enable(bm, e, ELE_INNER);
- BMO_elem_flag_enable(bm, nf, ELE_INNER);
+ BMO_elem_flag_enable(bm, f_new, ELE_INNER);
lines[i + 1][0] = verts[a];
lines[i + 1][i + 1] = verts[b];
- temp = *e;
- ov1 = *verts[a];
- ov2 = *verts[b];
- temp.v1 = &ov1;
- temp.v2 = &ov2;
+ e_tmp = *e;
+ v1_tmp = *verts[a];
+ v2_tmp = *verts[b];
+ e_tmp.v1 = &v1_tmp;
+ e_tmp.v2 = &v2_tmp;
for (j = 0; j < i; j++) {
- v = subdivideedgenum(bm, e, &temp, j, i, params, &ne,
+ v = subdivideedgenum(bm, e, &e_tmp, j, i, params, &e_new,
verts[a], verts[b]);
lines[i + 1][j + 1] = v;
- BMO_elem_flag_enable(bm, ne, ELE_INNER);
+ BMO_elem_flag_enable(bm, e_new, ELE_INNER);
}
}
@@ -644,15 +644,15 @@ static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
*/
for (i = 1; i < numcuts + 1; i++) {
for (j = 0; j < i; j++) {
- e = connect_smallest_face(bm, lines[i][j], lines[i + 1][j + 1], &nf);
+ e = connect_smallest_face(bm, lines[i][j], lines[i + 1][j + 1], &f_new);
BMO_elem_flag_enable(bm, e, ELE_INNER);
- BMO_elem_flag_enable(bm, nf, ELE_INNER);
+ BMO_elem_flag_enable(bm, f_new, ELE_INNER);
- e = connect_smallest_face(bm, lines[i][j + 1], lines[i + 1][j + 1], &nf);
+ e = connect_smallest_face(bm, lines[i][j + 1], lines[i + 1][j + 1], &f_new);
BMO_elem_flag_enable(bm, e, ELE_INNER);
- BMO_elem_flag_enable(bm, nf, ELE_INNER);
+ BMO_elem_flag_enable(bm, f_new, ELE_INNER);
}
}
@@ -711,7 +711,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
BLI_array_declare(loops_split);
BMLoop **loops = NULL;
BLI_array_declare(loops);
- BMLoop *nl, *l;
+ BMLoop *l_new, *l;
BMFace *face;
BLI_array_declare(verts);
float smooth, fractal, along_normal;
@@ -820,9 +820,9 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
matched = 0;
totesel = 0;
- BM_ITER_ELEM_INDEX (nl, &liter, face, BM_LOOPS_OF_FACE, i) {
- edges[i] = nl->e;
- verts[i] = nl->v;
+ BM_ITER_ELEM_INDEX (l_new, &liter, face, BM_LOOPS_OF_FACE, i) {
+ edges[i] = l_new->e;
+ verts[i] = l_new->v;
if (BMO_elem_flag_test(bm, edges[i], SUBD_SPLIT)) {
if (!e1) e1 = edges[i];
@@ -1042,8 +1042,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
if (loops_split[j][0]) {
BLI_assert(BM_edge_exists(loops_split[j][0]->v, loops_split[j][1]->v) == NULL);
- /* BMFace *nf = */ /* UNUSED */
- BM_face_split(bm, face, loops_split[j][0]->v, loops_split[j][1]->v, &nl, NULL, false);
+ /* BMFace *f_new = */ /* UNUSED */
+ BM_face_split(bm, face, loops_split[j][0]->v, loops_split[j][1]->v, &l_new, NULL, false);
}
}
@@ -1054,8 +1054,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
}
a = 0;
- BM_ITER_ELEM_INDEX (nl, &liter, face, BM_LOOPS_OF_FACE, j) {
- if (nl->v == facedata[i].start) {
+ BM_ITER_ELEM_INDEX (l_new, &liter, face, BM_LOOPS_OF_FACE, j) {
+ if (l_new->v == facedata[i].start) {
a = j + 1;
break;
}
@@ -1063,9 +1063,9 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
BLI_array_grow_items(verts, face->len);
- BM_ITER_ELEM_INDEX (nl, &liter, face, BM_LOOPS_OF_FACE, j) {
+ BM_ITER_ELEM_INDEX (l_new, &liter, face, BM_LOOPS_OF_FACE, j) {
b = (j - a + face->len) % face->len;
- verts[b] = nl->v;
+ verts[b] = l_new->v;
}
BM_CHECK_ELEMENT(face);
diff --git a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
index 3a724769f2a..4be70b7f5e9 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c
@@ -210,10 +210,10 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, const float angle_limit, const bool
/* check twice because cumulative effect could dissolve over angle limit */
bm_vert_edge_face_angle(v) < angle_limit)
{
- BMEdge *ne = BM_vert_collapse_edge(bm, v->e, v, true); /* join edges */
+ BMEdge *e_new = BM_vert_collapse_edge(bm, v->e, v, true); /* join edges */
- if (ne && ne->l) {
- BM_edge_normals_update(ne);
+ if (e_new && e_new->l) {
+ BM_edge_normals_update(e_new);
}
}
}
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index d7dbe3506b1..96d90a8c0a5 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -104,7 +104,7 @@ typedef struct KnifeEdge {
ListBase faces;
int draw;
- BMEdge *e, *oe; /* non-NULL if this is an original edge */
+ BMEdge *e /* , *e_old */; /* non-NULL if this is an original edge */
} KnifeEdge;
typedef struct BMEdgeHit {
@@ -1994,14 +1994,14 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
i++;
if (kfe->e && kfe->v1->v == kfe->e->v1 && kfe->v2->v == kfe->e->v2) {
- kfe->oe = kfe->e;
+ kfe->e_old = kfe->e;
continue;
}
j++;
if (kfe->e) {
- kfe->oe = kfe->e;
+ kfe->e_old = kfe->e;
BMO_elem_flag_enable(bm, kfe->e, DEL);
BMO_elem_flag_disable(bm, kfe->e, BOUNDARY);
@@ -2027,13 +2027,13 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
if (!kfe->v1 || !kfe->v2 || kfe->v1->inspace || kfe->v2->inspace)
continue;
- if (!(kfe->oe && kfe->v1->v == kfe->oe->v1 && kfe->v2->v == kfe->oe->v2))
+ if (!(kfe->e_old && kfe->v1->v == kfe->e_old->v1 && kfe->v2->v == kfe->e_old->v2))
continue;
k++;
BMO_elem_flag_enable(bm, kfe->e, BOUNDARY);
- kfe->oe = kfe->e;
+ kfe->e_old = kfe->e;
for (ref = kfe->faces.first; ref; ref = ref->next) {
f = ref->ref;
@@ -2096,7 +2096,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
if (sf_vert->poly_nr > 1 && sf_vert_last->poly_nr > 1) {
ScanFillEdge *sf_edge;
sf_edge = BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert);
- if (entry->kfe->oe)
+ if (entry->kfe->e_old)
sf_edge->f = SF_EDGE_BOUNDARY; /* mark as original boundary edge */
BMO_elem_flag_disable(bm, entry->kfe->e->v1, DEL);