code cleanup: prefer BM_face/edge/vert_select_set() over BM_elem_select_set() when...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 20 Apr 2012 16:55:47 +0000 (16:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 20 Apr 2012 16:55:47 +0000 (16:55 +0000)
Add asserts so the correct types are ensured.

13 files changed:
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_rip.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/transform/transform.c
source/blender/editors/uvedit/uvedit_ops.c

index 7cf29031765e54c8d7a8e3de699a02a05a3496a0..7b6d562658ec6e5151fe08b66e8fd1c2f4bb6ceb 100644 (file)
@@ -245,8 +245,7 @@ void BM_mesh_select_flush(BMesh *bm)
  */
 void BM_vert_select_set(BMesh *bm, BMVert *v, int select)
 {
-       /* BMIter iter; */
-       /* BMEdge *e; */
+       BLI_assert(v->head.htype == BM_VERT);
 
        if (BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
                return;
@@ -273,6 +272,8 @@ void BM_vert_select_set(BMesh *bm, BMVert *v, int select)
  */
 void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
 {
+       BLI_assert(e->head.htype == BM_EDGE);
+
        if (BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
                return;
        }
@@ -281,8 +282,8 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
                if (!BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel += 1;
 
                BM_elem_flag_enable(e, BM_ELEM_SELECT);
-               BM_elem_select_set(bm, e->v1, TRUE);
-               BM_elem_select_set(bm, e->v2, TRUE);
+               BM_vert_select_set(bm, e->v1, TRUE);
+               BM_vert_select_set(bm, e->v2, TRUE);
        }
        else {
                if (BM_elem_flag_test(e, BM_ELEM_SELECT)) bm->totedgesel -= 1;
@@ -318,8 +319,8 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
                        }
                }
                else {
-                       BM_elem_select_set(bm, e->v1, FALSE);
-                       BM_elem_select_set(bm, e->v2, FALSE);
+                       BM_vert_select_set(bm, e->v1, FALSE);
+                       BM_vert_select_set(bm, e->v2, FALSE);
                }
 
        }
@@ -336,6 +337,8 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
        BMLoop *l_iter;
        BMLoop *l_first;
 
+       BLI_assert(f->head.htype == BM_FACE);
+
        if (BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
                return;
        }
@@ -369,7 +372,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
                        }
 
                        if (!f2) {
-                               BM_elem_select_set(bm, l->e, FALSE);
+                               BM_edge_select_set(bm, l->e, FALSE);
                        }
                }
 
@@ -383,7 +386,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
                        }
 
                        if (!e) {
-                               BM_elem_select_set(bm, l->v, FALSE);
+                               BM_vert_select_set(bm, l->v, FALSE);
                        }
                }
        }
index 574fb62b70300aae091b3b354cd3ccbacacb0883..a7ecc897ff0edcaf2d877f5b8b81a232ad73075d 100644 (file)
@@ -263,7 +263,7 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
                /* this is necessary for selection counts to work properly */
                if (medge->flag & SELECT) {
-                       BM_elem_select_set(bm, e, TRUE);
+                       BM_edge_select_set(bm, e, TRUE);
                }
 
                /* Copy Custom Data */
@@ -329,7 +329,7 @@ void BM_mesh_bm_from_me(BMesh *bm, Mesh *me, int set_key, int act_key_nr)
 
                /* this is necessary for selection counts to work properly */
                if (mpoly->flag & ME_FACE_SEL) {
-                       BM_elem_select_set(bm, f, TRUE);
+                       BM_face_select_set(bm, f, TRUE);
                }
 
                f->mat_nr = mpoly->mat_nr;
index d02bb14bebfa0fc202c97d2ca086ee51dbe6c00b..6272c43d0c5a4990998055c0f125e7c20278f81e 100644 (file)
@@ -614,10 +614,10 @@ static void init_rotsys(BMesh *bm, EdgeData *edata, VertData *vdata)
                        BM_elem_index_set(v2, -1); /* set_dirty! */
                        //BM_edge_create(bm, cv, v2, NULL, FALSE);
                        
-                       BM_elem_select_set(bm, v2, TRUE);
+                       BM_vert_select_set(bm, v2, TRUE);
                        if (lastv) {
                                e2 = BM_edge_create(bm, lastv, v2, NULL, FALSE);
-                               BM_elem_select_set(bm, e2, TRUE);
+                               BM_edge_select_set(bm, e2, TRUE);
                        }
                        
                        lastv = v2;
index b3d4584107a47a7b3782e86275b95f0f2f5e228b..d629585f7cd6ab45444541cfe1c6d00a457d0678 100644 (file)
@@ -1069,13 +1069,13 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s
                                             BM_elem_flag_test(e->v1, BM_ELEM_SELECT) &&
                                             BM_elem_flag_test(e->v2, BM_ELEM_SELECT))
                                        {
-                                               BM_elem_select_set(bm, e, TRUE);
+                                               BM_edge_select_set(bm, e, TRUE);
                                        }
                                        else if (BM_elem_flag_test(e, BM_ELEM_SELECT) &&
                                                 (!BM_elem_flag_test(e->v1, BM_ELEM_SELECT) ||
                                                  !BM_elem_flag_test(e->v2, BM_ELEM_SELECT)))
                                        {
-                                               BM_elem_select_set(bm, e, FALSE);
+                                               BM_edge_select_set(bm, e, FALSE);
                                        }
                                }
                        }
