From b6dcdb065d9ca6244f2de9e621439f75cf2c386e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Feb 2012 10:51:45 +0000 Subject: code refactor, function renaming for bmesh. These changes are to make the bmesh api more consistent and easier to learn, grouping similar functions which is convenient for autocomplete. This uses similar convention to RNA. * use face/loop/edge/vert as a prefix for functions. * use 'elem' as a prefix too for functions that can take any type with a BMHeader. * changed from camel case to underscore separated (like RNA). --- source/blender/editors/util/crazyspace.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index c88f6e0d60b..c611a14ae7f 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -146,28 +146,28 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped int *vert_table = MEM_callocN(sizeof(int)*em->bm->totvert, "vert_table"); int index = 0; - BM_ElemIndex_Ensure(em->bm, BM_VERT); + BM_mesh_elem_index_ensure(em->bm, BM_VERT); BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { - if (!BM_TestHFlag(v, BM_ELEM_SELECT) || BM_TestHFlag(v, BM_ELEM_HIDDEN)) + if (!BM_elem_flag_test(v, BM_ELEM_SELECT) || BM_elem_flag_test(v, BM_ELEM_HIDDEN)) continue; BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_VERT, v) { - BMLoop *l2 = BM_OtherFaceLoop(l->e, l->f, v); + BMLoop *l2 = BM_face_other_loop(l->e, l->f, v); /* retrieve mapped coordinates */ - v1= mappedcos + 3*BM_GetIndex(l->v); - v2= mappedcos + 3*BM_GetIndex(BM_OtherEdgeVert(l2->e, l->v)); - v3= mappedcos + 3*BM_GetIndex(BM_OtherEdgeVert(l->e, l->v)); + v1= mappedcos + 3*BM_elem_index_get(l->v); + v2= mappedcos + 3*BM_elem_index_get(BM_edge_other_vert(l2->e, l->v)); + v3= mappedcos + 3*BM_elem_index_get(BM_edge_other_vert(l->e, l->v)); - co1= (origcos)? origcos + 3*BM_GetIndex(l->v) : l->v->co; - co2= (origcos)? origcos + 3*BM_GetIndex(BM_OtherEdgeVert(l2->e, l->v)) : BM_OtherEdgeVert(l2->e, l->v)->co; - co3= (origcos)? origcos + 3*BM_GetIndex(BM_OtherEdgeVert(l->e, l->v)) : BM_OtherEdgeVert(l->e, l->v)->co; + co1= (origcos)? origcos + 3*BM_elem_index_get(l->v) : l->v->co; + co2= (origcos)? origcos + 3*BM_elem_index_get(BM_edge_other_vert(l2->e, l->v)) : BM_edge_other_vert(l2->e, l->v)->co; + co3= (origcos)? origcos + 3*BM_elem_index_get(BM_edge_other_vert(l->e, l->v)) : BM_edge_other_vert(l->e, l->v)->co; set_crazy_vertex_quat(quats, v1, v2, v3, co1, co2, co3); quats+= 4; - vert_table[BM_GetIndex(l->v)] = index+1; + vert_table[BM_elem_index_get(l->v)] = index+1; index++; break; /*just do one corner*/ @@ -177,9 +177,9 @@ void crazyspace_set_quats_editmesh(BMEditMesh *em, float *origcos, float *mapped index = 0; BM_ITER(v, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { if (vert_table[index] != 0) - BM_SetIndex(v, vert_table[index]-1); /* set_dirty! */ + BM_elem_index_set(v, vert_table[index]-1); /* set_dirty! */ else - BM_SetIndex(v, -1); /* set_dirty! */ + BM_elem_index_set(v, -1); /* set_dirty! */ index++; } -- cgit v1.2.3