diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-27 14:01:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-27 14:01:35 +0400 |
commit | dee671276dcda464dab6dce6a3904e7f373f8d88 (patch) | |
tree | ec02ebdd1e5aaf878fb698970dceb2aa5fda4bc7 /source | |
parent | e293a0b1536520de345a6b9aa467b1de832a8fad (diff) |
rename BM_vert_at_index -> BM_vert_at_index_find (since this searches the mempool).
needed for other changes - coming.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.h | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 12 |
4 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index cc2324ba34a..d6d846e44e4 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -829,17 +829,17 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx) BLI_ghash_free(fptr_map, NULL, NULL); } -BMVert *BM_vert_at_index(BMesh *bm, const int index) +BMVert *BM_vert_at_index_find(BMesh *bm, const int index) { return BLI_mempool_findelem(bm->vpool, index); } -BMEdge *BM_edge_at_index(BMesh *bm, const int index) +BMEdge *BM_edge_at_index_find(BMesh *bm, const int index) { return BLI_mempool_findelem(bm->epool, index); } -BMFace *BM_face_at_index(BMesh *bm, const int index) +BMFace *BM_face_at_index_find(BMesh *bm, const int index) { return BLI_mempool_findelem(bm->fpool, index); } diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h index 583b1589290..23429ec3252 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.h +++ b/source/blender/bmesh/intern/bmesh_mesh.h @@ -49,9 +49,9 @@ int BM_mesh_elem_count(BMesh *bm, const char htype); void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx); -BMVert *BM_vert_at_index(BMesh *bm, const int index); -BMEdge *BM_edge_at_index(BMesh *bm, const int index); -BMFace *BM_face_at_index(BMesh *bm, const int index); +BMVert *BM_vert_at_index_find(BMesh *bm, const int index); +BMEdge *BM_edge_at_index_find(BMesh *bm, const int index); +BMFace *BM_face_at_index_find(BMesh *bm, const int index); typedef struct BMAllocTemplate { int totvert, totedge, totloop, totface; diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index b0dc30d73f7..5d8851640e0 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -400,7 +400,7 @@ static void knife_start_cut(KnifeTool_OpData *kcd) BMVert *v0; knife_input_ray_segment(kcd, kcd->curr.mval, 1.0f, origin, origin_ofs); - v0 = BM_vert_at_index(kcd->em->bm, 0); + v0 = BM_vert_at_index_find(kcd->em->bm, 0); if (v0) { closest_to_line_v3(kcd->prev.cage, v0->co, origin_ofs, origin); copy_v3_v3(kcd->prev.co, kcd->prev.cage); /*TODO: do we need this? */ diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index f975d801d10..92bd71e128a 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -392,7 +392,7 @@ static void findnearestvert__doClosest(void *userData, BMVert *eve, const float static bool findnearestvert__backbufIndextest(void *handle, unsigned int index) { BMEditMesh *em = (BMEditMesh *)handle; - BMVert *eve = BM_vert_at_index(em->bm, index - 1); + BMVert *eve = BM_vert_at_index_find(em->bm, index - 1); return !(eve && BM_elem_flag_test(eve, BM_ELEM_SELECT)); } /** @@ -420,7 +420,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const bool sel, c 0, NULL, NULL); } - eve = index ? BM_vert_at_index(vc->em->bm, index - 1) : NULL; + eve = index ? BM_vert_at_index_find(vc->em->bm, index - 1) : NULL; if (eve && distance < *r_dist) { *r_dist = distance; @@ -436,7 +436,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const bool sel, c static int lastSelectedIndex = 0; static BMVert *lastSelected = NULL; - if (lastSelected && BM_vert_at_index(vc->em->bm, lastSelectedIndex) != lastSelected) { + if (lastSelected && BM_vert_at_index_find(vc->em->bm, lastSelectedIndex) != lastSelected) { lastSelectedIndex = 0; lastSelected = NULL; } @@ -512,7 +512,7 @@ BMEdge *EDBM_edge_find_nearest(ViewContext *vc, float *r_dist) view3d_validate_backbuf(vc); index = view3d_sample_backbuf_rect(vc, vc->mval, 50, bm_solidoffs, bm_wireoffs, &distance, 0, NULL, NULL); - eed = index ? BM_edge_at_index(vc->em->bm, index - 1) : NULL; + eed = index ? BM_edge_at_index_find(vc->em->bm, index - 1) : NULL; if (eed && distance < *r_dist) { *r_dist = distance; @@ -585,7 +585,7 @@ BMFace *EDBM_face_find_nearest(ViewContext *vc, float *r_dist) view3d_validate_backbuf(vc); index = view3d_sample_backbuf(vc, vc->mval[0], vc->mval[1]); - efa = index ? BM_face_at_index(vc->em->bm, index - 1) : NULL; + efa = index ? BM_face_at_index_find(vc->em->bm, index - 1) : NULL; if (efa) { struct { float mval_fl[2]; float dist; BMFace *toFace; } data; @@ -612,7 +612,7 @@ BMFace *EDBM_face_find_nearest(ViewContext *vc, float *r_dist) static int lastSelectedIndex = 0; static BMFace *lastSelected = NULL; - if (lastSelected && BM_face_at_index(vc->em->bm, lastSelectedIndex) != lastSelected) { + if (lastSelected && BM_face_at_index_find(vc->em->bm, lastSelectedIndex) != lastSelected) { lastSelectedIndex = 0; lastSelected = NULL; } |