index d05bf10e206f1dc9ff44b5ad9f8fb006ff63a0d3..45a975e5d529068997463521fb9bca994a851f81 100644 (file)
@@ -211,7 +211,7 @@ static void edgering_sel(tringselOpData *lcd, int previewlines, int select)
 
                eed = BMW_begin(&walker, startedge);
                for ( ; eed; eed = BMW_step(&walker)) {
-                       BM_elem_select_set(em->bm, eed, TRUE);
+                       BM_edge_select_set(em->bm, eed, TRUE);
                }
                BMW_end(&walker);
 
index 7333bf9aa49e1b71ef807c6cb8ecf26931245b2e..1e0f0b2579b32c029249ffe7c8485ed010198edb 100644 (file)
@@ -336,7 +336,7 @@ static void edbm_ripsel_deselect_helper(BMesh *bm, EdgeLoopPair *eloop_pairs,
                e = (score_a > score_b) ? lp->l_a->e : lp->l_b->e;
                v_prev = edbm_ripsel_edloop_pair_start_vert(e);
                for (; e; e = edbm_ripsel_edge_uid_step(e, &v_prev)) {
-                       BM_elem_select_set(bm, e, FALSE);
+                       BM_edge_select_set(bm, e, FALSE);
                }
        }
 }
@@ -431,12 +431,12 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
                BMVert **vout;
                int vout_len;
 
-               BM_elem_select_set(bm, v, FALSE);
+               BM_vert_select_set(bm, v, FALSE);
                bmesh_vert_separate(bm, v, &vout, &vout_len);
 
                if (vout_len < 2) {
                        /* set selection back to avoid active-unselected vertex */
-                       BM_elem_select_set(bm, v, TRUE);
+                       BM_vert_select_set(bm, v, TRUE);
                        /* should never happen */
                        BKE_report(op->reports, RPT_ERROR, "Error ripping vertex from faces");
                        return OPERATOR_CANCELLED;
@@ -472,7 +472,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
 
                        /* select the vert from the best region */
                        v = vout[vi_best];
-                       BM_elem_select_set(bm, v, TRUE);
+                       BM_vert_select_set(bm, v, TRUE);
 
                        if (ese.ele) {
                                EDBM_editselection_store(em, &v->head);
@@ -541,7 +541,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
                BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
                                /* disable by default, re-enable winner at end */
-                               BM_elem_select_set(bm, v, FALSE);
+                               BM_vert_select_set(bm, v, FALSE);
 
                                BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
                                        /* calculate a point in the face, rather then calculate the middle,
@@ -566,7 +566,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event)
                }
 
                if (v_best) {
-                       BM_elem_select_set(bm, v_best, TRUE);
+                       BM_vert_select_set(bm, v_best, TRUE);
                        if (ese.ele) {
                                EDBM_editselection_store(em, &v_best->head);
                        }
index c20c3e50e677c81eb7354a60e77d2e1f446ba192..b6e162cb2200b043c43c2100c40ea935f56955d8 100644 (file)
@@ -95,7 +95,7 @@ void EDBM_select_mirrored(Object *UNUSED(obedit), BMEditMesh *em, int extend)
 
                v2 = EDBM_verts_mirror_get(em, v1);
                if (v2 && !BM_elem_flag_test(v2, BM_ELEM_HIDDEN)) {
-                       BM_elem_select_set(em->bm, v2, TRUE);
+                       BM_vert_select_set(em->bm, v2, TRUE);
                }
        }
 
@@ -1166,7 +1166,7 @@ static void edgetag_context_set(BMEditMesh *em, Scene *scene, BMEdge *e, int val
        
        switch (scene->toolsettings->edge_mode) {
                case EDGE_MODE_SELECT:
-                       BM_elem_select_set(em->bm, e, val);
+                       BM_edge_select_set(em->bm, e, val);
                        break;
                case EDGE_MODE_TAG_SEAM:
                        BM_elem_flag_set(e, BM_ELEM_SEAM, val);
@@ -1459,31 +1459,31 @@ int mouse_mesh(bContext *C, const int mval[2], short extend)
                        
                        if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                                EDBM_editselection_store(vc.em, &efa->head);
-                               BM_elem_select_set(vc.em->bm, efa, TRUE);
+                               BM_face_select_set(vc.em->bm, efa, TRUE);
                        }
                        else if (extend) {
                                EDBM_editselection_remove(vc.em, &efa->head);
-                               BM_elem_select_set(vc.em->bm, efa, FALSE);
+                               BM_face_select_set(vc.em->bm, efa, FALSE);
                        }
                }
                else if (eed) {
                        if (!BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
                                EDBM_editselection_store(vc.em, &eed->head);
-                               BM_elem_select_set(vc.em->bm, eed, TRUE);
+                               BM_edge_select_set(vc.em->bm, eed, TRUE);
                        }
                        else if (extend) {
                                EDBM_editselection_remove(vc.em, &eed->head);
-                               BM_elem_select_set(vc.em->bm, eed, FALSE);
+                               BM_edge_select_set(vc.em->bm, eed, FALSE);
                        }
                }
                else if (eve) {
                        if (!BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
                                EDBM_editselection_store(vc.em, &eve->head);
-                               BM_elem_select_set(vc.em->bm, eve, TRUE);
+                               BM_vert_select_set(vc.em->bm, eve, TRUE);
                        }
                        else if (extend) {
                                EDBM_editselection_remove(vc.em, &eve->head);
-                               BM_elem_select_set(vc.em->bm, eve, FALSE);
+                               BM_vert_select_set(vc.em->bm, eve, FALSE);
                        }
                }
                
@@ -1554,12 +1554,12 @@ void EDBM_selectmode_set(BMEditMesh *em)
        else if (em->selectmode & SCE_SELECT_EDGE) {
                /* deselect vertices, and select again based on edge select */
                eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
-               for (; eve; eve = BM_iter_step(&iter)) BM_elem_select_set(em->bm, eve, FALSE);
+               for (; eve; eve = BM_iter_step(&iter)) BM_vert_select_set(em->bm, eve, FALSE);
                
                eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
                for (; eed; eed = BM_iter_step(&iter)) {
                        if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
-                               BM_elem_select_set(em->bm, eed, TRUE);
+                               BM_edge_select_set(em->bm, eed, TRUE);
                        }
                }
                
@@ -1569,12 +1569,12 @@ void EDBM_selectmode_set(BMEditMesh *em)
        else if (em->selectmode & SCE_SELECT_FACE) {
                /* deselect eges, and select again based on face select */
                eed = BM_iter_new(&iter, em->bm, BM_EDGES_OF_MESH, NULL);
-               for (; eed; eed = BM_iter_step(&iter)) BM_elem_select_set(em->bm, eed, FALSE);
+               for (; eed; eed = BM_iter_step(&iter)) BM_edge_select_set(em->bm, eed, FALSE);
                
                efa = BM_iter_new(&iter, em->bm, BM_FACES_OF_MESH, NULL);
                for (; efa; efa = BM_iter_step(&iter)) {
                        if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
-                               BM_elem_select_set(em->bm, efa, TRUE);
+                               BM_face_select_set(em->bm, efa, TRUE);
                        }
                }
        }
