diff options
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 24 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 106 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.h | 18 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries_inline.h | 131 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_structure.c | 50 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_structure.h | 9 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_structure_inline.h | 55 |
9 files changed, 218 insertions, 183 deletions
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt index cd8d71be176..8d87e290b6c 100644 --- a/source/blender/bmesh/CMakeLists.txt +++ b/source/blender/bmesh/CMakeLists.txt @@ -108,8 +108,10 @@ set(SRC intern/bmesh_private.h intern/bmesh_queries.c intern/bmesh_queries.h + intern/bmesh_queries_inline.h intern/bmesh_structure.c intern/bmesh_structure.h + intern/bmesh_structure_inline.h intern/bmesh_walkers.c intern/bmesh_walkers.h intern/bmesh_walkers_impl.c diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index a270830e469..cbaffe2da1a 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -862,7 +862,7 @@ static bool bm_loop_reverse_loop(BMesh *bm, BMFace *f for (i = 0, l_iter = l_first; i < len; i++, l_iter = l_iter->next) { edok = 0; for (j = 0; j < len; j++) { - edok = bmesh_verts_in_edge(l_iter->v, l_iter->next->v, edar[j]); + edok = BM_verts_in_edge(l_iter->v, l_iter->next->v, edar[j]); if (edok) { l_iter->e = edar[j]; break; @@ -1424,9 +1424,9 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) int i; #endif - BLI_assert(bmesh_vert_in_edge(e, tv) != false); + BLI_assert(BM_vert_in_edge(e, tv) != false); - v_old = bmesh_edge_other_vert_get(e, tv); + v_old = BM_edge_other_vert(e, tv); #ifndef NDEBUG valence1 = bmesh_disk_count(v_old); @@ -1489,7 +1489,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) l_new->v = v_new; /* assign the correct edge to the correct loop */ - if (bmesh_verts_in_edge(l_new->v, l_new->next->v, e)) { + if (BM_verts_in_edge(l_new->v, l_new->next->v, e)) { l_new->e = e; l->e = e_new; @@ -1507,7 +1507,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) bmesh_radial_append(l_new->e, l_new); bmesh_radial_append(l->e, l); } - else if (bmesh_verts_in_edge(l_new->v, l_new->next->v, e_new)) { + else if (BM_verts_in_edge(l_new->v, l_new->next->v, e_new)) { l_new->e = e_new; l->e = e; @@ -1541,7 +1541,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) //BMESH_ASSERT(l->radial_next == l); BMESH_ASSERT(!(l->prev->e != e_new && l->next->e != e_new)); - edok = bmesh_verts_in_edge(l->v, l->next->v, e); + edok = BM_verts_in_edge(l->v, l->next->v, e); BMESH_ASSERT(edok != false); BMESH_ASSERT(l->v != l->next->v); BMESH_ASSERT(l->e != l->next->e); @@ -1557,7 +1557,7 @@ BMVert *bmesh_semv(BMesh *bm, BMVert *tv, BMEdge *e, BMEdge **r_e) BMESH_ASSERT(l->e == e_new); // BMESH_ASSERT(l->radial_next == l); BMESH_ASSERT(!(l->prev->e != e && l->next->e != e)); - edok = bmesh_verts_in_edge(l->v, l->next->v, e_new); + edok = BM_verts_in_edge(l->v, l->next->v, e_new); BMESH_ASSERT(edok != false); BMESH_ASSERT(l->v != l->next->v); BMESH_ASSERT(l->e != l->next->e); @@ -1619,7 +1619,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool check_e int len, radlen = 0, i; bool edok, halt = false; - if (bmesh_vert_in_edge(e_kill, v_kill) == 0) { + if (BM_vert_in_edge(e_kill, v_kill) == 0) { return NULL; } @@ -1632,9 +1632,9 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool check_e #endif e_old = bmesh_disk_edge_next(e_kill, v_kill); - tv = bmesh_edge_other_vert_get(e_kill, v_kill); - v_old = bmesh_edge_other_vert_get(e_old, v_kill); - halt = bmesh_verts_in_edge(v_kill, tv, e_old); /* check for double edges */ + tv = BM_edge_other_vert(e_kill, v_kill); + v_old = BM_edge_other_vert(e_old, v_kill); + halt = BM_verts_in_edge(v_kill, tv, e_old); /* check for double edges */ if (halt) { return NULL; @@ -1722,7 +1722,7 @@ BMEdge *bmesh_jekv(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, const bool check_e /* Validate loop cycle of all faces attached to 'e_old' */ for (i = 0, l = e_old->l; i < radlen; i++, l = l->radial_next) { BMESH_ASSERT(l->e == e_old); - edok = bmesh_verts_in_edge(l->v, l->next->v, e_old); + edok = BM_verts_in_edge(l->v, l->next->v, e_old); BMESH_ASSERT(edok != false); edok = bmesh_loop_validate(l->f); BMESH_ASSERT(edok != false); diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index 4dc155e68c2..49c8c987956 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -461,7 +461,7 @@ BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, float const bool join_faces, const bool kill_degenerate_faces) { BMEdge *e_new = NULL; - BMVert *tv = bmesh_edge_other_vert_get(e_kill, v_kill); + BMVert *tv = BM_edge_other_vert(e_kill, v_kill); BMEdge *e2; BMVert *tv2; @@ -575,7 +575,7 @@ BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *e_kill, BMVert *v_kill, /* in this case we want to keep all faces and not join them, * rather just get rid of the vertex - see bug [#28645] */ - BMVert *tv = bmesh_edge_other_vert_get(e_kill, v_kill); + BMVert *tv = BM_edge_other_vert(e_kill, v_kill); if (tv) { BMEdge *e2 = bmesh_disk_edge_next(e_kill, v_kill); if (e2) { @@ -642,7 +642,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float perce } } - v2 = bmesh_edge_other_vert_get(e, v); + v2 = BM_edge_other_vert(e, v); v_new = bmesh_semv(bm, v, e, r_e); BLI_assert(v_new != NULL); diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index c655fe4cc20..15e564b72f4 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -41,15 +41,6 @@ #include "intern/bmesh_private.h" /** - * Returns whether or not a given vertex is - * is part of a given edge. - */ -bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) -{ - return bmesh_vert_in_edge(e, v); -} - -/** * \brief Other Loop in Face Sharing an Edge * * Finds the other loop that shares \a v with \a e loop in \a f. @@ -354,32 +345,6 @@ bool BM_edge_in_face(BMEdge *e, BMFace *f) } /** - * Returns whether or not a given edge is is part of a given loop. - */ -bool BM_edge_in_loop(BMEdge *e, BMLoop *l) -{ - return (l->e == e || l->prev->e == e); -} - -/** - * Returns whether or not two vertices are in - * a given edge - */ -bool BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e) -{ - return bmesh_verts_in_edge(v1, v2, e); -} - -/** - * Given a edge and one of its vertices, returns - * the other vertex. - */ -BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v) -{ - return bmesh_edge_other_vert_get(e, v); -} - -/** * Given a edge and a loop (assumes the edge is manifold). returns * the other faces loop, sharing the same vertex. * @@ -665,15 +630,6 @@ bool BM_vert_is_wire(const BMVert *v) } /** - * Tests whether or not the edge is part of a wire. - * (ie: has no faces attached to it) - */ -bool BM_edge_is_wire(const BMEdge *e) -{ - return (e->l == NULL); -} - -/** * A vertex is non-manifold if it meets the following conditions: * 1: Loose - (has no edges/faces incident upon it). * 2: Joins two distinct regions - (two pyramids joined at the tip). @@ -740,44 +696,6 @@ bool BM_vert_is_manifold(const BMVert *v) } /** - * Tests whether or not this edge is manifold. - * A manifold edge has exactly 2 faces attached to it. - */ - -#if 1 /* fast path for checking manifold */ -bool BM_edge_is_manifold(const BMEdge *e) -{ - const BMLoop *l = e->l; - return (l && (l->radial_next != l) && /* not 0 or 1 face users */ - (l->radial_next->radial_next == l)); /* 2 face users */ -} -#else -int BM_edge_is_manifold(BMEdge *e) -{ - int count = BM_edge_face_count(e); - if (count == 2) { - return true; - } - else { - return false; - } -} -#endif - -/** - * Tests that the edge is manifold and - * that both its faces point the same way. - */ -bool BM_edge_is_contiguous(const BMEdge *e) -{ - const BMLoop *l = e->l; - const BMLoop *l_other; - return (l && ((l_other = l->radial_next) != l) && /* not 0 or 1 face users */ - (l_other->radial_next == l) && /* 2 face users */ - (l_other->v != l->v)); -} - -/** * Check if the edge is convex or concave * (depends on face winding) */ @@ -798,30 +716,6 @@ bool BM_edge_is_convex(const BMEdge *e) return true; } -/** - * Tests whether or not an edge is on the boundary - * of a shell (has one face associated with it) - */ - -#if 1 /* fast path for checking boundary */ -bool BM_edge_is_boundary(const BMEdge *e) -{ - const BMLoop *l = e->l; - return (l && (l->radial_next == l)); -} -#else -int BM_edge_is_boundary(BMEdge *e) -{ - int count = BM_edge_face_count(e); - if (count == 1) { - return true; - } - else { - return false; - } -} -#endif - bool BM_vert_is_boundary(const BMVert *v) { if (v->e) { diff --git a/source/blender/bmesh/intern/bmesh_queries.h b/source/blender/bmesh/intern/bmesh_queries.h index ab20b1c98ab..17c14310191 100644 --- a/source/blender/bmesh/intern/bmesh_queries.h +++ b/source/blender/bmesh/intern/bmesh_queries.h @@ -32,16 +32,16 @@ int BM_verts_in_face_count(BMFace *f, BMVert **varr, int len); bool BM_verts_in_face(BMFace *f, BMVert **varr, int len); bool BM_edge_in_face(BMEdge *e, BMFace *f); -bool BM_edge_in_loop(BMEdge *e, BMLoop *l); +BLI_INLINE bool BM_edge_in_loop(const BMEdge *e, const BMLoop *l); -bool BM_vert_in_edge(const BMEdge *e, const BMVert *v); -bool BM_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e); +BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v); +BLI_INLINE bool BM_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e); float BM_edge_calc_length(BMEdge *e); float BM_edge_calc_length_squared(BMEdge *e); bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb); bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb); -BMVert *BM_edge_other_vert(BMEdge *e, BMVert *v); +BLI_INLINE BMVert *BM_edge_other_vert(BMEdge *e, const BMVert *v); BMLoop *BM_edge_other_loop(BMEdge *e, BMLoop *l); BMLoop *BM_face_other_edge_loop(BMFace *f, BMEdge *e, BMVert *v); BMLoop *BM_loop_other_edge_loop(BMLoop *l, BMVert *v); @@ -57,13 +57,13 @@ int BM_vert_face_count(BMVert *v); BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e); bool BM_vert_is_wire(const BMVert *v); -bool BM_edge_is_wire(const BMEdge *e); +BLI_INLINE bool BM_edge_is_wire(const BMEdge *e); bool BM_vert_is_manifold(const BMVert *v); -bool BM_edge_is_manifold(const BMEdge *e); +BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e); bool BM_vert_is_boundary(const BMVert *v); -bool BM_edge_is_boundary(const BMEdge *e); -bool BM_edge_is_contiguous(const BMEdge *e); +BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e); +BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e); bool BM_edge_is_convex(const BMEdge *e); bool BM_loop_is_convex(const BMLoop *l); @@ -134,4 +134,6 @@ int BM_mesh_calc_edge_groups(BMesh *bm, int *r_groups_array, int (**r_group_in /* not really any good place to put this */ float bmesh_subd_falloff_calc(const int falloff, float val); +#include "bmesh_queries_inline.h" + #endif /* __BMESH_QUERIES_H__ */ diff --git a/source/blender/bmesh/intern/bmesh_queries_inline.h b/source/blender/bmesh/intern/bmesh_queries_inline.h new file mode 100644 index 00000000000..c3ee363f247 --- /dev/null +++ b/source/blender/bmesh/intern/bmesh_queries_inline.h @@ -0,0 +1,131 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/bmesh/intern/bmesh_queries_inline.h + * \ingroup bmesh + */ + + +#ifndef __BMESH_QUERIES_INLINE_H__ +#define __BMESH_QUERIES_INLINE_H__ + +/** + * Returns whether or not a given vertex is + * is part of a given edge. + */ +BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) +{ + return (ELEM(v, e->v1, e->v2)); +} + +/** + * Returns whether or not a given edge is is part of a given loop. + */ +BLI_INLINE bool BM_edge_in_loop(const BMEdge *e, const BMLoop *l) +{ + return (l->e == e || l->prev->e == e); +} + +/** + * Returns whether or not two vertices are in + * a given edge + */ +BLI_INLINE bool BM_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e) +{ + return ((e->v1 == v1 && e->v2 == v2) || + (e->v1 == v2 && e->v2 == v1)); +} + +/** + * Given a edge and one of its vertices, returns + * the other vertex. + */ +BLI_INLINE BMVert *BM_edge_other_vert(BMEdge *e, const BMVert *v) +{ + if (e->v1 == v) { + return e->v2; + } + else if (e->v2 == v) { + return e->v1; + } + return NULL; +} + +/** + * Tests whether or not the edge is part of a wire. + * (ie: has no faces attached to it) + */ +BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) +{ + return (e->l == NULL); +} + +/** + * Tests whether or not this edge is manifold. + * A manifold edge has exactly 2 faces attached to it. + */ + +#if 1 /* fast path for checking manifold */ +BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) +{ + const BMLoop *l = e->l; + return (l && (l->radial_next != l) && /* not 0 or 1 face users */ + (l->radial_next->radial_next == l)); /* 2 face users */ +} +#else +BLI_INLINE int BM_edge_is_manifold(BMEdge *e) +{ + return (BM_edge_face_count(e) == 2); +} +#endif + +/** + * Tests that the edge is manifold and + * that both its faces point the same way. + */ +BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) +{ + const BMLoop *l = e->l; + const BMLoop *l_other; + return (l && ((l_other = l->radial_next) != l) && /* not 0 or 1 face users */ + (l_other->radial_next == l) && /* 2 face users */ + (l_other->v != l->v)); +} + +/** + * Tests whether or not an edge is on the boundary + * of a shell (has one face associated with it) + */ + +#if 1 /* fast path for checking boundary */ +BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) +{ + const BMLoop *l = e->l; + return (l && (l->radial_next == l)); +} +#else +BLI_INLINE int BM_edge_is_boundary(BMEdge *e) +{ + return (BM_edge_face_count(e) == 1); +} +#endif + + +#endif /* __BMESH_QUERIES_INLINE_H__ */ diff --git a/source/blender/bmesh/intern/bmesh_structure.c b/source/blender/bmesh/intern/bmesh_structure.c index 286425cbacf..afcafc8640d 100644 --- a/source/blender/bmesh/intern/bmesh_structure.c +++ b/source/blender/bmesh/intern/bmesh_structure.c @@ -40,29 +40,6 @@ * MISC utility functions. */ -bool bmesh_vert_in_edge(const BMEdge *e, const BMVert *v) -{ - if (e->v1 == v || e->v2 == v) return true; - return false; -} -bool bmesh_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e) -{ - if (e->v1 == v1 && e->v2 == v2) return true; - else if (e->v1 == v2 && e->v2 == v1) return true; - return false; -} - -BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v) -{ - if (e->v1 == v) { - return e->v2; - } - else if (e->v2 == v) { - return e->v1; - } - return NULL; -} - bool bmesh_edge_swapverts(BMEdge *e, BMVert *v_orig, BMVert *v_new) { if (e->v1 == v_orig) { @@ -209,31 +186,6 @@ void bmesh_disk_edge_remove(BMEdge *e, BMVert *v) dl1->next = dl1->prev = NULL; } -/** - * \brief Next Disk Edge - * - * Find the next edge in a disk cycle - * - * \return Pointer to the next edge in the disk cycle for the vertex v. - */ -BMEdge *bmesh_disk_edge_next(const BMEdge *e, const BMVert *v) -{ - if (v == e->v1) - return e->v1_disk_link.next; - if (v == e->v2) - return e->v2_disk_link.next; - return NULL; -} - -BMEdge *bmesh_disk_edge_prev(const BMEdge *e, const BMVert *v) -{ - if (v == e->v1) - return e->v1_disk_link.prev; - if (v == e->v2) - return e->v2_disk_link.prev; - return NULL; -} - BMEdge *bmesh_disk_edge_exists(const BMVert *v1, const BMVert *v2) { BMEdge *e_iter, *e_first; @@ -242,7 +194,7 @@ BMEdge *bmesh_disk_edge_exists(const BMVert *v1, const BMVert *v2) e_first = e_iter = v1->e; do { - if (bmesh_verts_in_edge(v1, v2, e_iter)) { + if (BM_verts_in_edge(v1, v2, e_iter)) { return e_iter; } } while ((e_iter = bmesh_disk_edge_next(e_iter, v1)) != e_first); diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h index f64fb911ab4..5c87b5eb9b5 100644 --- a/source/blender/bmesh/intern/bmesh_structure.h +++ b/source/blender/bmesh/intern/bmesh_structure.h @@ -47,8 +47,8 @@ bool bmesh_loop_validate(BMFace *f); /* DISK CYCLE MANAGMENT */ void bmesh_disk_edge_append(BMEdge *e, BMVert *v); void bmesh_disk_edge_remove(BMEdge *e, BMVert *v); -BMEdge *bmesh_disk_edge_next(const BMEdge *e, const BMVert *v); -BMEdge *bmesh_disk_edge_prev(const BMEdge *e, const BMVert *v); +BLI_INLINE BMEdge *bmesh_disk_edge_next(const BMEdge *e, const BMVert *v); +BLI_INLINE BMEdge *bmesh_disk_edge_prev(const BMEdge *e, const BMVert *v); int bmesh_disk_facevert_count(const BMVert *v); BMEdge *bmesh_disk_faceedge_find_first(const BMEdge *e, const BMVert *v); BMEdge *bmesh_disk_faceedge_find_next(const BMEdge *e, const BMVert *v); @@ -67,11 +67,10 @@ BMLoop *bmesh_radial_faceloop_find_vert(const BMFace *f, const BMVert *v); bool bmesh_radial_validate(int radlen, BMLoop *l); /* EDGE UTILITIES */ -bool bmesh_vert_in_edge(const BMEdge *e, const BMVert *v); -bool bmesh_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e); bool bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv); /* relink edge */ -BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v); BMEdge *bmesh_disk_edge_exists(const BMVert *v1, const BMVert *v2); bool bmesh_disk_validate(int len, BMEdge *e, BMVert *v); +#include "intern/bmesh_structure_inline.h" + #endif /* __BMESH_STRUCTURE_H__ */ diff --git a/source/blender/bmesh/intern/bmesh_structure_inline.h b/source/blender/bmesh/intern/bmesh_structure_inline.h new file mode 100644 index 00000000000..c29acaa724c --- /dev/null +++ b/source/blender/bmesh/intern/bmesh_structure_inline.h @@ -0,0 +1,55 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/bmesh/intern/bmesh_structure_inline.h + * \ingroup bmesh + * + * BMesh inline operator functions. + */ + +#ifndef __BMESH_STRUCTURE_INLINE_H__ +#define __BMESH_STRUCTURE_INLINE_H__ + +/** + * \brief Next Disk Edge + * + * Find the next edge in a disk cycle + * + * \return Pointer to the next edge in the disk cycle for the vertex v. + */ +BLI_INLINE BMEdge *bmesh_disk_edge_next(const BMEdge *e, const BMVert *v) +{ + if (v == e->v1) + return e->v1_disk_link.next; + if (v == e->v2) + return e->v2_disk_link.next; + return NULL; +} + +BLI_INLINE BMEdge *bmesh_disk_edge_prev(const BMEdge *e, const BMVert *v) +{ + if (v == e->v1) + return e->v1_disk_link.prev; + if (v == e->v2) + return e->v2_disk_link.prev; + return NULL; +} + +#endif /* __BMESH_STRUCTURE_INLINE_H__ */ |