diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-25 01:19:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-25 01:19:18 +0400 |
commit | 47b6b60e5afd498337653356a52d399b7bf1da38 (patch) | |
tree | 21d6d11e48b62cc1a9860e949e51ca3166ac778f /source/blender/editors | |
parent | d92a4ceb351d6e7d1324e97892bff0b6252c24d5 (diff) |
code cleanup: no functional change - had both EDBM_editselection_* and BM_editselection_* funcs, replace EDBM_ funcs.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 22 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_slide.c | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 73 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 6 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 2 |
12 files changed, 32 insertions, 112 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 10137a5a259..4c503a2687c 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -114,12 +114,8 @@ void EDBM_selectmode_set(struct BMEditMesh *em); void EDBM_selectmode_convert(struct BMEditMesh *em, short oldmode, short selectmode); void undo_push_mesh(struct bContext *C, const char *name); -int EDBM_editselection_active_get(struct BMEditMesh *em, struct BMEditSelection *ese); -void EDBM_editselection_center(float *center, struct BMEditSelection *ese); -void EDBM_editselection_plane(struct BMEditMesh *em, float *plane, struct BMEditSelection *ese); -void EDBM_editselection_normal(float *normal, struct BMEditSelection *ese); int EDBM_vert_color_check(struct BMEditMesh *em); -void EDBM_editselection_validate(struct BMEditMesh *em); + void EDBM_mesh_hide(struct BMEditMesh *em, int swap); void EDBM_mesh_reveal(struct BMEditMesh *em); diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index d7201394855..12174d5b9fa 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -337,9 +337,9 @@ static void ringsel_finish(bContext *C, wmOperator *op) /* sets as active, useful for other tools */ if (em->selectmode & SCE_SELECT_VERTEX) - EDBM_editselection_store(em, &lcd->eed->v1->head); /* low priority TODO, get vertrex close to mouse */ + BM_select_history_store(em->bm, lcd->eed->v1); /* low priority TODO, get vertrex close to mouse */ if (em->selectmode & SCE_SELECT_EDGE) - EDBM_editselection_store(em, &lcd->eed->head); + BM_select_history_store(em->bm, lcd->eed); EDBM_selectmode_flush(lcd->em); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, lcd->ob->data); diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 15e77458e5e..e755df1f076 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -384,7 +384,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) ED_view3d_ob_project_mat_get(rv3d, obedit, projectMat); /* find selected vert - same some time and check history first */ - if (EDBM_editselection_active_get(em, &ese) && ese.htype == BM_VERT) { + if (BM_select_history_active_get(em->bm, &ese) && ese.htype == BM_VERT) { v = (BMVert *)ese.ele; } else { @@ -450,7 +450,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) int vi_best = 0; if (ese.ele) { - EDBM_editselection_remove(em, &ese.ele->head); + BM_select_history_remove(em->bm, ese.ele); } dist = FLT_MAX; @@ -480,7 +480,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) BM_vert_select_set(bm, v, TRUE); if (ese.ele) { - EDBM_editselection_store(em, &v->head); + BM_select_history_store(em->bm, v); } /* splice all others back together */ @@ -573,7 +573,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) if (v_best) { BM_vert_select_set(bm, v_best, TRUE); if (ese.ele) { - EDBM_editselection_store(em, &v_best->head); + BM_select_history_store(em->bm, v_best); } } } diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 6c3984f0979..05352938aba 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -1049,10 +1049,10 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short ring) /* TODO: would be nice if the edge vertex chosen here * was the one closer to the selection pointer, instead * of arbitrarily selecting the first one */ - EDBM_editselection_store(em, &eed->v1->head); + BM_select_history_store(em->bm, eed->v1); } else if (em->selectmode & SCE_SELECT_EDGE) { - EDBM_editselection_store(em, &eed->head); + BM_select_history_store(em->bm, eed); } /* TODO: would be nice if the nearest face that * belongs to the selected edge could be set to @@ -1364,7 +1364,7 @@ static int mouse_mesh_shortest_path(bContext *C, int mval[2]) e_act = (BMEdge *)ese->ele; if (e_act != e) { if (edgetag_shortest_path(vc.scene, em, e_act, e)) { - EDBM_editselection_remove(em, &e_act->head); + BM_select_history_remove(em->bm, e_act); path = 1; } } @@ -1379,9 +1379,9 @@ static int mouse_mesh_shortest_path(bContext *C, int mval[2]) /* even if this is selected it may not be in the selection list */ if (edgetag_context_check(vc.scene, em, e) == 0) - EDBM_editselection_remove(em, &e->head); + BM_select_history_remove(em->bm, e); else - EDBM_editselection_store(em, &e->head); + BM_select_history_store(em->bm, e); /* force drawmode for mesh */ switch (CTX_data_tool_settings(C)->edge_mode) { @@ -1476,31 +1476,31 @@ int mouse_mesh(bContext *C, const int mval[2], short extend) BM_active_face_set(vc.em->bm, efa); if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) { - EDBM_editselection_store(vc.em, &efa->head); + BM_select_history_store(vc.em->bm, efa); BM_face_select_set(vc.em->bm, efa, TRUE); } else if (extend) { - EDBM_editselection_remove(vc.em, &efa->head); + BM_select_history_remove(vc.em->bm, efa); 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_select_history_store(vc.em->bm, eed); BM_edge_select_set(vc.em->bm, eed, TRUE); } else if (extend) { - EDBM_editselection_remove(vc.em, &eed->head); + BM_select_history_remove(vc.em->bm, eed); 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_select_history_store(vc.em->bm, eve); BM_vert_select_set(vc.em->bm, eve, TRUE); } else if (extend) { - EDBM_editselection_remove(vc.em, &eve->head); + BM_select_history_remove(vc.em->bm, eve); BM_vert_select_set(vc.em->bm, eve, FALSE); } } diff --git a/source/blender/editors/mesh/editmesh_slide.c b/source/blender/editors/mesh/editmesh_slide.c index 44f7c388a74..3cbb099a0a9 100644 --- a/source/blender/editors/mesh/editmesh_slide.c +++ b/source/blender/editors/mesh/editmesh_slide.c @@ -216,13 +216,13 @@ static void vtx_slide_confirm(bContext *C, wmOperator *op) } else { /* Store in historty if not merging */ - EDBM_editselection_store(em, &vso->start_vtx->head); + BM_select_history_store(em->bm, vso->start_vtx); } } else { /* Store edit selection of the active vertex, allows other * ops to run without reselecting */ - EDBM_editselection_store(em, &vso->start_vtx->head); + BM_select_history_store(em->bm, vso->start_vtx); } EDBM_selectmode_flush(em); @@ -664,8 +664,8 @@ static int edbm_vertex_slide_exec(bContext *C, wmOperator *op) BM_edge_select_set(bm, vso->sel_edge, TRUE); BM_vert_select_set(bm, vso->start_vtx, TRUE); - EDBM_editselection_store(em, &vso->sel_edge->head); - EDBM_editselection_store(em, &vso->start_vtx->head); + BM_select_history_store(em->bm, vso->sel_edge); + BM_select_history_store(em->bm, vso->start_vtx); ese = (BMEditSelection *)em->bm->selected.last; } distance_t = vso->distance; diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 074c37850f7..4ec3c22d1df 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -465,39 +465,6 @@ void EDBM_select_less(BMEditMesh *em) EDBM_selectmode_flush(em); } -int EDBM_editselection_active_get(BMEditMesh *em, BMEditSelection *ese) -{ - BMEditSelection *ese_last = em->bm->selected.last; - BMFace *efa = BM_active_face_get(em->bm, FALSE); - - ese->next = ese->prev = NULL; - - if (ese_last) { - if (ese_last->htype == BM_FACE) { /* if there is an active face, use it over the last selected face */ - if (efa) { - ese->ele = (BMElem *)efa; - } - else { - ese->ele = ese_last->ele; - } - ese->htype = BM_FACE; - } - else { - ese->ele = ese_last->ele; - ese->htype = ese_last->htype; - } - } - else if (efa) { /* no */ - ese->ele = (BMElem *)efa; - ese->htype = BM_FACE; - } - else { - ese->ele = NULL; - return 0; - } - return 1; -} - void EDBM_flag_disable_all(BMEditMesh *em, const char hflag) { BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, hflag, FALSE); @@ -1272,43 +1239,3 @@ void EDBM_update_generic(bContext *C, BMEditMesh *em, const short do_tessface) BMEdit_RecalcTessellation(em); } } - -/* * Selection History ***************************************************** */ -/* these wrap equivalent bmesh functions. I'm in two minds of it we should - * just use the bm functions directly; on the one hand, there's no real - * need (at the moment) to wrap them, but on the other hand having these - * wrapped avoids a confusing mess of mixing BM_ and EDBM_ namespaces. */ - -void EDBM_editselection_center(float *center, BMEditSelection *ese) -{ - BM_editselection_center(center, ese); -} - -void EDBM_editselection_normal(float *normal, BMEditSelection *ese) -{ - BM_editselection_normal(normal, ese); -} - -/* Calculate a plane that is rightangles to the edge/vert/faces normal - * also make the plane run along an axis that is related to the geometry, - * because this is used for the manipulators Y axis. */ -void EDBM_editselection_plane(BMEditMesh *em, float *plane, BMEditSelection *ese) -{ - BM_editselection_plane(em->bm, plane, ese); -} - -void EDBM_editselection_remove(BMEditMesh *em, BMHeader *ele) -{ - BM_select_history_remove(em->bm, (BMElem *)ele); -} - -void EDBM_editselection_store(BMEditMesh *em, BMHeader *ele) -{ - BM_select_history_store(em->bm, (BMElem *)ele); -} - -void EDBM_editselection_validate(BMEditMesh *em) -{ - BM_select_history_validate(em->bm); -} -/* end select history */ diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 27b1cb6ad54..70ae9704d3e 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -78,9 +78,6 @@ int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop, struct wmOperator *op, const int report); void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); -void EDBM_editselection_store(struct BMEditMesh *em, struct BMHeader *ele); -void EDBM_editselection_validate(struct BMEditMesh *em); -void EDBM_editselection_remove(struct BMEditMesh *em, struct BMHeader *ele); void EDBM_stats_update(struct BMEditMesh *em); /* TODO, move to math_geometry.c */ diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index f19c8891f96..1c1fa4c7fac 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -993,8 +993,8 @@ static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op)) Mesh *me = obedit->data; BMEditSelection ese; - if (EDBM_editselection_active_get(me->edit_btmesh, &ese)) { - EDBM_editselection_center(curs, &ese); + if (BM_select_history_active_get(me->edit_btmesh->bm, &ese)) { + BM_editselection_center(&ese, curs); } mul_m4_v3(obedit->obmat, curs); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 0af4830e3c6..b500398dd76 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1523,8 +1523,8 @@ void calculateCenter(TransInfo *t) BMEditSelection ese; BMEditMesh *em = BMEdit_FromObject(t->obedit); - if (EDBM_editselection_active_get(em, &ese)) { - EDBM_editselection_center(t->center, &ese); + if (BM_select_history_active_get(em->bm, &ese)) { + BM_editselection_center(&ese, t->center); calculateCenter2D(t); break; } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 82e57cca705..5b70b25c894 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -300,8 +300,8 @@ int calc_manipulator_stats(const bContext *C) float vec[3]= {0,0,0}; /* USE LAST SELECTE WITH ACTIVE */ - if (v3d->around==V3D_ACTIVE && EDBM_editselection_active_get(em, &ese)) { - EDBM_editselection_center(vec, &ese); + if ((v3d->around == V3D_ACTIVE) && BM_select_history_active_get(em->bm, &ese)) { + BM_editselection_center(&ese, vec); calc_tw_center(scene, vec); totsel= 1; } diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 2cc9d8fca93..0f929003e8f 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -577,9 +577,9 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], float vec[3]= {0,0,0}; /* USE LAST SELECTED WITH ACTIVE */ - if (activeOnly && EDBM_editselection_active_get(em, &ese)) { - EDBM_editselection_normal(normal, &ese); - EDBM_editselection_plane(em, plane, &ese); + if (activeOnly && BM_select_history_active_get(em->bm, &ese)) { + BM_editselection_normal(&ese, normal); + BM_editselection_plane(&ese, plane); switch (ese.htype) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 45a4772d475..d0486807e8f 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3105,7 +3105,7 @@ static int hide_exec(bContext *C, wmOperator *op) if (em->selectmode != SCE_SELECT_FACE) EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX | SCE_SELECT_EDGE); - EDBM_editselection_validate(em); + BM_select_history_validate(em->bm); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); return OPERATOR_FINISHED; |