@@ -1595,7 +1595,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, short oldmode, short selectmode)
                                if ((BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) ||
                                     BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)))
                                {
-                                       BM_elem_select_set(em->bm, eed, TRUE);
+                                       BM_edge_select_set(em->bm, eed, TRUE);
                                }
                        }
                }               
@@ -1609,7 +1609,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, short oldmode, short selectmode)
                                l = BM_iter_new(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
                                for (; l; l = BM_iter_step(&liter)) {
                                        if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
-                                               BM_elem_select_set(em->bm, efa, TRUE);
+                                               BM_face_select_set(em->bm, efa, TRUE);
                                                break;
                                        }
                                }
@@ -1628,7 +1628,7 @@ void EDBM_selectmode_convert(BMEditMesh *em, short oldmode, short selectmode)
                                l = BM_iter_new(&liter, em->bm, BM_LOOPS_OF_FACE, efa);
                                for (; l; l = BM_iter_step(&liter)) {
                                        if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
-                                               BM_elem_select_set(em->bm, efa, TRUE);
+                                               BM_face_select_set(em->bm, efa, TRUE);
                                                break;
                                        }
                                }
@@ -1647,7 +1647,7 @@ void EDBM_deselect_by_material(BMEditMesh *em, const short index, const short se
                if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
                        continue;
                if (efa->mat_nr == index) {
-                       BM_elem_select_set(em->bm, efa, select);
+                       BM_face_select_set(em->bm, efa, select);
                }
        }
 }
@@ -1671,21 +1671,21 @@ void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
                BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(eve, BM_ELEM_HIDDEN))
                                continue;
-                       BM_elem_select_set(em->bm, eve, !BM_elem_flag_test(eve, BM_ELEM_SELECT));
+                       BM_vert_select_set(em->bm, eve, !BM_elem_flag_test(eve, BM_ELEM_SELECT));
                }
        }
        else if (em->selectmode & SCE_SELECT_EDGE) {
                BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                        if (BM_elem_flag_test(eed, BM_ELEM_HIDDEN))
                                continue;
-                       BM_elem_select_set(em->bm, eed, !BM_elem_flag_test(eed, BM_ELEM_SELECT));
+                       BM_edge_select_set(em->bm, eed, !BM_elem_flag_test(eed, BM_ELEM_SELECT));
                }
        }
        else {
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                        if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
                                continue;
-                       BM_elem_select_set(em->bm, efa, !BM_elem_flag_test(efa, BM_ELEM_SELECT));
+                       BM_face_select_set(em->bm, efa, !BM_elem_flag_test(efa, BM_ELEM_SELECT));
                }
 
        }
