style cleanup: bmesh - have continue on new line, also avoid unneeded loop in bmo_extrude_face_region_exec() in some cases.

This commit is contained in:
Campbell Barton
2012-03-01 13:13:08 +00:00
parent ea13ec1699
commit 216f74880e
8 changed files with 76 additions and 44 deletions

View File

@@ -944,8 +944,10 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface)
#ifdef USE_BMESH_HOLES
for (lst = f->loops.first; lst; lst = lst->next) {
if (lst == f->loops.first) continue;
if (lst == f->loops.first) {
continue;
}
BLI_remlink(&f->loops, lst);
BLI_addtail(&holes, lst);
}

View File

@@ -959,7 +959,9 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
shrink_edgef(v1, v2, fac1);
for (j = 0; j < len; j++) {
if (!loops[j][0]) continue;
if (!loops[j][0]) {
continue;
}
p3 = edgeverts[j * 2];
p4 = edgeverts[j * 2 + 1];
@@ -972,22 +974,20 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
for (i = 0; i < len; i++) {
for (j = 0; j < len; j++) {
if (j == i) continue;
if (!loops[i][0]) continue;
if (!loops[j][0]) continue;
if (j != i && loops[i][0] && loops[j][0]) {
p1 = edgeverts[i * 2];
p2 = edgeverts[i * 2 + 1];
p3 = edgeverts[j * 2];
p4 = edgeverts[j * 2 + 1];
p1 = edgeverts[i * 2];
p2 = edgeverts[i * 2 + 1];
p3 = edgeverts[j * 2];
p4 = edgeverts[j * 2 + 1];
copy_v3_v3(v1, p1);
copy_v3_v3(v2, p2);
copy_v3_v3(v1, p1);
copy_v3_v3(v2, p2);
shrink_edgef(v1, v2, fac1);
shrink_edgef(v1, v2, fac1);
if (linecrossesf(v1, v2, p3, p4)) {
loops[i][0] = NULL;
if (linecrossesf(v1, v2, p3, p4)) {
loops[i][0] = NULL;
}
}
}
}

View File

@@ -360,7 +360,10 @@ static void *islandWalker_step(BMWalker *walker)
if (walker->mask_face && !BMO_elem_flag_test(walker->bm, f, walker->mask_face)) {
continue;
}
if (BLI_ghash_haskey(walker->visithash, f)) continue;
if (BLI_ghash_haskey(walker->visithash, f)) {
continue;
}
iwalk = BMW_state_add(walker);
iwalk->cur = f;

View File

@@ -51,7 +51,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
BLI_array_empty(loops);
BLI_array_empty(verts);
if (BMO_elem_flag_test(bm, f, FACE_NEW)) continue;
if (BMO_elem_flag_test(bm, f, FACE_NEW)) {
continue;
}
l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f);
lastl = NULL;
@@ -74,7 +76,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
}
}
if (BLI_array_count(loops) == 0) continue;
if (BLI_array_count(loops) == 0) {
continue;
}
if (BLI_array_count(loops) > 2) {
BLI_array_growone(loops);
@@ -87,7 +91,9 @@ void bmo_connectverts_exec(BMesh *bm, BMOperator *op)
BM_face_legal_splits(bm, f, (BMLoop *(*)[2])loops, BLI_array_count(loops) / 2);
for (i = 0; i < BLI_array_count(loops) / 2; i++) {
if (loops[i * 2] == NULL) continue;
if (loops[i * 2] == NULL) {
continue;
}
BLI_array_growone(verts);
verts[BLI_array_count(verts) - 1] = loops[i * 2]->v;

View File

@@ -96,7 +96,10 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
/* collect region */
BMO_ITER(f, &oiter, bm, op, "faces", BM_FACE) {
if (!BMO_elem_flag_test(bm, f, FACE_MARK)) continue;
if (!BMO_elem_flag_test(bm, f, FACE_MARK)) {
continue;
}
BLI_array_empty(faces);
faces = NULL; /* forces different allocatio */

View File

@@ -203,19 +203,22 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
* original geometry unless caller explicitly asked to keep it. */
if (!BMO_slot_bool_get(op, "alwayskeeporig")) {
BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) continue;
found = 0;
if (!BMO_elem_flag_test(bm, e, EXT_INPUT)) {
continue;
}
found = FALSE;
f = BM_iter_new(&fiter, bm, BM_FACES_OF_EDGE, e);
for (rlen = 0; f; f = BM_iter_step(&fiter), rlen++) {
if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
found = 1;
found = TRUE;
delorig = 1;
break;
}
}
if (!found && (rlen > 1)) {
if ((found == FALSE) && (rlen > 1)) {
BMO_elem_flag_enable(bm, e, EXT_DEL);
}
}
@@ -223,23 +226,26 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
/* calculate verts to delet */
BM_ITER(v, &iter, bm, BM_VERTS_OF_MESH, NULL) {
found = 0;
found = FALSE;
BM_ITER(e, &viter, bm, BM_EDGES_OF_VERT, v) {
if (!BMO_elem_flag_test(bm, e, EXT_INPUT) || !BMO_elem_flag_test(bm, e, EXT_DEL)) {
found = 1;
break;
}
}
BM_ITER(f, &viter, bm, BM_FACES_OF_VERT, v) {
if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
found = 1;
found = TRUE;
break;
}
}
if (!found) {
/* avoid an extra loop */
if (found == TRUE) {
BM_ITER(f, &viter, bm, BM_FACES_OF_VERT, v) {
if (!BMO_elem_flag_test(bm, f, EXT_INPUT)) {
found = TRUE;
break;
}
}
}
if (found == FALSE) {
BMO_elem_flag_enable(bm, v, EXT_DEL);
}
}
@@ -275,11 +281,15 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
BMO_slot_copy(&dupeop, op, "newout", "geomout");
e = BMO_iter_new(&siter, bm, &dupeop, "boundarymap", 0);
for ( ; e; e = BMO_iter_step(&siter)) {
if (BMO_slot_map_contains(bm, op, "exclude", e)) continue;
if (BMO_slot_map_contains(bm, op, "exclude", e)) {
continue;
}
newedge = BMO_iter_map_value(&siter);
newedge = *(BMEdge **)newedge;
if (!newedge) continue;
newedge = *(BMEdge **)BMO_iter_map_value(&siter);
if (!newedge) {
continue;
}
/* orient loop to give same normal as a loop of newedge
* if it exists (will be an extruded face),
@@ -309,7 +319,11 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
/* copy attribute */
l = BM_iter_new(&iter, bm, BM_LOOPS_OF_FACE, f);
for ( ; l; l = BM_iter_step(&iter)) {
if (l->e != e && l->e != newedge) continue;
if (l->e != e && l->e != newedge) {
continue;
}
l2 = l->radial_next;
if (l2 == l) {
@@ -349,7 +363,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
BM_edge_create(bm, v, v2, v->e, TRUE);
}
/* cleanu */
/* cleanup */
if (delorig) BMO_op_finish(bm, &delop);
BMO_op_finish(bm, &dupeop);
}

View File

@@ -510,8 +510,10 @@ void bmesh_finddoubles_common(BMesh *bm, BMOperator *op, BMOperator *optarget, c
len = BLI_array_count(verts);
for (i = 0; i < len; i++) {
v = verts[i];
if (BMO_elem_flag_test(bm, v, VERT_DOUBLE)) continue;
if (BMO_elem_flag_test(bm, v, VERT_DOUBLE)) {
continue;
}
for (j = i + 1; j < len; j++) {
v2 = verts[j];

View File

@@ -837,7 +837,9 @@ void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
for (i = 0; i < PLEN; i++) {
pat = patterns[i];
if (!pat) continue;
if (!pat) {
continue;
}
if (pat->len == face->len) {
for (a = 0; a < pat->len; a++) {