From 690b90f1e2cb949a3cdfb02678be844c4808f2cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Apr 2015 15:21:40 +1000 Subject: BMesh: minor optimization counting adjacent data add BM_***_count_is_over(), _count_is_equal() Useful if we only want to know if the count is a smaller value. --- source/blender/editors/mesh/editmesh_rip.c | 6 +++--- source/blender/editors/mesh/editmesh_select.c | 4 ++-- source/blender/editors/sculpt_paint/paint_stroke.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index ead243d6de8..45e16ceff7b 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -587,8 +587,8 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve /* if we are ripping a single vertex from 3 faces, * then measure the distance to the face corner as well as the edge */ - if (BM_vert_face_count(v) == 3 && - BM_vert_edge_count(v) == 3) + if (BM_vert_face_count_is_equal(v, 3) && + BM_vert_edge_count_is_equal(v, 3)) { BMEdge *e_all[3]; BMLoop *l_all[3]; @@ -735,7 +735,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve * but both allocate fill */ /* rip two adjacent edges */ - if (BM_edge_is_boundary(e2) || BM_vert_face_count(v) == 2) { + if (BM_edge_is_boundary(e2) || BM_vert_face_count_is_equal(v, 2)) { /* Don't run the edge split operator in this case */ BMVert *v_rip; diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index c020243c8ff..0c3f69e4996 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -2042,7 +2042,7 @@ bool EDBM_select_interior_faces(BMEditMesh *em) ok = true; BM_ITER_ELEM (eed, &eiter, efa, BM_EDGES_OF_FACE) { - if (BM_edge_face_count(eed) < 3) { + if (!BM_edge_face_count_is_over(eed, 2)) { ok = false; break; } @@ -2938,7 +2938,7 @@ static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op) if ((use_wire && BM_edge_is_wire(e)) || (use_boundary && BM_edge_is_boundary(e)) || (use_non_contiguous && (BM_edge_is_manifold(e) && !BM_edge_is_contiguous(e))) || - (use_multi_face && (BM_edge_face_count(e) > 2))) + (use_multi_face && (BM_edge_face_count_is_over(e, 2)))) { /* check we never select perfect edge (in test above) */ BLI_assert(!(BM_edge_is_manifold(e) && BM_edge_is_contiguous(e))); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 0db2259b307..5588d1e589e 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -68,7 +68,7 @@ #include #include -// #define DEBUG_TIME +#define DEBUG_TIME #ifdef DEBUG_TIME # include "PIL_time_utildefines.h" -- cgit v1.2.3