@@ -1716,7 +1716,7 @@ int EDBM_select_interior_faces(BMEditMesh *em)
                }
 
                if (ok) {
-                       BM_elem_select_set(bm, efa, TRUE);
+                       BM_face_select_set(bm, efa, TRUE);
                        change = TRUE;
                }
        }
@@ -1799,7 +1799,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *
 
                e = BMW_begin(&walker, efa);
                for (; efa; efa = BMW_step(&walker)) {
-                       BM_elem_select_set(bm, efa, sel);
+                       BM_face_select_set(bm, efa, sel);
                }
                BMW_end(&walker);
        }
@@ -1821,7 +1821,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *
 
                e = BMW_begin(&walker, eed->v1);
                for (; e; e = BMW_step(&walker)) {
-                       BM_elem_select_set(bm, e, sel);
+                       BM_edge_select_set(bm, e, sel);
                }
                BMW_end(&walker);
 
@@ -1891,7 +1891,7 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
                        if (BM_elem_flag_test(efa, BM_ELEM_TAG)) {
                                e = BMW_begin(&walker, efa);
                                for (; efa; efa = BMW_step(&walker)) {
-                                       BM_elem_select_set(bm, efa, TRUE);
+                                       BM_face_select_set(bm, efa, TRUE);
                                }
                        }
                }
@@ -1916,8 +1916,8 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
                        if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
                                e = BMW_begin(&walker, v);
                                for (; e; e = BMW_step(&walker)) {
-                                       BM_elem_select_set(em->bm, e->v1, TRUE);
-                                       BM_elem_select_set(em->bm, e->v2, TRUE);
+                                       BM_vert_select_set(em->bm, e->v1, TRUE);
+                                       BM_vert_select_set(em->bm, e->v2, TRUE);
                                }
                        }
                }
@@ -2237,7 +2237,7 @@ static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
                angle = angle_normalized_v3v3(l1->f->no, l2->f->no);
 
                if (fabsf(angle) > sharp) {
-                       BM_elem_select_set(em->bm, e, TRUE);
+                       BM_edge_select_set(em->bm, e, TRUE);
                }
 
        }
@@ -2296,7 +2296,7 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
                        f = stack[i - 1];
                        i--;
 
-                       BM_elem_select_set(em->bm, f, TRUE);
+                       BM_face_select_set(em->bm, f, TRUE);
 
                        BM_elem_flag_enable(f, BM_ELEM_TAG);
 
@@ -2365,13 +2365,13 @@ static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
        
        BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
                if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN) && !BM_vert_is_manifold(v)) {
-                       BM_elem_select_set(em->bm, v, TRUE);
+                       BM_vert_select_set(em->bm, v, TRUE);
                }
        }
        
        BM_ITER_MESH (e, &iter, em->bm, BM_EDGES_OF_MESH) {
                if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && !BM_edge_is_manifold(e)) {
-                       BM_elem_select_set(em->bm, e, TRUE);
+                       BM_edge_select_set(em->bm, e, TRUE);
                }
        }
 
@@ -2413,7 +2413,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
        if (em->selectmode & SCE_SELECT_VERTEX) {
                BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                        if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
-                               BM_elem_select_set(em->bm, eve, TRUE);
+                               BM_vert_select_set(em->bm, eve, TRUE);
                        }
                }
                EDBM_selectmode_flush(em);
@@ -2421,7 +2421,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
        else if (em->selectmode & SCE_SELECT_EDGE) {
                BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                        if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
-                               BM_elem_select_set(em->bm, eed, TRUE);
+                               BM_edge_select_set(em->bm, eed, TRUE);
                        }
                }
                EDBM_selectmode_flush(em);
@@ -2429,7 +2429,7 @@ static int edbm_select_random_exec(bContext *C, wmOperator *op)
        else {
                BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
                        if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BLI_frand() < randfac) {
-                               BM_elem_select_set(em->bm, efa, TRUE);
+                               BM_face_select_set(em->bm, efa, TRUE);
                        }
                }
                EDBM_selectmode_flush(em);
@@ -2480,14 +2480,14 @@ static int edbm_select_next_loop_exec(bContext *C, wmOperator *UNUSED(op))
                BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
                        if (BM_elem_flag_test(l->v, BM_ELEM_SELECT)) {
                                BM_elem_flag_enable(l->next->v, BM_ELEM_TAG);
-                               BM_elem_select_set(em->bm, l->v, FALSE);
+                               BM_vert_select_set(em->bm, l->v, FALSE);
                        }
                }
        }
 
        BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) {
                if (BM_elem_flag_test(v, BM_ELEM_TAG)) {
-                       BM_elem_select_set(em->bm, v, TRUE);
+                       BM_vert_select_set(em->bm, v, TRUE);
                }
        }
 
