diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-19 15:44:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-19 15:44:12 +0400 |
commit | 75b869e428cdb324ec338538efd4ab9dabd7d53a (patch) | |
tree | 7e47368e70820c4ee08e8b11abfe72eccb2fcb2b /source/blender/bmesh/operators/bmo_utils.c | |
parent | db2edfcfdec81fb03667a63e70f05ee832bf2586 (diff) |
style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER
Diffstat (limited to 'source/blender/bmesh/operators/bmo_utils.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index ea1fc5171e5..b35bcc8eaec 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -59,7 +59,7 @@ void bmo_transform_exec(BMesh *bm, BMOperator *op) BMO_slot_mat4_get(op, "mat", mat); - BMO_ITER(v, &iter, bm, op, "verts", BM_VERT) { + BMO_ITER (v, &iter, bm, op, "verts", BM_VERT) { mul_m4_v3(mat, v->co); } } @@ -113,7 +113,7 @@ void bmo_reversefaces_exec(BMesh *bm, BMOperator *op) BMOIter siter; BMFace *f; - BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) { + BMO_ITER (f, &siter, bm, op, "faces", BM_FACE) { BM_face_normal_flip(bm, f); } } @@ -131,7 +131,7 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op) #define EDGE_OUT 1 #define FACE_TAINT 1 - BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) { + BMO_ITER (e, &siter, bm, op, "edges", BM_EDGE) { /** * this ends up being called twice, could add option to not to call check in * #BM_edge_rotate to get some extra speed */ @@ -180,14 +180,14 @@ static void bmo_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) BMOIter siter; if (!usefaces) { - BMO_ITER(v, &siter, bm, op, "geom", BM_VERT) { - BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) { + BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { if (!BMO_elem_flag_test(bm, e, SEL_ORIG)) break; } if (e) { - BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { BMO_elem_flag_enable(bm, e, SEL_FLAG); BMO_elem_flag_enable(bm, BM_edge_other_vert(e, v), SEL_FLAG); } @@ -199,9 +199,9 @@ static void bmo_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) BMFace *f, *f2; BMLoop *l; - BMO_ITER(f, &siter, bm, op, "geom", BM_FACE) { - BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { - BM_ITER(f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { + BMO_ITER (f, &siter, bm, op, "geom", BM_FACE) { + BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER (f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) { BMO_elem_flag_enable(bm, f2, SEL_FLAG); } @@ -219,8 +219,8 @@ static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) BMOIter siter; if (!usefaces) { - BMO_ITER(v, &siter, bm, op, "geom", BM_VERT) { - BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) { + BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { if (!BMO_elem_flag_test(bm, e, SEL_ORIG)) break; } @@ -228,7 +228,7 @@ static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) if (e) { BMO_elem_flag_enable(bm, v, SEL_FLAG); - BM_ITER(e, &eiter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER (e, &eiter, bm, BM_EDGES_OF_VERT, v) { BMO_elem_flag_enable(bm, e, SEL_FLAG); } @@ -240,9 +240,9 @@ static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) BMFace *f, *f2; BMLoop *l; - BMO_ITER(f, &siter, bm, op, "geom", BM_FACE) { - BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { - BM_ITER(f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { + BMO_ITER (f, &siter, bm, op, "geom", BM_FACE) { + BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER (f2, &fiter, bm, BM_FACES_OF_EDGE, l->e) { if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) { BMO_elem_flag_enable(bm, f, SEL_FLAG); break; @@ -312,7 +312,7 @@ void bmo_righthandfaces_exec(BMesh *bm, BMOperator *op) BMO_slot_buffer_flag_enable(bm, op, "faces", BM_FACE, FACE_FLAG); /* find a starting face */ - BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) { + BMO_ITER (f, &siter, bm, op, "faces", BM_FACE) { /* clear dirty flag */ BM_elem_flag_disable(f, BM_ELEM_TAG); @@ -358,8 +358,8 @@ void bmo_righthandfaces_exec(BMesh *bm, BMOperator *op) f = fstack[i]; i--; - BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { - BM_ITER(l2, &liter2, bm, BM_LOOPS_OF_LOOP, l) { + BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER (l2, &liter2, bm, BM_LOOPS_OF_LOOP, l) { if (!BMO_elem_flag_test(bm, l2->f, FACE_FLAG) || l2 == l) continue; @@ -395,7 +395,7 @@ void bmo_righthandfaces_exec(BMesh *bm, BMOperator *op) BLI_array_free(fstack); /* check if we have faces yet to do. if so, recurse */ - BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) { + BMO_ITER (f, &siter, bm, op, "faces", BM_FACE) { if (!BMO_elem_flag_test(bm, f, FACE_VIS)) { bmo_righthandfaces_exec(bm, op); break; @@ -419,12 +419,12 @@ void bmo_vertexsmooth_exec(BMesh *bm, BMOperator *op) clipz = BMO_slot_bool_get(op, "mirror_clip_z"); i = 0; - BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) { + BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { BLI_array_growone(cos); co = cos[i]; j = 0; - BM_ITER(e, &iter, bm, BM_EDGES_OF_VERT, v) { + BM_ITER (e, &iter, bm, BM_EDGES_OF_VERT, v) { co2 = BM_edge_other_vert(e, v)->co; add_v3_v3v3(co, co, co2); j += 1; @@ -450,7 +450,7 @@ void bmo_vertexsmooth_exec(BMesh *bm, BMOperator *op) } i = 0; - BMO_ITER(v, &siter, bm, op, "verts", BM_VERT) { + BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) { copy_v3_v3(v->co, cos[i]); i++; } @@ -475,7 +475,7 @@ static float ngon_fake_area(BMesh *bm, BMFace *f) BM_face_center_mean_calc(bm, f, c); - BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) { + BM_ITER (l, &liter, bm, BM_LOOPS_OF_FACE, f) { if (num_verts == 0) { copy_v3_v3(v, l->v->co); copy_v3_v3(sv, l->v->co); @@ -533,7 +533,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) * so the overall complexity will be less than $O(mn)$ where is the total number of selected faces, * and n is the total number of faces */ - BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) { + BMO_ITER (fs, &fs_iter, bm, op, "faces", BM_FACE) { if (!BMO_elem_flag_test(bm, fs, FACE_MARK)) { /* is this really needed ? */ BMO_elem_flag_enable(bm, fs, FACE_MARK); num_sels++; @@ -545,7 +545,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op) f_ext = (SimSel_FaceExt *)MEM_callocN(sizeof(SimSel_FaceExt) * num_total, "f_ext util.c"); /* loop through all the faces and fill the faces/indices structure */ - BM_ITER(fm, &fm_iter, bm, BM_FACES_OF_MESH, NULL) { + BM_ITER (fm, &fm_iter, bm, BM_FACES_OF_MESH, NULL) { f_ext[i].f = fm; if (BMO_elem_flag_test(bm, fm, FACE_MARK)) { indices[idx] = i; @@ -673,7 +673,7 @@ static float edge_angle(BMesh *bm, BMEdge *e) /* first edge faces, don't account for 3+ */ - BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, e) { + BM_ITER (f, &fiter, bm, BM_FACES_OF_EDGE, e) { if (f_prev == NULL) { f_prev = f; } @@ -723,7 +723,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) num_total = BM_mesh_elem_count(bm, BM_EDGE); /* iterate through all selected edges and mark them */ - BMO_ITER(es, &es_iter, bm, op, "edges", BM_EDGE) { + BMO_ITER (es, &es_iter, bm, op, "edges", BM_EDGE) { BMO_elem_flag_enable(bm, es, EDGE_MARK); num_sels++; } @@ -733,7 +733,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op) e_ext = (SimSel_EdgeExt *)MEM_callocN(sizeof(SimSel_EdgeExt) * num_total, "e_ext util.c"); /* loop through all the edges and fill the edges/indices structure */ - BM_ITER(e, &e_iter, bm, BM_EDGES_OF_MESH, NULL) { + BM_ITER (e, &e_iter, bm, BM_EDGES_OF_MESH, NULL) { e_ext[i].e = e; if (BMO_elem_flag_test(bm, e, EDGE_MARK)) { indices[idx] = i; @@ -887,7 +887,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) num_total = BM_mesh_elem_count(bm, BM_VERT); /* iterate through all selected edges and mark them */ - BMO_ITER(vs, &vs_iter, bm, op, "verts", BM_VERT) { + BMO_ITER (vs, &vs_iter, bm, op, "verts", BM_VERT) { BMO_elem_flag_enable(bm, vs, VERT_MARK); num_sels++; } @@ -897,7 +897,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op) v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra"); /* loop through all the vertices and fill the vertices/indices structure */ - BM_ITER(v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER (v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { v_ext[i].v = v; if (BMO_elem_flag_test(bm, v, VERT_MARK)) { indices[idx] = i; @@ -984,7 +984,7 @@ void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op) int dir = BMO_slot_int_get(op, "dir"); - BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) { + BMO_ITER (fs, &fs_iter, bm, op, "faces", BM_FACE) { if (CustomData_has_layer(&(bm->ldata), CD_MLOOPUV)) { if (dir == DIRECTION_CW) { /* same loops direction */ BMLoop *lf; /* current face loops */ @@ -993,7 +993,7 @@ void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op) float t_uv[2]; /* tmp uvs */ int n = 0; - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { /* current loop uv is the previous loop uv */ MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); if (n == 0) { @@ -1017,7 +1017,7 @@ void bmo_face_rotateuvs_exec(BMesh *bm, BMOperator *op) float t_uv[2]; /* current uvs */ int n = 0; - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { /* previous loop uv is the current loop uv */ luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); if (n == 0) { @@ -1050,7 +1050,7 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op) BLI_array_declare(uvs); float (*uvs)[2] = NULL; - BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) { + BMO_ITER (fs, &fs_iter, bm, op, "faces", BM_FACE) { if (CustomData_has_layer(&(bm->ldata), CD_MLOOPUV)) { BMLoop *lf; /* current face loops */ int i; @@ -1058,7 +1058,7 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op) BLI_array_empty(uvs); BLI_array_growitems(uvs, fs->len); - BM_ITER_INDEX(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs, i) { + BM_ITER_INDEX (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs, i) { MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); /* current loop uv is the previous loop uv */ @@ -1067,7 +1067,7 @@ void bmo_face_reverseuvs_exec(BMesh *bm, BMOperator *op) /* now that we have the uvs in the array, reverse! */ i = 0; - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { /* current loop uv is the previous loop uv */ MLoopUV *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPUV); luv->uv[0] = uvs[(fs->len - i - 1)][0]; @@ -1093,7 +1093,7 @@ void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op) int dir = BMO_slot_int_get(op, "dir"); - BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) { + BMO_ITER (fs, &fs_iter, bm, op, "faces", BM_FACE) { if (CustomData_has_layer(&(bm->ldata), CD_MLOOPCOL)) { if (dir == DIRECTION_CW) { /* same loops direction */ BMLoop *lf; /* current face loops */ @@ -1102,7 +1102,7 @@ void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op) MLoopCol t_col; /* tmp color */ int n = 0; - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { /* current loop color is the previous loop color */ MLoopCol *luv = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); if (n == 0) { @@ -1126,7 +1126,7 @@ void bmo_rotatecolors_exec(BMesh *bm, BMOperator *op) MLoopCol t_col; /* current color */ int n = 0; - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { /* previous loop color is the current loop color */ lcol = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); if (n == 0) { @@ -1158,13 +1158,13 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op) BLI_array_declare(cols); MLoopCol *cols = NULL; - BMO_ITER(fs, &fs_iter, bm, op, "faces", BM_FACE) { + BMO_ITER (fs, &fs_iter, bm, op, "faces", BM_FACE) { if (CustomData_has_layer(&(bm->ldata), CD_MLOOPCOL)) { BMLoop *lf; /* current face loops */ int i = 0; BLI_array_empty(cols); - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { MLoopCol *lcol = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); /* current loop uv is the previous loop color */ @@ -1175,7 +1175,7 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op) /* now that we have the uvs in the array, reverse! */ i = 0; - BM_ITER(lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { + BM_ITER (lf, &l_iter, bm, BM_LOOPS_OF_FACE, fs) { /* current loop uv is the previous loop color */ MLoopCol *lcol = CustomData_bmesh_get(&bm->ldata, lf->head.data, CD_MLOOPCOL); *lcol = cols[(fs->len - i - 1)]; @@ -1212,10 +1212,10 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) int num_total = 0 /*, num_sels = 0 */, i = 0; int type = BMO_slot_int_get(op, "type"); - BMO_ITER(vs, &vs_iter, bm, op, "startv", BM_VERT) { + BMO_ITER (vs, &vs_iter, bm, op, "startv", BM_VERT) { sv = vs; } - BMO_ITER(vs, &vs_iter, bm, op, "endv", BM_VERT) { + BMO_ITER (vs, &vs_iter, bm, op, "endv", BM_VERT) { ev = vs; } @@ -1227,7 +1227,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) /* iterate through all the mesh vertices */ /* loop through all the vertices and fill the vertices/indices structure */ i = 0; - BM_ITER(v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { + BM_ITER (v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) { vert_list[i].v = v; vert_list[i].parent = NULL; vert_list[i].weight = FLT_MAX; @@ -1262,7 +1262,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op) v_weight = vert_list[BM_elem_index_get(v)].weight; - BM_ITER(e, &e_i, bm, BM_EDGES_OF_VERT, v) { + BM_ITER (e, &e_i, bm, BM_EDGES_OF_VERT, v) { BMVert *u; float e_weight = v_weight; |