diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-12 19:45:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-12 20:39:20 +0300 |
commit | 6521307dcd5b68137db5fbfed11f2d188d100869 (patch) | |
tree | c4b067c2b6bf93e2bf9e7351ca318209eb374d5e /source/blender/bmesh/intern/bmesh_core.c | |
parent | f28376d8d938fed33ea6c53d745ec343ac3c2b5d (diff) |
BMesh: rename cryptic functions
Use expanded names for bmesh primitive operations
(urmv jvke semv jfke).
Use 'bmesh_kernel_' prefix,
these functions aren't intended for wide use so favor readability.
Remove BM_face_vert_separate,
it wasn't used and only skipped step of finding correct loop of face.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_core.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 74 |
1 files changed, 31 insertions, 43 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index b075d508295..cee5450a37d 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -1021,7 +1021,7 @@ static int UNUSED_FUNCTION(bm_loop_length)(BMLoop *l) * \param use_loop_mdisp_flip: When set, flip the Z-depth of the mdisp, * (use when flipping normals, disable when mirroring, eg: symmetrize). */ -void bmesh_loop_reverse( +void bmesh_kernel_loop_reverse( BMesh *bm, BMFace *f, const int cd_loop_mdisp_offset, const bool use_loop_mdisp_flip) { @@ -1438,7 +1438,7 @@ static BMFace *bm_face_create__sfme(BMesh *bm, BMFace *f_example) * * \return A BMFace pointer */ -BMFace *bmesh_sfme( +BMFace *bmesh_kernel_split_face_make_edge( BMesh *bm, BMFace *f, BMLoop *l_v1, BMLoop *l_v2, BMLoop **r_l, #ifdef USE_BMESH_HOLES @@ -1584,7 +1584,7 @@ BMFace *bmesh_sfme( * * \return The newly created BMVert pointer. */ -BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) +BMVert *bmesh_kernel_split_edge_make_vert(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) { BMLoop *l_next; BMEdge *e_new; @@ -1766,7 +1766,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) * faces with just 2 edges. It is up to the caller to decide what to do with * these faces. */ -BMEdge *bmesh_jekv( +BMEdge *bmesh_kernel_join_edge_kill_vert( BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool check_edge_double, const bool kill_degenerate_faces) @@ -1920,7 +1920,7 @@ BMEdge *bmesh_jekv( * * Collapse an edge, merging surrounding data. * - * Unlike #BM_vert_collapse_edge & #bmesh_jekv which only handle 2 valence verts, + * Unlike #BM_vert_collapse_edge & #bmesh_kernel_join_edge_kill_vert which only handle 2 valence verts, * this can handle any number of connected edges/faces. * * <pre> @@ -1932,7 +1932,7 @@ BMEdge *bmesh_jekv( * +-+-+-+ +-+-+-+ * </pre> */ -BMVert *bmesh_jvke( +BMVert *bmesh_kernel_join_vert_kill_edge( BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool do_del, const bool check_edge_double, const bool kill_degenerate_faces) @@ -2035,7 +2035,7 @@ BMVert *bmesh_jvke( * In the example A, faces \a f1 and \a f2 are joined by a single edge, * and the euler can safely be used. * In example B however, \a f1 and \a f2 are joined by multiple edges and will produce an error. - * The caller in this case should call #bmesh_jekv on the extra edges + * The caller in this case should call #bmesh_kernel_join_edge_kill_vert on the extra edges * before attempting to fuse \a f1 and \a f2. * * \note The order of arguments decides whether or not certain per-face attributes are present @@ -2044,7 +2044,7 @@ BMVert *bmesh_jvke( * * \return A BMFace pointer */ -BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e) +BMFace *bmesh_kernel_join_face_kill_edge(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e) { BMLoop *l_iter, *l_f1 = NULL, *l_f2 = NULL; int newlen = 0, i, f1len = 0, f2len = 0; @@ -2249,7 +2249,7 @@ bool BM_vert_splice(BMesh *bm, BMVert *v_dst, BMVert *v_src) } -/** \name BM_vert_separate, bmesh_vert_separate and friends +/** \name BM_vert_separate, bmesh_kernel_vert_separate and friends * \{ */ /* BM_edge_face_count(e) >= 1 */ @@ -2269,7 +2269,7 @@ BLI_INLINE bool bm_edge_supports_separate(const BMEdge *e) * * \return Success */ -void bmesh_vert_separate( +void bmesh_kernel_vert_separate( BMesh *bm, BMVert *v, BMVert ***r_vout, int *r_vout_len, const bool copy_select) { @@ -2385,7 +2385,7 @@ void bmesh_vert_separate( * * Takes a list of edges, which have been split from their original. * - * Any edges which failed to split off in #bmesh_vert_separate will be merged back into the original edge. + * Any edges which failed to split off in #bmesh_kernel_vert_separate will be merged back into the original edge. * * \param edges_separate * A list-of-lists, each list is from a single original edge (the first edge is the original), @@ -2398,7 +2398,7 @@ void bmesh_vert_separate( * \note this function looks like it could become slow, * but in common cases its only going to iterate a few times. */ -static void bmesh_vert_separate__cleanup(BMesh *bm, LinkNode *edges_separate) +static void bmesh_kernel_vert_separate__cleanup(BMesh *bm, LinkNode *edges_separate) { do { LinkNode *n_orig = edges_separate->link; @@ -2418,7 +2418,7 @@ static void bmesh_vert_separate__cleanup(BMesh *bm, LinkNode *edges_separate) } /** - * High level function which wraps both #bmesh_vert_separate and #bmesh_edge_separate + * High level function which wraps both #bmesh_kernel_vert_separate and #bmesh_kernel_edge_separate */ void BM_vert_separate( BMesh *bm, BMVert *v, @@ -2435,7 +2435,7 @@ void BM_vert_separate( LinkNode *edges_orig = NULL; do { BMLoop *l_sep = e->l; - bmesh_edge_separate(bm, e, l_sep, copy_select); + bmesh_kernel_edge_separate(bm, e, l_sep, copy_select); BLI_linklist_prepend_alloca(&edges_orig, l_sep->e); BLI_assert(e != l_sep->e); } while (bm_edge_supports_separate(e)); @@ -2444,10 +2444,10 @@ void BM_vert_separate( } } - bmesh_vert_separate(bm, v, r_vout, r_vout_len, copy_select); + bmesh_kernel_vert_separate(bm, v, r_vout, r_vout_len, copy_select); if (edges_separate) { - bmesh_vert_separate__cleanup(bm, edges_separate); + bmesh_kernel_vert_separate__cleanup(bm, edges_separate); } } @@ -2472,7 +2472,7 @@ void BM_vert_separate_hflag( LinkNode *edges_orig = NULL; do { BMLoop *l_sep = e->l; - bmesh_edge_separate(bm, e, l_sep, copy_select); + bmesh_kernel_edge_separate(bm, e, l_sep, copy_select); /* trick to avoid looping over separated edges */ if (edges_separate == NULL && edges_orig == NULL) { e_first = l_sep->e; @@ -2486,10 +2486,10 @@ void BM_vert_separate_hflag( } } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v)) != e_first); - bmesh_vert_separate(bm, v, r_vout, r_vout_len, copy_select); + bmesh_kernel_vert_separate(bm, v, r_vout, r_vout_len, copy_select); if (edges_separate) { - bmesh_vert_separate__cleanup(bm, edges_separate); + bmesh_kernel_vert_separate__cleanup(bm, edges_separate); } } @@ -2574,7 +2574,7 @@ bool BM_edge_splice(BMesh *bm, BMEdge *e_dst, BMEdge *e_src) * \note Does nothing if \a l_sep is already the only loop in the * edge radial. */ -void bmesh_edge_separate( +void bmesh_kernel_edge_separate( BMesh *bm, BMEdge *e, BMLoop *l_sep, const bool copy_select) { @@ -2620,7 +2620,7 @@ void bmesh_edge_separate( * * \note Will be a no-op and return original vertex if only two edges at that vertex. */ -BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep) +BMVert *bmesh_kernel_unglue_region_make_vert(BMesh *bm, BMLoop *l_sep) { BMVert *v_new = NULL; BMVert *v_sep = l_sep->v; @@ -2630,10 +2630,12 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep) /* peel the face from the edge radials on both sides of the * loop vert, disconnecting the face from its fan */ - if (!BM_edge_is_boundary(l_sep->e)) - bmesh_edge_separate(bm, l_sep->e, l_sep, false); - if (!BM_edge_is_boundary(l_sep->prev->e)) - bmesh_edge_separate(bm, l_sep->prev->e, l_sep->prev, false); + if (!BM_edge_is_boundary(l_sep->e)) { + bmesh_kernel_edge_separate(bm, l_sep->e, l_sep, false); + } + if (!BM_edge_is_boundary(l_sep->prev->e)) { + bmesh_kernel_edge_separate(bm, l_sep->prev->e, l_sep->prev, false); + } /* do inline, below */ #if 0 @@ -2681,13 +2683,13 @@ BMVert *bmesh_urmv_loop(BMesh *bm, BMLoop *l_sep) } /** - * A version of #bmesh_urmv_loop that disconnects multiple loops at once. + * A version of #bmesh_kernel_unglue_region_make_vert that disconnects multiple loops at once. * The loops must all share the same vertex, can be in any order * and are all moved to use a single new vertex - which is returned. * * This function handles the details of finding fans boundaries. */ -BMVert *bmesh_urmv_loop_multi( +BMVert *bmesh_kernel_unglue_region_make_vert_multi( BMesh *bm, BMLoop **larr, int larr_len) { BMVert *v_sep = larr[0]->v; @@ -2871,9 +2873,9 @@ static void bmesh_edge_vert_swap__recursive(BMEdge *e, BMVert *v_dst, BMVert *v_ /** * This function assumes l_sep is apart of a larger fan which has already been - * isolated by calling bmesh_edge_separate to segregate it radially. + * isolated by calling #bmesh_kernel_edge_separate to segregate it radially. */ -BMVert *bmesh_urmv_loop_region(BMesh *bm, BMLoop *l_sep) +BMVert *bmesh_kernel_unglue_region_make_vert_multi_isolated(BMesh *bm, BMLoop *l_sep) { BMVert *v_new = BM_vert_create(bm, l_sep->v->co, l_sep->v, BM_CREATE_NOP); /* passing either 'l_sep->e', 'l_sep->prev->e' will work */ @@ -2882,20 +2884,6 @@ BMVert *bmesh_urmv_loop_region(BMesh *bm, BMLoop *l_sep) return v_new; } - -/** - * \brief Unglue Region Make Vert (URMV) - * - * Disconnects f_sep from the vertex fan at \a v_sep - * - * \return The newly created BMVert - */ -BMVert *bmesh_urmv(BMesh *bm, BMFace *f_sep, BMVert *v_sep) -{ - BMLoop *l = BM_face_vert_share_loop(f_sep, v_sep); - return bmesh_urmv_loop(bm, l); -} - /** * Avoid calling this where possible, * low level function so both face pointers remain intact but point to swapped data. |