index 2c1c25b2a91256140d22cde532aa0a51dbff286d..a0fcae860f6bfdeeb1c73b9a5ac191bf64649968 100644 (file)
@@ -191,7 +191,7 @@ static short edbm_extrude_face_indiv(BMEditMesh *em, wmOperator *op, const char
        BMO_op_exec(em->bm, &bmop);
        
        BMO_ITER (f, &siter, em->bm, &bmop, "faceout", BM_FACE) {
-               BM_elem_select_set(em->bm, f, TRUE);
+               BM_face_select_set(em->bm, f, TRUE);
 
                /* set face vertex normals to face normal */
                BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
@@ -353,8 +353,8 @@ static short edbm_extrude_vert(Object *obedit, BMEditMesh *em, const char hflag,
        BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                if (BM_elem_flag_test(eed, hflag)) {
                        if (hflag & BM_ELEM_SELECT) {
-                               BM_elem_select_set(em->bm, eed->v1, TRUE);
-                               BM_elem_select_set(em->bm, eed->v2, TRUE);
+                               BM_vert_select_set(em->bm, eed->v1, TRUE);
+                               BM_vert_select_set(em->bm, eed->v2, TRUE);
                        }
 
                        BM_elem_flag_enable(eed->v1, hflag & ~BM_ELEM_SELECT);
@@ -363,7 +363,7 @@ static short edbm_extrude_vert(Object *obedit, BMEditMesh *em, const char hflag,
                else {
                        if (BM_elem_flag_test(eed->v1, hflag) && BM_elem_flag_test(eed->v2, hflag)) {
                                if (hflag & BM_ELEM_SELECT) {
-                                       BM_elem_select_set(em->bm, eed, TRUE);
+                                       BM_edge_select_set(em->bm, eed, TRUE);
                                }
 
                                BM_elem_flag_enable(eed, hflag & ~BM_ELEM_SELECT);
@@ -860,7 +860,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
                BMO_op_exec(vc.em->bm, &bmop);
 
                BMO_ITER (v1, &oiter, vc.em->bm, &bmop, "newvertout", BM_VERT) {
-                       BM_elem_select_set(vc.em->bm, v1, TRUE);
+                       BM_vert_select_set(vc.em->bm, v1, TRUE);
                }
 
                if (!EDBM_op_finish(vc.em, &bmop, op, TRUE)) {
@@ -2328,15 +2328,15 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
                                switch (mode) {
                                        case -1: /* aligned */
                                                if (fabs(ev->co[axis] - value) < limit)
-                                                       BM_elem_select_set(em->bm, ev, TRUE);
+                                                       BM_vert_select_set(em->bm, ev, TRUE);
                                                break;
                                        case 0: /* neg */
                                                if (ev->co[axis] > value)
-                                                       BM_elem_select_set(em->bm, ev, TRUE);
+                                                       BM_vert_select_set(em->bm, ev, TRUE);
                                                break;
                                        case 1: /* pos */
                                                if (ev->co[axis] < value)
-                                                       BM_elem_select_set(em->bm, ev, TRUE);
+                                                       BM_vert_select_set(em->bm, ev, TRUE);
                                                break;
                                }
                        }
@@ -2802,7 +2802,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
                        continue;
 
                if (!BM_edge_is_wire(e)) {
-                       BM_elem_select_set(em->bm, e, FALSE);
+                       BM_edge_select_set(em->bm, e, FALSE);
                }
        }
        EDBM_op_callf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_EDGES);
@@ -2813,7 +2813,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO
                        continue;
 
                if (BM_vert_edge_count(v) != 0) {
-                       BM_elem_select_set(em->bm, v, FALSE);
+                       BM_vert_select_set(em->bm, v, FALSE);
                }
        }
 
@@ -2899,7 +2899,7 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOper
                }
 
                /* Select the seed explicitly, in case it has no edges */
-               BM_elem_select_set(bm, v_seed, TRUE);
+               BM_vert_select_set(bm, v_seed, TRUE);
 
                /* Walk from the single vertex, selecting everything connected
                 * to it */
@@ -2910,8 +2910,8 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *editbase, wmOper
 
                e = BMW_begin(&walker, v_seed);
                for (; e; e = BMW_step(&walker)) {
-                       BM_elem_select_set(bm, e->v1, TRUE);
-                       BM_elem_select_set(bm, e->v2, TRUE);
+                       BM_vert_select_set(bm, e->v1, TRUE);
+                       BM_vert_select_set(bm, e->v2, TRUE);
                }
                BMW_end(&walker);
                                
@@ -3487,7 +3487,7 @@ static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op)
                }
 
                if (select) {
-                       BM_elem_select_set(em->bm, efa, TRUE);
+                       BM_face_select_set(em->bm, efa, TRUE);
                }
        }
 
@@ -3535,7 +3535,7 @@ static int edbm_select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
             eve; eve = BM_iter_step(&iter)) {
 
                if (!eve->e) {
-                       BM_elem_select_set(em->bm, eve, TRUE);
+                       BM_vert_select_set(em->bm, eve, TRUE);
                }
        }
 
