diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-29 02:54:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-29 02:54:09 +0400 |
commit | d279fb503d756262a1724da6084374f80589d0a3 (patch) | |
tree | 285c23b279158f451c234851988e7ebeebdca08c /source/blender/bmesh/operators/bmo_create.c | |
parent | e6ca57b9294ed71fc6fd2bf773a4c5ebc8760f97 (diff) |
Style Cleanup, no functional changes.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_create.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_create.c | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 267d3d70a45..8798155845e 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -1181,14 +1181,9 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op) v2 = edges1[0]->v2; } else { - if (BM_vert_in_edge(edges1[1], edges1[0]->v1)) - v1 = edges1[0]->v2; - else v1 = edges1[0]->v1; - - i = BLI_array_count(edges1) - 1; - if (BM_vert_in_edge(edges1[i - 1], edges1[i]->v1)) - v2 = edges1[i]->v2; - else v2 = edges1[i]->v1; + v1 = BM_vert_in_edge(edges1[1], edges1[0]->v1) ? edges1[0]->v2 : edges1[0]->v1; + i = BLI_array_count(edges1) - 1; + v2 = BM_vert_in_edge(edges1[i - 1], edges1[i]->v1) ? edges1[i]->v2 : edges1[i]->v1; } if (BLI_array_count(edges2) == 1) { @@ -1196,17 +1191,12 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op) v4 = edges2[0]->v2; } else { - if (BM_vert_in_edge(edges2[1], edges2[0]->v1)) - v3 = edges2[0]->v2; - else v3 = edges2[0]->v1; - - i = BLI_array_count(edges2) - 1; - if (BM_vert_in_edge(edges2[i - 1], edges2[i]->v1)) - v4 = edges2[i]->v2; - else v4 = edges2[i]->v1; + v3 = BM_vert_in_edge(edges2[1], edges2[0]->v1) ? edges2[0]->v2 : edges2[0]->v1; + i = BLI_array_count(edges2) - 1; + v4 = BM_vert_in_edge(edges2[i - 1], edges2[i]->v1) ? edges2[i]->v2 : edges2[i]->v1; } - /* if there is ever bowtie quads between two edges the problem is here! [#] */ + /* if there is ever bowtie quads between two edges the problem is here! [#30367] */ #if 0 normal_tri_v3(dvec1, v1->co, v2->co, v4->co); normal_tri_v3(dvec2, v1->co, v4->co, v3->co); @@ -1222,10 +1212,7 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op) } #endif if (dot_v3v3(dvec1, dvec2) < 0.0f) { - BMVert *v; - v = v3; - v3 = v4; - v4 = v; + SWAP(BMVert *, v3, v4); } e = BM_edge_create(bm, v1, v3, NULL, TRUE); @@ -1235,18 +1222,12 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op) } else if (edges1) { BMVert *v1, *v2; - - if (BLI_array_count(edges1) > 1) { - if (BM_vert_in_edge(edges1[1], edges1[0]->v1)) - v1 = edges1[0]->v2; - else v1 = edges1[0]->v1; - i = BLI_array_count(edges1) - 1; - if (BM_vert_in_edge(edges1[i - 1], edges1[i]->v1)) - v2 = edges1[i]->v2; - else v2 = edges1[i]->v1; - - e = BM_edge_create(bm, v1, v2, NULL, TRUE); + if (BLI_array_count(edges1) > 1) { + v1 = BM_vert_in_edge(edges1[1], edges1[0]->v1) ? edges1[0]->v2 : edges1[0]->v1; + i = BLI_array_count(edges1) - 1; + v2 = BM_vert_in_edge(edges1[i - 1], edges1[i]->v1) ? edges1[i]->v2 : edges1[i]->v1; + e = BM_edge_create(bm, v1, v2, NULL, TRUE); BMO_elem_flag_enable(bm, e, ELE_NEW); } } |