diff options
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_construct.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_construct.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_fill_attribute.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_normals.c | 6 |
5 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 57107ed4e37..16e8285902a 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -309,7 +309,11 @@ enum { struct BPy_BMGeneric; extern void bpy_bm_generic_invalidate(struct BPy_BMGeneric *self); -typedef bool (*BMElemFilterFunc)(BMElem *, void *user_data); +typedef bool (*BMElemFilterFunc)(const BMElem *, void *user_data); +typedef bool (*BMVertFilterFunc)(const BMVert *, void *user_data); +typedef bool (*BMEdgeFilterFunc)(const BMEdge *, void *user_data); +typedef bool (*BMFaceFilterFunc)(const BMFace *, void *user_data); +typedef bool (*BMLoopFilterFunc)(const BMLoop *, void *user_data); /* defines */ #define BM_ELEM_CD_SET_INT(ele, offset, f) { CHECK_TYPE_NONCONST(ele); \ diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 7664108f348..3c2a85e9f52 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -116,7 +116,7 @@ BMFace *BM_face_create_quad_tri( */ void BM_face_copy_shared( BMesh *bm, BMFace *f, - BMElemFilterFunc filter_fn, void *user_data) + BMLoopFilterFunc filter_fn, void *user_data) { BMLoop *l_first; BMLoop *l_iter; @@ -149,7 +149,7 @@ void BM_face_copy_shared( for (j = 0; j < 2; j++) { BLI_assert(l_dst[j]->v == l_src[j]->v); if (BM_ELEM_API_FLAG_TEST(l_dst[j], _FLAG_OVERLAP) == 0) { - if ((filter_fn == NULL) || filter_fn((BMElem *)l_src[j], user_data)) { + if ((filter_fn == NULL) || filter_fn(l_src[j], user_data)) { bm_loop_attrs_copy(bm, bm, l_src[j], l_dst[j]); BM_ELEM_API_FLAG_ENABLE(l_dst[j], _FLAG_OVERLAP); } diff --git a/source/blender/bmesh/intern/bmesh_construct.h b/source/blender/bmesh/intern/bmesh_construct.h index 29503679547..ce8b8dd8391 100644 --- a/source/blender/bmesh/intern/bmesh_construct.h +++ b/source/blender/bmesh/intern/bmesh_construct.h @@ -38,7 +38,7 @@ BMFace *BM_face_create_quad_tri( void BM_face_copy_shared( BMesh *bm, BMFace *f, - BMElemFilterFunc filter_fn, void *user_data); + BMLoopFilterFunc filter_fn, void *user_data); BMFace *BM_face_create_ngon( BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, const int len, diff --git a/source/blender/bmesh/operators/bmo_fill_attribute.c b/source/blender/bmesh/operators/bmo_fill_attribute.c index 85bca744d86..233ed746ed4 100644 --- a/source/blender/bmesh/operators/bmo_fill_attribute.c +++ b/source/blender/bmesh/operators/bmo_fill_attribute.c @@ -53,9 +53,9 @@ static bool bm_loop_is_all_radial_tag(BMLoop *l) /** * Callback to run on source-loops for #BM_face_copy_shared */ -static bool bm_loop_is_face_untag(BMElem *ele, void *UNUSED(user_data)) +static bool bm_loop_is_face_untag(const BMLoop *l, void *UNUSED(user_data)) { - return (BM_elem_flag_test(((BMLoop *)ele)->f, BM_ELEM_TAG) == 0); + return (BM_elem_flag_test(l->f, BM_ELEM_TAG) == 0); } /** diff --git a/source/blender/bmesh/operators/bmo_normals.c b/source/blender/bmesh/operators/bmo_normals.c index 1f50feb6d6d..06ceece644b 100644 --- a/source/blender/bmesh/operators/bmo_normals.c +++ b/source/blender/bmesh/operators/bmo_normals.c @@ -41,9 +41,9 @@ #define FACE_FLIP (1 << 1) #define FACE_TEMP (1 << 2) -static bool bmo_recalc_normal_edge_filter_cb(BMElem *ele, void *UNUSED(user_data)) +static bool bmo_recalc_normal_edge_filter_cb(const BMElem *ele, void *UNUSED(user_data)) { - return BM_edge_is_manifold((BMEdge *)ele); + return BM_edge_is_manifold((const BMEdge *)ele); } /** @@ -229,7 +229,7 @@ static void bmo_recalc_face_normals_array(BMesh *bm, BMFace **faces, const int f do { BMLoop *l_other = l_iter->radial_next; - if ((l_other != l_iter) && bmo_recalc_normal_edge_filter_cb((BMElem *)l_iter->e, NULL)) { + if ((l_other != l_iter) && bmo_recalc_normal_edge_filter_cb((const BMElem *)l_iter->e, NULL)) { if (!BMO_elem_flag_test(bm, l_other->f, FACE_TEMP)) { BMO_elem_flag_enable(bm, l_other->f, FACE_TEMP); BMO_elem_flag_set(bm, l_other->f, FACE_FLIP, (l_other->v == l_iter->v) != flip_state); |