@@ -3543,7 +3543,7 @@ static int edbm_select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
             eed; eed = BM_iter_step(&iter)) {
 
                if (!eed->l) {
-                       BM_elem_select_set(em->bm, eed, TRUE);
+                       BM_edge_select_set(em->bm, eed, TRUE);
                }
        }
 
index ce4984384ba893cf23d9a169ec982b1016f8dd84..ef428b5b1b7602c243c86141361c6564b8f9ab67 100644 (file)
@@ -148,7 +148,7 @@ static void select_editbmesh_hook(Object *ob, HookModifierData *hmd)
        
        BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                if (nr==hmd->indexar[index]) {
-                       BM_elem_select_set(em->bm, eve, TRUE);
+                       BM_vert_select_set(em->bm, eve, TRUE);
                        if (index < hmd->totindex-1) index++;
                }
 
index 81810c793b8f0e9e737046bce3982f4e5271a196..eb380700a61fdd5d468b3ed497b940867de6fd99 100644 (file)
@@ -597,7 +597,7 @@ static void vgroup_select_verts(Object *ob, int select)
                                if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
                                        dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
                                        if (defvert_find_index(dv, def_nr)) {
-                                               BM_elem_select_set(em->bm, eve, select);
+                                               BM_vert_select_set(em->bm, eve, select);
                                        }
                                }
                        }
index 5646570a6231d85b72aa841064af07c2b394cea6..c6a93a80b2e845e4dae2d5cbfedf107d57523b03 100644 (file)
@@ -474,7 +474,7 @@ static void do_lasso_select_mesh__doSelectVert(void *userData, BMVert *eve, int
        LassoSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
-               BM_elem_select_set(data->vc->em->bm, eve, data->select);
+               BM_vert_select_set(data->vc->em->bm, eve, data->select);
        }
 }
 static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
@@ -486,13 +486,13 @@ static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, int
                        if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)  &&
                            lasso_inside(data->mcords, data->moves, x0, y0) &&
                            lasso_inside(data->mcords, data->moves, x1, y1)) {
-                               BM_elem_select_set(data->vc->em->bm, eed, data->select);
+                               BM_edge_select_set(data->vc->em->bm, eed, data->select);
                                data->done = 1;
                        }
                }
                else {
                        if (lasso_inside_edge(data->mcords, data->moves, x0, y0, x1, y1)) {
-                               BM_elem_select_set(data->vc->em->bm, eed, data->select);
+                               BM_edge_select_set(data->vc->em->bm, eed, data->select);
                        }
                }
        }
@@ -502,7 +502,7 @@ static void do_lasso_select_mesh__doSelectFace(void *userData, BMFace *efa, int
        LassoSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) {
-               BM_elem_select_set(data->vc->em->bm, efa, data->select);
+               BM_face_select_set(data->vc->em->bm, efa, data->select);
        }
 }
 
@@ -1756,7 +1756,7 @@ static void do_mesh_box_select__doSelectVert(void *userData, BMVert *eve, int x,
        BoxSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y)) {
-               BM_elem_select_set(data->vc->em->bm, eve, data->select);
+               BM_vert_select_set(data->vc->em->bm, eve, data->select);
        }
 }
 static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int index)
@@ -1766,13 +1766,13 @@ static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, int x0
        if (EDBM_backbuf_check(bm_solidoffs + index)) {
                if (data->pass == 0) {
                        if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) {
-                               BM_elem_select_set(data->vc->em->bm, eed, data->select);
+                               BM_edge_select_set(data->vc->em->bm, eed, data->select);
                                data->done = 1;
                        }
                }
                else {
                        if (edge_inside_rect(data->rect, x0, y0, x1, y1)) {
-                               BM_elem_select_set(data->vc->em->bm, eed, data->select);
+                               BM_edge_select_set(data->vc->em->bm, eed, data->select);
                        }
                }
        }
@@ -1782,7 +1782,7 @@ static void do_mesh_box_select__doSelectFace(void *userData, BMFace *efa, int x,
        BoxSelectUserData *data = userData;
 
        if (BLI_in_rcti(data->rect, x, y)) {
-               BM_elem_select_set(data->vc->em->bm, efa, data->select);
+               BM_face_select_set(data->vc->em->bm, efa, data->select);
        }
 }
 static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int extend)
@@ -2304,7 +2304,7 @@ static void mesh_circle_doSelectVert(void *userData, BMVert *eve, int x, int y,
        float r = sqrt(mx * mx + my * my);
 
        if (r <= data->radius) {
-               BM_elem_select_set(data->vc->em->bm, eve, data->select);
+               BM_vert_select_set(data->vc->em->bm, eve, data->select);
        }
 }
 static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, int x0, int y0, int x1, int y1, int UNUSED(index))
