diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-28 23:10:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-28 23:10:53 +0400 |
commit | 2a7f1af61ec8e11e73e2c16ca5579baca04bf78a (patch) | |
tree | a9f9c3dd8d0d5d179a4491ca21986f62c4e89854 /source/blender/bmesh | |
parent | d1d11bbe9bc73f8578dbd138d079dc6488b5920d (diff) |
Code Cleanup:
- apply some rules for function naming conventions, added to main bmesh doc in bmesh.h.
- remove unused function BM_loops_to_corners().
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/bmesh.h | 13 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_construct.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 94 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_interp.c | 66 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_interp.h | 5 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_iterators.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 14 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 26 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_structure.c | 20 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_structure.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_mesh_conv.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_removedoubles.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/tools/BME_bevel.c | 6 |
16 files changed, 122 insertions, 160 deletions
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h index 3f00c861731..91e45d640ef 100644 --- a/source/blender/bmesh/bmesh.h +++ b/source/blender/bmesh/bmesh.h @@ -179,6 +179,19 @@ * then spit out a new one; this allows operators to be chained together. * * \note Element buffers may have elements of different types within the same buffer (this is supported by the API. + * + * + * \section bm_fname Function Naming Conventions + * + * These conventions should be used throughout the bmesh module. + * + * - BM_xxx() - High level BMesh API function for use anywhere. + * - bmesh_xxx() - Low level API function. + * - bm_xxx() - 'static' functions, not apart of the API at all, but use prefix since they operate on BMesh data. + * - BMO_xxx() - High level operator API function for use anywhere. + * - bmo_xxx() - Low level / internal operator API functions. + * - _bm_xxx() - Functions which are called via macros only. + * */ #ifdef __cplusplus diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index f6883c5596e..eb6b088a6ac 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -185,7 +185,7 @@ BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, i BLI_array_append(edges2, e); do { - e2 = bmesh_disk_edge_next(e2, v); + e2 = bm_disk_edge_next(e2, v); if (e2 != e && BM_ELEM_API_FLAG_TEST(e2, _FLAG_MF)) { v = BM_edge_other_vert(e2, v); break; diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index d38a898e329..dbf7239fb42 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -41,7 +41,7 @@ * TESTING ONLY! */ // #define USE_DEBUG_INDEX_MEMCHECK -static int bmesh_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget); +static int bm_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget); #ifdef USE_DEBUG_INDEX_MEMCHECK #define DEBUG_MEMCHECK_INDEX_INVALIDATE(ele) \ @@ -129,7 +129,7 @@ BMEdge *BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *example, return e; } -static BMLoop *bmesh_loop_create(BMesh *bm, BMVert *v, BMEdge *e, BMFace *f, const BMLoop *example) +static BMLoop *bm_loop_create(BMesh *bm, BMVert *v, BMEdge *e, BMFace *f, const BMLoop *example) { BMLoop *l = NULL; @@ -157,7 +157,7 @@ static BMLoop *bm_face_boundary_add(BMesh *bm, BMFace *f, BMVert *startv, BMEdge #ifdef USE_BMESH_HOLES BMLoopList *lst = BLI_mempool_calloc(bm->looplistpool); #endif - BMLoop *l = bmesh_loop_create(bm, startv, starte, f, NULL); + BMLoop *l = bm_loop_create(bm, startv, starte, f, NULL); bmesh_radial_append(starte, l); @@ -277,7 +277,7 @@ BMFace *BM_face_create(BMesh *bm, BMVert **verts, BMEdge **edges, const int len, startl->v = verts[0]; startl->e = edges[0]; for (i = 1; i < len; i++) { - l = bmesh_loop_create(bm, verts[i], edges[i], f, edges[i]->l); + l = bm_loop_create(bm, verts[i], edges[i], f, edges[i]->l); l->f = f; bmesh_radial_append(edges[i], l); @@ -434,7 +434,7 @@ int bmesh_elem_check(BMesh *UNUSED(bm), void *element, const char htype) /* low level function, only free's, * does not change adjust surrounding geometry */ -static void bmesh_kill_only_vert(BMesh *bm, BMVert *v) +static void bm_kill_only_vert(BMesh *bm, BMVert *v) { bm->totvert--; bm->elem_index_dirty |= BM_VERT; @@ -447,7 +447,7 @@ static void bmesh_kill_only_vert(BMesh *bm, BMVert *v) BLI_mempool_free(bm->vpool, v); } -static void bmesh_kill_only_edge(BMesh *bm, BMEdge *e) +static void bm_kill_only_edge(BMesh *bm, BMEdge *e) { bm->totedge--; bm->elem_index_dirty |= BM_EDGE; @@ -461,7 +461,7 @@ static void bmesh_kill_only_edge(BMesh *bm, BMEdge *e) BLI_mempool_free(bm->epool, e); } -static void bmesh_kill_only_face(BMesh *bm, BMFace *f) +static void bm_kill_only_face(BMesh *bm, BMFace *f) { if (bm->act_face == f) bm->act_face = NULL; @@ -478,7 +478,7 @@ static void bmesh_kill_only_face(BMesh *bm, BMFace *f) BLI_mempool_free(bm->fpool, f); } -static void bmesh_kill_only_loop(BMesh *bm, BMLoop *l) +static void bm_kill_only_loop(BMesh *bm, BMLoop *l) { bm->totloop--; if (l->head.data) @@ -562,7 +562,7 @@ void BM_face_kill(BMesh *bm, BMFace *f) l_next = l_iter->next; bmesh_radial_loop_remove(l_iter, l_iter->e); - bmesh_kill_only_loop(bm, l_iter); + bm_kill_only_loop(bm, l_iter); } while ((l_iter = l_next) != l_first); @@ -571,7 +571,7 @@ void BM_face_kill(BMesh *bm, BMFace *f) #endif } - bmesh_kill_only_face(bm, f); + bm_kill_only_face(bm, f); } void BM_edge_kill(BMesh *bm, BMEdge *e) @@ -598,7 +598,7 @@ void BM_edge_kill(BMesh *bm, BMEdge *e) } while (l != startl); } - bmesh_kill_only_edge(bm, e); + bm_kill_only_edge(bm, e); } void BM_vert_kill(BMesh *bm, BMVert *v) @@ -608,13 +608,13 @@ void BM_vert_kill(BMesh *bm, BMVert *v) e = v->e; while (v->e) { - nexte = bmesh_disk_edge_next(e, v); + nexte = bm_disk_edge_next(e, v); BM_edge_kill(bm, e); e = nexte; } } - bmesh_kill_only_vert(bm, v); + bm_kill_only_vert(bm, v); } /********** private disk and radial cycle functions ********** */ @@ -634,7 +634,7 @@ void BM_vert_kill(BMesh *bm, BMVert *v) * 1 for success, 0 for failure. */ -static int bmesh_loop_length(BMLoop *l) +static int bm_loop_length(BMLoop *l) { BMLoop *l_first = l; int i = 0; @@ -646,7 +646,7 @@ static int bmesh_loop_length(BMLoop *l) return i; } -static int bmesh_loop_reverse_loop(BMesh *bm, BMFace *f +static int bm_loop_reverse_loop(BMesh *bm, BMFace *f #ifdef USE_BMESH_HOLES , BMLoopList *lst #endif @@ -665,7 +665,7 @@ static int bmesh_loop_reverse_loop(BMesh *bm, BMFace *f BLI_array_staticdeclare(edar, BM_NGON_STACK_SIZE); int i, j, edok, len = 0, do_disps = CustomData_has_layer(&bm->ldata, CD_MDISPS); - len = bmesh_loop_length(l_first); + len = bm_loop_length(l_first); for (i = 0, l_iter = l_first; i < len; i++, l_iter = l_iter->next) { BMEdge *curedge = l_iter->e; @@ -741,11 +741,11 @@ int bmesh_loop_reverse(BMesh *bm, BMFace *f) #ifdef USE_BMESH_HOLES return bmesh_loop_reverse_loop(bm, f, f->loops.first); #else - return bmesh_loop_reverse_loop(bm, f); + return bm_loop_reverse_loop(bm, f); #endif } -static void bmesh_elements_systag_enable(BMesh *UNUSED(bm), void *veles, int tot, int flag) +static void bm_elements_systag_enable(BMesh *UNUSED(bm), void *veles, int tot, int flag) { BMHeader **eles = veles; int i; @@ -755,7 +755,7 @@ static void bmesh_elements_systag_enable(BMesh *UNUSED(bm), void *veles, int tot } } -static void bmesh_elements_systag_disable(BMesh *UNUSED(bm), void *veles, int tot, int flag) +static void bm_elements_systag_disable(BMesh *UNUSED(bm), void *veles, int tot, int flag) { BMHeader **eles = veles; int i; @@ -804,7 +804,7 @@ static int UNUSED_FUNCTION(count_flagged_disk)(BMVert *v, int flag) do { i += BM_ELEM_API_FLAG_TEST(e, flag) ? 1 : 0; - e = bmesh_disk_edge_next(e, v); + e = bm_disk_edge_next(e, v); } while (e != v->e); return i; @@ -834,7 +834,7 @@ static int disk_is_flagged(BMVert *v, int flag) l = l->radial_next; } while (l != e->l); - e = bmesh_disk_edge_next(e, v); + e = bm_disk_edge_next(e, v); } while (e != v->e); return TRUE; @@ -881,7 +881,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface) if (totface == 1) return faces[0]; - bmesh_elements_systag_enable(bm, faces, totface, _FLAG_JF); + bm_elements_systag_enable(bm, faces, totface, _FLAG_JF); for (i = 0; i < totface; i++) { f = faces[i]; @@ -992,7 +992,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface) } while ((l_iter = l_iter->next) != l_first); } - bmesh_elements_systag_disable(bm, faces, totface, _FLAG_JF); + bm_elements_systag_disable(bm, faces, totface, _FLAG_JF); BM_ELEM_API_FLAG_DISABLE(newf, _FLAG_JF); /* handle multires data */ @@ -1021,7 +1021,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface) BM_CHECK_ELEMENT(bm, newf); return newf; error: - bmesh_elements_systag_disable(bm, faces, totface, _FLAG_JF); + bm_elements_systag_disable(bm, faces, totface, _FLAG_JF); BLI_array_free(edges); BLI_array_free(deledges); BLI_array_free(delverts); @@ -1032,7 +1032,9 @@ error: return NULL; } -static BMFace *bmesh_addpolylist(BMesh *bm, BMFace *UNUSED(example)) +/* BMESH_TODO - this is only used once, investigate sharing code with BM_face_create + */ +static BMFace *bm_face_create__internal(BMesh *bm, BMFace *UNUSED(example)) { BMFace *f; #ifdef USE_BMESH_HOLES @@ -1142,9 +1144,9 @@ BMFace *bmesh_sfme(BMesh *bm, BMFace *f, BMVert *v1, BMVert *v2, /* allocate new edge between v1 and v2 */ e = BM_edge_create(bm, v1, v2, example, FALSE); - f2 = bmesh_addpolylist(bm, f); - f1loop = bmesh_loop_create(bm, v2, e, f, v2loop); - f2loop = bmesh_loop_create(bm, v1, e, f2, v1loop); + f2 = bm_face_create__internal(bm, f); + f1loop = bm_loop_create(bm, v2, e, f, v2loop); + f2loop = bm_loop_create(bm, v1, e, f2, v1loop); f1loop->prev = v2loop->prev; f2loop->prev = v1loop->prev; @@ -1292,7 +1294,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) nextl = nextl != nextl->radial_next ? nextl->radial_next : NULL; bmesh_radial_loop_remove(l, NULL); - nl = bmesh_loop_create(bm, NULL, NULL, l->f, l); + nl = bm_loop_create(bm, NULL, NULL, l->f, l); nl->prev = l; nl->next = (l->next); nl->prev->next = nl; @@ -1434,7 +1436,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou len = bmesh_disk_count(kv); if (len == 2) { - oe = bmesh_disk_edge_next(ke, kv); + oe = bm_disk_edge_next(ke, kv); tv = bmesh_edge_other_vert_get(ke, kv); ov = bmesh_edge_other_vert_get(oe, kv); halt = bmesh_verts_in_edge(kv, tv, oe); /* check for double edge */ @@ -1510,10 +1512,10 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou } /* deallocate edg */ - bmesh_kill_only_edge(bm, ke); + bm_kill_only_edge(bm, ke); /* deallocate verte */ - bmesh_kill_only_vert(bm, kv); + bm_kill_only_vert(bm, kv); /* Validate disk cycle lengths of ov, tv are unchange */ edok = bmesh_disk_validate(valence1, ov->e, ov); @@ -1538,7 +1540,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *ke, BMVert *kv, const short check_edge_dou if (check_edge_double) { if (e_splice) { /* removes e_splice */ - bmesh_edge_splice(bm, e_splice, oe); + bm_edge_splice(bm, e_splice, oe); } } @@ -1713,7 +1715,7 @@ BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e) * * merges two verts into one (v into vtarget). */ -static int bmesh_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget) +static int bm_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget) { BMEdge *e; BMLoop *l; @@ -1730,12 +1732,10 @@ static int bmesh_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget) } /* move all the edges from v's disk to vtarget's disk */ - e = v->e; - while (e != NULL) { + while ((e = v->e)) { bmesh_disk_edge_remove(e, v); bmesh_edge_swapverts(e, v, vtarget); bmesh_disk_edge_append(e, vtarget); - e = v->e; } BM_CHECK_ELEMENT(bm, v); @@ -1753,7 +1753,7 @@ static int bmesh_vert_splice(BMesh *bm, BMVert *v, BMVert *vtarget) * vertex for each region. returns an array of all resulting * vertices. */ -static int bmesh_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len) +static int bm_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len) { BMEdge **stack = NULL; BLI_array_declare(stack); @@ -1856,7 +1856,7 @@ static int bmesh_vert_cut(BMesh *bm, BMVert *v, BMVert ***vout, int *len) * * edges must already have the same vertices */ -static int bmesh_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget) +static int bm_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget) { BMLoop *l; @@ -1893,7 +1893,7 @@ static int bmesh_edge_splice(BMesh *bm, BMEdge *e, BMEdge *etarget) * Does nothing if cutl is already the only loop in the * edge radial. */ -static int bmesh_edge_cut(BMesh *bm, BMEdge *e, BMLoop *cutl) +static int bm_edge_cut(BMesh *bm, BMEdge *e, BMLoop *cutl) { BMEdge *ne; int radlen; @@ -1930,7 +1930,7 @@ static int bmesh_edge_cut(BMesh *bm, BMEdge *e, BMLoop *cutl) * * Disconnects a face from its vertex fan at loop sl. */ -static BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl) +static BMVert *bm_urmv_loop(BMesh *bm, BMLoop *sl) { BMVert **vtar; int len, i; @@ -1939,8 +1939,8 @@ static BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl) /* peel the face from the edge radials on both sides of the * loop vert, disconnecting the face from its fan */ - bmesh_edge_cut(bm, sl->e, sl); - bmesh_edge_cut(bm, sl->prev->e, sl->prev); + bm_edge_cut(bm, sl->e, sl); + bm_edge_cut(bm, sl->prev->e, sl->prev); if (bmesh_disk_count(sv) == 2) { /* If there are still only two edges out of sv, then @@ -1953,12 +1953,12 @@ static BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl) * will leave the original sv on some *other* fan (not the * one-face fan that holds the unglue face). */ while (sv->e == sl->e || sv->e == sl->prev->e) { - sv->e = bmesh_disk_edge_next(sv->e, sv); + sv->e = bm_disk_edge_next(sv->e, sv); } /* Split all fans connected to the vert, duplicating it for * each fans. */ - bmesh_vert_cut(bm, sv, &vtar, &len); + bm_vert_cut(bm, sv, &vtar, &len); /* There should have been at least two fans cut apart here, * otherwise the early exit would have kicked in. */ @@ -1988,7 +1988,7 @@ static BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *sl) /* And then glue the rest back together */ for (i = 1; i < len - 1; i++) { - bmesh_vert_splice(bm, vtar[i], vtar[0]); + bm_vert_splice(bm, vtar[i], vtar[0]); } } } @@ -2020,5 +2020,5 @@ BMVert *bmesh_urmv(BMesh *bm, BMFace *sf, BMVert *sv) return NULL; } - return bmesh_urmv_loop(bm, l_iter); + return bm_urmv_loop(bm, l_iter); } diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index 93a31a34dcd..28a9a36ed02 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -145,52 +145,6 @@ void BM_data_interp_face_vert_edge(BMesh *bm, BMVert *v1, BMVert *UNUSED(v2), BM } while ((l_iter = l_iter->radial_next) != e1->l); } -/* convert MLoop*** in a bmface to mtface and mcol in - * an MFace */ -void BM_loops_to_corners(BMesh *bm, Mesh *me, int findex, - BMFace *f, int numTex, int numCol) -{ - BMLoop *l; - BMIter iter; - MTFace *texface; - MTexPoly *texpoly; - MCol *mcol; - MLoopCol *mloopcol; - MLoopUV *mloopuv; - int i, j; - - for (i = 0; i < numTex; i++) { - texface = CustomData_get_n(&me->fdata, CD_MTFACE, findex, i); - texpoly = CustomData_bmesh_get_n(&bm->pdata, f->head.data, CD_MTEXPOLY, i); - - ME_MTEXFACE_CPY(texface, texpoly); - - j = 0; - BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) { - mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPUV, i); - copy_v2_v2(texface->uv[j], mloopuv->uv); - - j++; - } - - } - - for (i = 0; i < numCol; i++) { - mcol = CustomData_get_n(&me->fdata, CD_MCOL, findex, i); - - j = 0; - BM_ITER(l, &iter, bm, BM_LOOPS_OF_FACE, f) { - mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPCOL, i); - mcol[j].r = mloopcol->r; - mcol[j].g = mloopcol->g; - mcol[j].b = mloopcol->b; - mcol[j].a = mloopcol->a; - - j++; - } - } -} - /** * BM_data_interp_from_face * @@ -413,8 +367,8 @@ static int mdisp_in_mdispquad(BMesh *bm, BMLoop *l, BMLoop *tl, float p[3], floa return 1; } -static float bmesh_loop_flip_equotion(float mat[2][2], float b[2], float target_axis_x[3], float target_axis_y[3], - float coord[3], int i, int j) +static float bm_loop_flip_equotion(float mat[2][2], float b[2], float target_axis_x[3], float target_axis_y[3], + float coord[3], int i, int j) { mat[0][0] = target_axis_x[i]; mat[0][1] = target_axis_y[i]; @@ -426,7 +380,7 @@ static float bmesh_loop_flip_equotion(float mat[2][2], float b[2], float target_ return mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0]; } -static void bmesh_loop_flip_disp(float source_axis_x[3], float source_axis_y[3], +static void bm_loop_flip_disp(float source_axis_x[3], float source_axis_y[3], float target_axis_x[3], float target_axis_y[3], float disp[3]) { float vx[3], vy[3], coord[3]; @@ -442,19 +396,19 @@ static void bmesh_loop_flip_disp(float source_axis_x[3], float source_axis_y[3], project_v3_v3v3(vec, coord, n); sub_v3_v3v3(coord, coord, vec); - d = bmesh_loop_flip_equotion(mat, b, target_axis_x, target_axis_y, coord, 0, 1); + d = bm_loop_flip_equotion(mat, b, target_axis_x, target_axis_y, coord, 0, 1); if (fabsf(d) < 1e-4) { - d = bmesh_loop_flip_equotion(mat, b, target_axis_x, target_axis_y, coord, 0, 2); + d = bm_loop_flip_equotion(mat, b, target_axis_x, target_axis_y, coord, 0, 2); if (fabsf(d) < 1e-4) - d = bmesh_loop_flip_equotion(mat, b, target_axis_x, target_axis_y, coord, 1, 2); + d = bm_loop_flip_equotion(mat, b, target_axis_x, target_axis_y, coord, 1, 2); } disp[0] = (b[0] * mat[1][1] - mat[0][1] * b[1]) / d; disp[1] = (mat[0][0] * b[1] - b[0] * mat[1][0]) / d; } -static void bmesh_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source) +static void bm_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source) { MDisps *mdisps; BMLoop *l_iter; @@ -519,7 +473,7 @@ static void bmesh_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source) if (mdisp_in_mdispquad(bm, target, l_iter, co, &x2, &y2, res, src_axis_x, src_axis_y)) { old_mdisps_bilinear(md1->disps[iy * res + ix], md2->disps, res, (float)x2, (float)y2); - bmesh_loop_flip_disp(src_axis_x, src_axis_y, axis_x, axis_y, md1->disps[iy * res + ix]); + bm_loop_flip_disp(src_axis_x, src_axis_y, axis_x, axis_y, md1->disps[iy * res + ix]); break; } @@ -639,7 +593,7 @@ void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f) */ void BM_loop_interp_multires(BMesh *bm, BMLoop *target, BMFace *source) { - bmesh_loop_interp_mdisps(bm, target, source); + bm_loop_interp_mdisps(bm, target, source); } /** @@ -718,7 +672,7 @@ void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source, if (do_multires) { if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) { - bmesh_loop_interp_mdisps(bm, target, source); + bm_loop_interp_mdisps(bm, target, source); } } } diff --git a/source/blender/bmesh/intern/bmesh_interp.h b/source/blender/bmesh/intern/bmesh_interp.h index 260784bce3e..0d97fbcc0ec 100644 --- a/source/blender/bmesh/intern/bmesh_interp.h +++ b/source/blender/bmesh/intern/bmesh_interp.h @@ -27,8 +27,6 @@ * \ingroup bmesh */ -struct Mesh; - void BM_loop_interp_multires(BMesh *bm, BMLoop *target, BMFace *source); void BM_vert_interp_from_face(BMesh *bm, BMVert *v, BMFace *source); @@ -47,7 +45,4 @@ void BM_loop_interp_from_face(BMesh *bm, BMLoop *target, BMFace *source, void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f); -void BM_loops_to_corners(BMesh *bm, struct Mesh *me, int findex, - BMFace *f, int numTex, int numCol); - #endif /* __BMESH_INTERP_H__ */ diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c index b2945ace8f3..78e82461a54 100644 --- a/source/blender/bmesh/intern/bmesh_iterators.c +++ b/source/blender/bmesh/intern/bmesh_iterators.c @@ -197,7 +197,7 @@ void *bmiter__edge_of_vert_step(BMIter *iter) BMEdge *current = iter->nextedge; if (iter->nextedge) - iter->nextedge = bmesh_disk_edge_next(iter->nextedge, iter->vdata); + iter->nextedge = bm_disk_edge_next(iter->nextedge, iter->vdata); if (iter->nextedge == iter->firstedge) iter->nextedge = NULL; diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 80a557771c6..31b433db451 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -46,7 +46,7 @@ /* used as an extern, defined in bmesh.h */ int bm_mesh_allocsize_default[4] = {512, 512, 2048, 512}; -static void bmesh_mempool_init(BMesh *bm, const int allocsize[4]) +static void bm_mempool_init(BMesh *bm, const int allocsize[4]) { bm->vpool = BLI_mempool_create(sizeof(BMVert), allocsize[0], allocsize[0], FALSE, TRUE); bm->epool = BLI_mempool_create(sizeof(BMEdge), allocsize[1], allocsize[1], FALSE, TRUE); @@ -79,7 +79,7 @@ BMesh *BM_mesh_create(struct Object *ob, const int allocsize[4]) bm->ob = ob; /* allocate the memory pools for the mesh elements */ - bmesh_mempool_init(bm, allocsize); + bm_mempool_init(bm, allocsize); /* allocate one flag pool that we dont get rid of. */ bm->stackdepth = 1; @@ -172,7 +172,7 @@ void BM_mesh_clear(BMesh *bm) bm->ob = ob; /* allocate the memory pools for the mesh elements */ - bmesh_mempool_init(bm, bm_mesh_allocsize_default); + bm_mempool_init(bm, bm_mesh_allocsize_default); bm->stackdepth = 1; bm->totflags = 1; @@ -322,7 +322,7 @@ void BM_mesh_normals_update(BMesh *bm, const short skip_hidden) */ //keep in sycn with utils.c! #define FACE_FLIP 8 -static void bmesh_rationalize_normals(BMesh *bm, int undo) +static void bm_rationalize_normals(BMesh *bm, int undo) { BMOperator bmop; BMFace *f; @@ -352,7 +352,7 @@ static void bmesh_rationalize_normals(BMesh *bm, int undo) BMO_op_finish(bm, &bmop); } -static void bmesh_mdisps_space_set(BMesh *bm, int from, int to) +static void bm_mdisps_space_set(BMesh *bm, int from, int to) { /* switch multires data out of tangent space */ if (CustomData_has_layer(&bm->ldata, CD_MDISPS)) { @@ -434,7 +434,7 @@ void bmesh_edit_begin(BMesh *bm, int flag) } #else if (flag & BMO_OP_FLAG_RATIONALIZE_NORMALS) { - bmesh_rationalize_normals(bm, 0); + bm_rationalize_normals(bm, 0); } #endif } @@ -454,7 +454,7 @@ void bmesh_edit_end(BMesh *bm, int flag) } #else if (flag & BMO_OP_FLAG_RATIONALIZE_NORMALS) { - bmesh_rationalize_normals(bm, 1); + bm_rationalize_normals(bm, 1); } #endif diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 16b2c248519..693584d043a 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -113,7 +113,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v) /* v->e we keep, what else */ e = v->e; do { - e = bmesh_disk_edge_next(e, v); + e = bm_disk_edge_next(e, v); if (!(BM_edge_share_face_count(e, v->e))) { keepedge = e; baseedge = v->e; @@ -180,7 +180,7 @@ int BM_disk_dissolve(BMesh *bm, BMVert *v) done = 0; break; } - e = bmesh_disk_edge_next(e, v); + e = bm_disk_edge_next(e, v); } while (e != v->e); } @@ -426,7 +426,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac, /* now interpolate the vertex data */ BM_data_interp_from_verts(bm, kv, tv, kv, fac); - e2 = bmesh_disk_edge_next(ke, kv); + e2 = bm_disk_edge_next(ke, kv); tv2 = BM_edge_other_vert(e2, kv); if (join_faces) { diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index c2054a52afc..25c1a907382 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -43,9 +43,9 @@ static void bmo_flag_layer_alloc(BMesh *bm); static void bmo_flag_layer_free(BMesh *bm); static void bmo_flag_layer_clear(BMesh *bm); -static int bmesh_name_to_slotcode(BMOpDefine *def, const char *name); -static int bmesh_name_to_slotcode_check(BMOpDefine *def, const char *name); -static int bmesh_opname_to_opcode(const char *opname); +static int bmo_name_to_slotcode(BMOpDefine *def, const char *name); +static int bmo_name_to_slotcode_check(BMOpDefine *def, const char *name); +static int bmo_opname_to_opcode(const char *opname); static const char *bmo_error_messages[] = { NULL, @@ -131,7 +131,7 @@ void BMO_pop(BMesh *bm) */ void BMO_op_init(BMesh *bm, BMOperator *op, const char *opname) { - int i, opcode = bmesh_opname_to_opcode(opname); + int i, opcode = bmo_opname_to_opcode(opname); #ifdef DEBUG BM_ELEM_INDEX_VALIDATE(bm, "pre bmo", opname); @@ -221,7 +221,7 @@ void BMO_op_finish(BMesh *bm, BMOperator *op) */ int BMO_slot_exists(BMOperator *op, const char *slotname) { - int slotcode = bmesh_name_to_slotcode(opdefines[op->type], slotname); + int slotcode = bmo_name_to_slotcode(opdefines[op->type], slotname); return (slotcode >= 0); } @@ -233,7 +233,7 @@ int BMO_slot_exists(BMOperator *op, const char *slotname) */ BMOpSlot *BMO_slot_get(BMOperator *op, const char *slotname) { - int slotcode = bmesh_name_to_slotcode_check(opdefines[op->type], slotname); + int slotcode = bmo_name_to_slotcode_check(opdefines[op->type], slotname); if (slotcode < 0) { return &BMOpEmptySlot; @@ -859,7 +859,7 @@ int BMO_vert_edge_flags_count(BMesh *bm, BMVert *v, const short oflag) for (i = 0, curedge = v->e; i < len; i++) { if (BMO_elem_flag_test(bm, curedge, oflag)) count++; - curedge = bmesh_disk_edge_next(curedge, v); + curedge = bm_disk_edge_next(curedge, v); } } @@ -1187,7 +1187,7 @@ int BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op) #define NEXT_CHAR(fmt) ((fmt)[0] != 0 ? (fmt)[1] : 0) -static int bmesh_name_to_slotcode(BMOpDefine *def, const char *name) +static int bmo_name_to_slotcode(BMOpDefine *def, const char *name) { int i; @@ -1200,9 +1200,9 @@ static int bmesh_name_to_slotcode(BMOpDefine *def, const char *name) return -1; } -static int bmesh_name_to_slotcode_check(BMOpDefine *def, const char *name) +static int bmo_name_to_slotcode_check(BMOpDefine *def, const char *name) { - int i = bmesh_name_to_slotcode(def, name); + int i = bmo_name_to_slotcode(def, name); if (i < 0) { fprintf(stderr, "%s: ! could not find bmesh slot for name %s! (bmesh internal error)\n", __func__, name); } @@ -1210,7 +1210,7 @@ static int bmesh_name_to_slotcode_check(BMOpDefine *def, const char *name) return i; } -static int bmesh_opname_to_opcode(const char *opname) +static int bmo_opname_to_opcode(const char *opname) { int i; @@ -1264,7 +1264,7 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) fmt += i + (noslot ? 0 : 1); - i = bmesh_opname_to_opcode(opname); + i = bmo_opname_to_opcode(opname); if (i == -1) { MEM_freeN(ofmt); @@ -1295,7 +1295,7 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist) fmt[i] = 0; - if (bmesh_name_to_slotcode_check(def, fmt) < 0) GOTO_ERROR; + if (bmo_name_to_slotcode_check(def, fmt) < 0) GOTO_ERROR; BLI_strncpy(slotname, fmt, sizeof(slotname)); diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index ab4bc0810de..a293cfe3427 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -262,7 +262,7 @@ int BM_vert_is_wire(BMesh *UNUSED(bm), BMVert *v) return FALSE; } - curedge = bmesh_disk_edge_next(curedge, v); + curedge = bm_disk_edge_next(curedge, v); } while (curedge != v->e); return TRUE; @@ -297,7 +297,7 @@ int BM_vert_is_manifold(BMesh *UNUSED(bm), BMVert *v) /* count edges while looking for non-manifold edges */ oe = v->e; - for (len = 0, e = v->e; e != oe || (e == oe && len == 0); len++, e = bmesh_disk_edge_next(e, v)) { + for (len = 0, e = v->e; e != oe || (e == oe && len == 0); len++, e = bm_disk_edge_next(e, v)) { if (e->l == NULL) { /* loose edge */ return FALSE; @@ -507,9 +507,9 @@ float BM_vert_edge_angle(BMesh *UNUSED(bm), BMVert *v) * get the edges and count them both at once */ if ((e1 = v->e) && - (e2 = bmesh_disk_edge_next(e1, v)) && + (e2 = bm_disk_edge_next(e1, v)) && /* make sure we come full circle and only have 2 connected edges */ - (e1 == bmesh_disk_edge_next(e2, v))) + (e1 == bm_disk_edge_next(e2, v))) { BMVert *v1 = BM_edge_other_vert(e1, v); BMVert *v2 = BM_edge_other_vert(e2, v); diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c index 8dc6a5c6029..93b1b1d5866 100644 --- a/source/blender/bmesh/intern/bmesh_structure.c +++ b/source/blender/bmesh/intern/bmesh_structure.c @@ -206,7 +206,7 @@ void bmesh_disk_edge_remove(struct BMEdge *e, struct BMVert *v) * Pointer to the next edge in the disk cycle for the vertex v. */ -struct BMEdge *bmesh_disk_edge_next(struct BMEdge *e, struct BMVert *v) +struct BMEdge *bm_disk_edge_next(struct BMEdge *e, struct BMVert *v) { if (v == e->v1) return e->v1_disk_link.next; @@ -215,7 +215,7 @@ struct BMEdge *bmesh_disk_edge_next(struct BMEdge *e, struct BMVert *v) return NULL; } -static BMEdge *bmesh_disk_edge_prev(BMEdge *e, BMVert *v) +static BMEdge *bm_disk_edge_prev(BMEdge *e, BMVert *v) { if (v == e->v1) return e->v1_disk_link.prev; @@ -235,7 +235,7 @@ BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2) if (bmesh_verts_in_edge(v1, v2, e_iter)) { return e_iter; } - } while ((e_iter = bmesh_disk_edge_next(e_iter, v1)) != e_first); + } while ((e_iter = bm_disk_edge_next(e_iter, v1)) != e_first); } return NULL; @@ -259,7 +259,7 @@ int bmesh_disk_count(struct BMVert *v) return 0; } count++; - } while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e_first); + } while ((e_iter = bm_disk_edge_next(e_iter, v)) != e_first); return count; } else { @@ -278,10 +278,10 @@ int bmesh_disk_validate(int len, BMEdge *e, BMVert *v) e_iter = e; do { - if (len != 1 && bmesh_disk_edge_prev(e_iter, v) == e_iter) { + if (len != 1 && bm_disk_edge_prev(e_iter, v) == e_iter) { return FALSE; } - } while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e); + } while ((e_iter = bm_disk_edge_next(e_iter, v)) != e); return TRUE; } @@ -308,7 +308,7 @@ int bmesh_disk_facevert_count(BMVert *v) if (e_iter->l) { count += bmesh_radial_facevert_count(e_iter->l, v); } - } while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e_first); + } while ((e_iter = bm_disk_edge_next(e_iter, v)) != e_first); return count; } else { @@ -333,7 +333,7 @@ struct BMEdge *bmesh_disk_faceedge_find_first(struct BMEdge *e, struct BMVert *v if (searchedge->l && bmesh_radial_facevert_count(searchedge->l, v)) { return searchedge; } - } while ((searchedge = bmesh_disk_edge_next(searchedge, v)) != e); + } while ((searchedge = bm_disk_edge_next(searchedge, v)) != e); return NULL; } @@ -341,12 +341,12 @@ struct BMEdge *bmesh_disk_faceedge_find_first(struct BMEdge *e, struct BMVert *v struct BMEdge *bmesh_disk_faceedge_find_next(struct BMEdge *e, struct BMVert *v) { BMEdge *searchedge = NULL; - searchedge = bmesh_disk_edge_next(e, v); + searchedge = bm_disk_edge_next(e, v); do { if (searchedge->l && bmesh_radial_facevert_count(searchedge->l, v)) { return searchedge; } - } while ((searchedge = bmesh_disk_edge_next(searchedge, v)) != e); + } while ((searchedge = bm_disk_edge_next(searchedge, v)) != e); return e; } diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h index ba7f83b73e2..555e52fde87 100644 --- a/source/blender/bmesh/intern/bmesh_structure.h +++ b/source/blender/bmesh/intern/bmesh_structure.h @@ -47,7 +47,7 @@ int bmesh_loop_validate(BMFace *f); /* DISK CYCLE MANAGMENT */ int bmesh_disk_edge_append(BMEdge *e, BMVert *v); void bmesh_disk_edge_remove(BMEdge *e, BMVert *v); -BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v); +BMEdge *bm_disk_edge_next(BMEdge *e, BMVert *v); int bmesh_disk_facevert_count(BMVert *v); BMEdge *bmesh_disk_faceedge_find_first(BMEdge *e, BMVert *v); BMEdge *bmesh_disk_faceedge_find_next(BMEdge *e, BMVert *v); diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index 93ddee602c9..0a5c3d0752e 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -374,7 +374,7 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op) } -static BMVert **bmesh_to_mesh_vertex_map(BMesh *bm, int ototvert) +static BMVert **bm_to_mesh_vertex_map(BMesh *bm, int ototvert) { BMVert **vertMap = NULL; BMVert *eve; @@ -600,7 +600,7 @@ void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) if (ob->parent == bm->ob && ELEM(ob->partype, PARVERT1, PARVERT3)) { if (vertMap == NULL) { - vertMap = bmesh_to_mesh_vertex_map(bm, ototvert); + vertMap = bm_to_mesh_vertex_map(bm, ototvert); } if (ob->par1 < ototvert) { @@ -623,7 +623,7 @@ void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) HookModifierData *hmd = (HookModifierData *) md; if (vertMap == NULL) { - vertMap = bmesh_to_mesh_vertex_map(bm, ototvert); + vertMap = bm_to_mesh_vertex_map(bm, ototvert); } for (i = j = 0; i < hmd->totindex; i++) { diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index fbc247abe4f..dce060d326f 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -413,7 +413,7 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op) } /* uv collapse functio */ -static void bmesh_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer) +static void bmo_collapsecon_do_layer(BMesh *bm, BMOperator *op, int layer) { BMIter iter, liter; BMFace *f; @@ -472,7 +472,7 @@ void bmo_collapse_uvs_exec(BMesh *bm, BMOperator *op) for (i = 0; i < bm->ldata.totlayer; i++) { if (CustomData_layer_has_math(&bm->ldata, i)) - bmesh_collapsecon_do_layer(bm, op, i); + bmo_collapsecon_do_layer(bm, op, i); } } diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index cf950616471..278512a29c3 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -140,7 +140,7 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op) #define SEL_FLAG 1 #define SEL_ORIG 2 -static void bmesh_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) +static void bmo_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) { BMVert *v; BMEdge *e; @@ -179,7 +179,7 @@ static void bmesh_regionextend_extend(BMesh *bm, BMOperator *op, int usefaces) } } -static void bmesh_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) +static void bmo_regionextend_constrict(BMesh *bm, BMOperator *op, int usefaces) { BMVert *v; BMEdge *e; @@ -229,9 +229,9 @@ void bmo_regionextend_exec(BMesh *bm, BMOperator *op) BMO_slot_buffer_flag_enable(bm, op, "geom", SEL_ORIG, BM_ALL); if (constrict) - bmesh_regionextend_constrict(bm, op, use_faces); + bmo_regionextend_constrict(bm, op, use_faces); else - bmesh_regionextend_extend(bm, op, use_faces); + bmo_regionextend_extend(bm, op, use_faces); BMO_slot_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL); } diff --git a/source/blender/bmesh/tools/BME_bevel.c b/source/blender/bmesh/tools/BME_bevel.c index 2db74ea0ea4..24309edb4ca 100644 --- a/source/blender/bmesh/tools/BME_bevel.c +++ b/source/blender/bmesh/tools/BME_bevel.c @@ -152,7 +152,7 @@ static int BME_Bevel_Dissolve_Disk(BMesh *bm, BMVert *v) } e = v->e; - elast = bmesh_disk_edge_next(e, v); + elast = bm_disk_edge_next(e, v); /* BMESH_TODO, figure out if its possible we had a double edge here and need to splice it, * last bool arg */ @@ -274,7 +274,7 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l, return NULL; } e1 = v->e; /* we just use the first two edges */ - e2 = bmesh_disk_edge_next(v->e, v); + e2 = bm_disk_edge_next(v->e, v); if (e1 == e2) { //printf("You need at least two edges to use BME_bevel_split_edge()\n"); return NULL; @@ -964,7 +964,7 @@ static BMesh *BME_bevel_mesh(BMesh *bm, float value, int UNUSED(res), int option BM_face_split(bm, l->f, l->next->v, l->prev->v, &l, l->e); /* clip this corner off */ if(l2->f->len > 3) BM_face_split(bm, l2->f, l2->next->v, l2->prev->v, &l, l2->e); /* clip this corner off */ - curedge = bmesh_disk_edge_next(curedge, v); + curedge = bm_disk_edge_next(curedge, v); } while(curedge != v->e); BME_Bevel_Dissolve_Disk(bm, v); } |