@@ -2312,7 +2312,7 @@ static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, int x0, int y0
        CircleSelectUserData *data = userData;
 
        if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) {
-               BM_elem_select_set(data->vc->em->bm, eed, data->select);
+               BM_edge_select_set(data->vc->em->bm, eed, data->select);
        }
 }
 static void mesh_circle_doSelectFace(void *userData, BMFace *efa, int x, int y, int UNUSED(index))
@@ -2322,7 +2322,7 @@ static void mesh_circle_doSelectFace(void *userData, BMFace *efa, int x, int y,
        float r = sqrt(mx * mx + my * my);
        
        if (r <= data->radius) {
-               BM_elem_select_set(data->vc->em->bm, efa, data->select);
+               BM_face_select_set(data->vc->em->bm, efa, data->select);
        }
 }
 
index 0559237343a109710129ddaf79a27f12f3783692..59626349ac5ff381753b331ccd22808fb1972b0d 100644 (file)
@@ -4653,12 +4653,12 @@ static int createSlideVerts(TransInfo *t)
                        if (!BLI_smallhash_haskey(&sld->origfaces, (uintptr_t)f)) {
                                BMFace *copyf = BM_face_copy(bm, f, TRUE, TRUE);
                                
-                               BM_elem_select_set(bm, copyf, FALSE);
+                               BM_face_select_set(bm, copyf, FALSE);
                                BM_elem_flag_enable(copyf, BM_ELEM_HIDDEN);
                                BM_ITER_ELEM (l, &liter, copyf, BM_LOOPS_OF_FACE) {
-                                       BM_elem_select_set(bm, l->v, FALSE);
+                                       BM_vert_select_set(bm, l->v, FALSE);
                                        BM_elem_flag_enable(l->v, BM_ELEM_HIDDEN);
-                                       BM_elem_select_set(bm, l->e, FALSE);
+                                       BM_edge_select_set(bm, l->e, FALSE);
                                        BM_elem_flag_enable(l->e, BM_ELEM_HIDDEN);
                                }
 
@@ -4775,7 +4775,7 @@ void projectSVData(TransInfo *t, int final)
                        BM_elem_attrs_copy(em->bm, em->bm, copyf2, f);
                        
                        /* restore selection and hidden flags */
-                       BM_elem_select_set(em->bm, f, sel);
+                       BM_face_select_set(em->bm, f, sel);
                        if (!hide) { /* this check is a workaround for bug, see note - [#30735], without this edge can be hidden and selected */
                                BM_elem_hide_set(em->bm, f, hide);
                        }
index 7eb71ecc9d0eabe2b7ca2768ea2165f7dfaad842..969fa684c808c23266090bdb81ebfb745b42e06c 100644 (file)
@@ -329,7 +329,7 @@ int uvedit_face_select(Scene *scene, BMEditMesh *em, BMFace *efa)
        ToolSettings *ts = scene->toolsettings;
 
        if (ts->uv_flag & UV_SYNC_SELECTION)
-               BM_elem_select_set(em->bm, efa, TRUE);
+               BM_face_select_set(em->bm, efa, TRUE);
        else {
                BMLoop *l;
                MLoopUV *luv;
@@ -351,7 +351,7 @@ int uvedit_face_deselect(Scene *scene, BMEditMesh *em, BMFace *efa)
        ToolSettings *ts = scene->toolsettings;
 
        if (ts->uv_flag & UV_SYNC_SELECTION) {
-               BM_elem_select_set(em->bm, efa, FALSE);
+               BM_face_select_set(em->bm, efa, FALSE);
        }
        else {
                BMLoop *l;
@@ -402,12 +402,12 @@ void uvedit_edge_select(BMEditMesh *em, Scene *scene, BMLoop *l)
 
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                if (ts->selectmode & SCE_SELECT_FACE)
-                       BM_elem_select_set(em->bm, l->f, TRUE);
+                       BM_face_select_set(em->bm, l->f, TRUE);
                else if (ts->selectmode & SCE_SELECT_EDGE)
-                       BM_elem_select_set(em->bm, l->e, TRUE);
+                       BM_edge_select_set(em->bm, l->e, TRUE);
                else {
-                       BM_elem_select_set(em->bm, l->e->v1, TRUE);
-                       BM_elem_select_set(em->bm, l->e->v2, TRUE);
+                       BM_vert_select_set(em->bm, l->e->v1, TRUE);
+                       BM_vert_select_set(em->bm, l->e->v2, TRUE);
                }
        }
        else {
@@ -428,12 +428,12 @@ void uvedit_edge_deselect(BMEditMesh *em, Scene *scene, BMLoop *l)
 
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                if (ts->selectmode & SCE_SELECT_FACE)
-                       BM_elem_select_set(em->bm, l->f, FALSE);
+                       BM_face_select_set(em->bm, l->f, FALSE);
                else if (ts->selectmode & SCE_SELECT_EDGE)
-                       BM_elem_select_set(em->bm, l->e, FALSE);
+                       BM_edge_select_set(em->bm, l->e, FALSE);
                else {
-                       BM_elem_select_set(em->bm, l->e->v1, FALSE);
-                       BM_elem_select_set(em->bm, l->e->v2, FALSE);
+                       BM_vert_select_set(em->bm, l->e->v1, FALSE);
+                       BM_vert_select_set(em->bm, l->e->v2, FALSE);
                }
        }
        else {
@@ -470,9 +470,9 @@ void uvedit_uv_select(BMEditMesh *em, Scene *scene, BMLoop *l)
 
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                if (ts->selectmode & SCE_SELECT_FACE)
-                       BM_elem_select_set(em->bm, l->f, TRUE);
+                       BM_face_select_set(em->bm, l->f, TRUE);
                else
-                       BM_elem_select_set(em->bm, l->v, TRUE);
+                       BM_vert_select_set(em->bm, l->v, TRUE);
        }
        else {
                MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -487,9 +487,9 @@ void uvedit_uv_deselect(BMEditMesh *em, Scene *scene, BMLoop *l)
 
        if (ts->uv_flag & UV_SYNC_SELECTION) {
                if (ts->selectmode & SCE_SELECT_FACE)
-                       BM_elem_select_set(em->bm, l->f, FALSE);
+                       BM_face_select_set(em->bm, l->f, FALSE);
                else
-                       BM_elem_select_set(em->bm, l->v, FALSE);
+                       BM_vert_select_set(em->bm, l->v, FALSE);
        }
        else {
                MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
@@ -3060,7 +3060,7 @@ static int hide_exec(bContext *C, wmOperator *op)
                                if (em->selectmode == SCE_SELECT_FACE) {
                                        /* check that every UV is selected */
                                        if (bm_face_is_all_uv_sel(em->bm, efa, TRUE) == !swap) {
-                                               BM_elem_select_set(em->bm, efa, FALSE);
+                                               BM_face_select_set(em->bm, efa, FALSE);
                                        }
                                        uvedit_face_deselect(scene, em, efa);
                                }
@@ -3069,7 +3069,7 @@ static int hide_exec(bContext *C, wmOperator *op)
                                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                                        if (UV_SEL_TEST(luv, !swap)) {
-                                                               BM_elem_select_set(em->bm, l->v, FALSE);
+                                                               BM_vert_select_set(em->bm, l->v, FALSE);
                                                        }
                                                }
                                        }
@@ -3081,7 +3081,7 @@ static int hide_exec(bContext *C, wmOperator *op)
                        else if (em->selectmode == SCE_SELECT_FACE) {
                                /* check if a UV is de-selected */
                                if (bm_face_is_all_uv_sel(em->bm, efa, FALSE) != !swap) {
-                                       BM_elem_select_set(em->bm, efa, FALSE);
+                                       BM_face_select_set(em->bm, efa, FALSE);
                                        uvedit_face_deselect(scene, em, efa);
                                }
                        }
@@ -3089,7 +3089,7 @@ static int hide_exec(bContext *C, wmOperator *op)
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                        if (UV_SEL_TEST(luv, !swap)) {
-                                               BM_elem_select_set(em->bm, l->v, FALSE);
+                                               BM_vert_select_set(em->bm, l->v, FALSE);
                                                if (!swap) luv->flag &= ~MLOOPUV_VERTSEL;
                                        }
                                }
@@ -3160,7 +3160,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                                luv->flag |= MLOOPUV_VERTSEL;
                                        }
-                                       /* BM_elem_select_set(em->bm, efa, TRUE); */
+                                       /* BM_face_select_set(em->bm, efa, TRUE); */
                                        BM_elem_flag_enable(efa, BM_ELEM_TAG);
                                }
                        }
@@ -3181,7 +3181,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                                                luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                                                luv->flag |= MLOOPUV_VERTSEL;
                                                        }
-                                                       /* BM_elem_select_set(em->bm, efa, TRUE); */
+                                                       /* BM_face_select_set(em->bm, efa, TRUE); */
                                                        BM_elem_flag_enable(efa, BM_ELEM_TAG);
                                                }
                                        }
@@ -3197,7 +3197,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                                                luv->flag |= MLOOPUV_VERTSEL;
                                                        }
                                                }
-                                               /* BM_elem_select_set(em->bm, efa, TRUE); */
+                                               /* BM_face_select_set(em->bm, efa, TRUE); */
                                                BM_elem_flag_enable(efa, BM_ELEM_TAG);
                                        }
                                }
@@ -3212,7 +3212,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                        luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                        luv->flag |= MLOOPUV_VERTSEL;
                                }
-                               /* BM_elem_select_set(em->bm, efa, TRUE); */
+                               /* BM_face_select_set(em->bm, efa, TRUE); */
                                BM_elem_flag_enable(efa, BM_ELEM_TAG);
                        }
                }
@@ -3227,7 +3227,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                                luv->flag |= MLOOPUV_VERTSEL;
                                        }
                                }
-                               /* BM_elem_select_set(em->bm, efa, TRUE); */
+                               /* BM_face_select_set(em->bm, efa, TRUE); */
                                BM_elem_flag_enable(efa, BM_ELEM_TAG);
                        }
                }