code cleanup: bmesh use 'const' for query functions.

This commit is contained in:
Campbell Barton 2013-08-03 16:37:23 +00:00
parent 31761f5e5b
commit 4770848871
8 changed files with 89 additions and 89 deletions

@ -95,7 +95,7 @@ static void calc_poly_normal(float normal[3], float verts[][3], int nverts)
* *
* Same as #calc_poly_normal but operates directly on a bmesh face. * Same as #calc_poly_normal but operates directly on a bmesh face.
*/ */
static void bm_face_calc_poly_normal(BMFace *f, float n[3]) static void bm_face_calc_poly_normal(const BMFace *f, float n[3])
{ {
BMLoop *l_first = BM_FACE_FIRST_LOOP(f); BMLoop *l_first = BM_FACE_FIRST_LOOP(f);
BMLoop *l_iter = l_first; BMLoop *l_iter = l_first;
@ -173,7 +173,7 @@ static void bm_face_calc_poly_center_mean_vertex_cos(BMFace *f, float r_cent[3],
* \param r_loops Store face loop pointers, (f->len) * \param r_loops Store face loop pointers, (f->len)
* \param r_index Store triangle triples, indicies into \a r_loops, ((f->len - 2) * 3) * \param r_index Store triangle triples, indicies into \a r_loops, ((f->len - 2) * 3)
*/ */
int BM_face_calc_tessellation(BMFace *f, BMLoop **r_loops, int (*_r_index)[3]) int BM_face_calc_tessellation(const BMFace *f, BMLoop **r_loops, int (*_r_index)[3])
{ {
int *r_index = (int *)_r_index; int *r_index = (int *)_r_index;
BMLoop *l_first = BM_FACE_FIRST_LOOP(f); BMLoop *l_first = BM_FACE_FIRST_LOOP(f);
@ -579,7 +579,7 @@ void BM_vert_normal_update_all(BMVert *v)
* is passed in as well. * is passed in as well.
*/ */
void BM_face_calc_normal(BMFace *f, float r_no[3]) void BM_face_calc_normal(const BMFace *f, float r_no[3])
{ {
BMLoop *l; BMLoop *l;

@ -27,13 +27,13 @@
* \ingroup bmesh * \ingroup bmesh
*/ */
int BM_face_calc_tessellation(BMFace *f, BMLoop **r_loops, int (*r_index)[3]) int BM_face_calc_tessellation(const BMFace *f, BMLoop **r_loops, int (*r_index)[3])
#ifdef __GNUC__ #ifdef __GNUC__
__attribute__((warn_unused_result)) __attribute__((warn_unused_result))
__attribute__((nonnull)) __attribute__((nonnull))
#endif #endif
; ;
void BM_face_calc_normal(BMFace *f, float r_no[3]); void BM_face_calc_normal(const BMFace *f, float r_no[3]);
void BM_face_calc_normal_vcos(BMesh *bm, BMFace *f, float r_no[3], void BM_face_calc_normal_vcos(BMesh *bm, BMFace *f, float r_no[3],
float const (*vertexCos)[3]); float const (*vertexCos)[3]);
float BM_face_calc_area(BMFace *f); float BM_face_calc_area(BMFace *f);

@ -53,8 +53,8 @@ int bmesh_elem_check(void *element, const char htype);
} (void)0 } (void)0
#endif #endif
int bmesh_radial_length(BMLoop *l); int bmesh_radial_length(const BMLoop *l);
int bmesh_disk_count(BMVert *v); int bmesh_disk_count(const BMVert *v);
/** /**
* Internal BMHeader.api_flag * Internal BMHeader.api_flag

@ -644,7 +644,7 @@ int BM_vert_face_count(BMVert *v)
* Tests whether or not the vertex is part of a wire edge. * Tests whether or not the vertex is part of a wire edge.
* (ie: has no faces attached to it) * (ie: has no faces attached to it)
*/ */
bool BM_vert_is_wire(BMVert *v) bool BM_vert_is_wire(const BMVert *v)
{ {
if (v->e) { if (v->e) {
BMEdge *e_first, *e_iter; BMEdge *e_first, *e_iter;
@ -667,7 +667,7 @@ bool BM_vert_is_wire(BMVert *v)
* Tests whether or not the edge is part of a wire. * Tests whether or not the edge is part of a wire.
* (ie: has no faces attached to it) * (ie: has no faces attached to it)
*/ */
bool BM_edge_is_wire(BMEdge *e) bool BM_edge_is_wire(const BMEdge *e)
{ {
return (e->l == NULL); return (e->l == NULL);
} }
@ -679,7 +679,7 @@ bool BM_edge_is_wire(BMEdge *e)
* 3: Is part of a an edge with more than 2 faces. * 3: Is part of a an edge with more than 2 faces.
* 4: Is part of a wire edge. * 4: Is part of a wire edge.
*/ */
bool BM_vert_is_manifold(BMVert *v) bool BM_vert_is_manifold(const BMVert *v)
{ {
BMEdge *e, *e_old; BMEdge *e, *e_old;
BMLoop *l; BMLoop *l;
@ -744,7 +744,7 @@ bool BM_vert_is_manifold(BMVert *v)
*/ */
#if 1 /* fast path for checking manifold */ #if 1 /* fast path for checking manifold */
bool BM_edge_is_manifold(BMEdge *e) bool BM_edge_is_manifold(const BMEdge *e)
{ {
const BMLoop *l = e->l; const BMLoop *l = e->l;
return (l && (l->radial_next != l) && /* not 0 or 1 face users */ return (l && (l->radial_next != l) && /* not 0 or 1 face users */
@ -767,7 +767,7 @@ int BM_edge_is_manifold(BMEdge *e)
* Tests that the edge is manifold and * Tests that the edge is manifold and
* that both its faces point the same way. * that both its faces point the same way.
*/ */
bool BM_edge_is_contiguous(BMEdge *e) bool BM_edge_is_contiguous(const BMEdge *e)
{ {
const BMLoop *l = e->l; const BMLoop *l = e->l;
const BMLoop *l_other; const BMLoop *l_other;
@ -780,7 +780,7 @@ bool BM_edge_is_contiguous(BMEdge *e)
* Check if the edge is convex or concave * Check if the edge is convex or concave
* (depends on face winding) * (depends on face winding)
*/ */
bool BM_edge_is_convex(BMEdge *e) bool BM_edge_is_convex(const BMEdge *e)
{ {
if (BM_edge_is_manifold(e)) { if (BM_edge_is_manifold(e)) {
BMLoop *l1 = e->l; BMLoop *l1 = e->l;
@ -803,7 +803,7 @@ bool BM_edge_is_convex(BMEdge *e)
*/ */
#if 1 /* fast path for checking boundary */ #if 1 /* fast path for checking boundary */
bool BM_edge_is_boundary(BMEdge *e) bool BM_edge_is_boundary(const BMEdge *e)
{ {
const BMLoop *l = e->l; const BMLoop *l = e->l;
return (l && (l->radial_next == l)); return (l && (l->radial_next == l));
@ -821,7 +821,7 @@ int BM_edge_is_boundary(BMEdge *e)
} }
#endif #endif
bool BM_vert_is_boundary(BMVert *v) bool BM_vert_is_boundary(const BMVert *v)
{ {
if (v->e) { if (v->e) {
BMEdge *e_first, *e_iter; BMEdge *e_first, *e_iter;
@ -1047,8 +1047,8 @@ BMLoop *BM_face_edge_share_loop(BMFace *f, BMEdge *e)
* \note This is in fact quite a simple check, mainly include this function so the intent is more obvious. * \note This is in fact quite a simple check, mainly include this function so the intent is more obvious.
* We know these 2 verts will _always_ make up the loops edge * We know these 2 verts will _always_ make up the loops edge
*/ */
void BM_edge_ordered_verts_ex(BMEdge *edge, BMVert **r_v1, BMVert **r_v2, void BM_edge_ordered_verts_ex(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
BMLoop *edge_loop) const BMLoop *edge_loop)
{ {
BLI_assert(edge_loop->e == edge); BLI_assert(edge_loop->e == edge);
(void)edge; /* quiet warning in release build */ (void)edge; /* quiet warning in release build */
@ -1056,7 +1056,7 @@ void BM_edge_ordered_verts_ex(BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
*r_v2 = edge_loop->next->v; *r_v2 = edge_loop->next->v;
} }
void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2) void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
{ {
BM_edge_ordered_verts_ex(edge, r_v1, r_v2, edge->l); BM_edge_ordered_verts_ex(edge, r_v1, r_v2, edge->l);
} }
@ -1065,7 +1065,7 @@ void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2)
* Check if the loop is convex or concave * Check if the loop is convex or concave
* (depends on face normal) * (depends on face normal)
*/ */
bool BM_loop_is_convex(BMLoop *l) bool BM_loop_is_convex(const BMLoop *l)
{ {
float e_dir_prev[3]; float e_dir_prev[3];
float e_dir_next[3]; float e_dir_next[3];
@ -1182,11 +1182,11 @@ void BM_loop_calc_face_tangent(BMLoop *l, float r_tangent[3])
* *
* \return angle in radians * \return angle in radians
*/ */
float BM_edge_calc_face_angle(BMEdge *e) float BM_edge_calc_face_angle(const BMEdge *e)
{ {
if (BM_edge_is_manifold(e)) { if (BM_edge_is_manifold(e)) {
BMLoop *l1 = e->l; const BMLoop *l1 = e->l;
BMLoop *l2 = e->l->radial_next; const BMLoop *l2 = e->l->radial_next;
return angle_normalized_v3v3(l1->f->no, l2->f->no); return angle_normalized_v3v3(l1->f->no, l2->f->no);
} }
else { else {
@ -1202,7 +1202,7 @@ float BM_edge_calc_face_angle(BMEdge *e)
* *
* \return angle in radians * \return angle in radians
*/ */
float BM_edge_calc_face_angle_signed(BMEdge *e) float BM_edge_calc_face_angle_signed(const BMEdge *e)
{ {
if (BM_edge_is_manifold(e)) { if (BM_edge_is_manifold(e)) {
BMLoop *l1 = e->l; BMLoop *l1 = e->l;
@ -1228,7 +1228,7 @@ float BM_edge_calc_face_angle_signed(BMEdge *e)
* \param r_tangent The loop corner tangent to set * \param r_tangent The loop corner tangent to set
*/ */
void BM_edge_calc_face_tangent(BMEdge *e, BMLoop *e_loop, float r_tangent[3]) void BM_edge_calc_face_tangent(const BMEdge *e, const BMLoop *e_loop, float r_tangent[3])
{ {
float tvec[3]; float tvec[3];
BMVert *v1, *v2; BMVert *v1, *v2;
@ -1685,13 +1685,13 @@ bool BM_face_exists_multi_edge(BMEdge **earr, int len)
} }
/* convenience functions for checking flags */ /* convenience functions for checking flags */
bool BM_edge_is_any_vert_flag_test(BMEdge *e, const char hflag) bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag)
{ {
return (BM_elem_flag_test(e->v1, hflag) || return (BM_elem_flag_test(e->v1, hflag) ||
BM_elem_flag_test(e->v2, hflag)); BM_elem_flag_test(e->v2, hflag));
} }
bool BM_face_is_any_vert_flag_test(BMFace *f, const char hflag) bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag)
{ {
BMLoop *l_iter; BMLoop *l_iter;
BMLoop *l_first; BMLoop *l_first;
@ -1705,7 +1705,7 @@ bool BM_face_is_any_vert_flag_test(BMFace *f, const char hflag)
return false; return false;
} }
bool BM_face_is_any_edge_flag_test(BMFace *f, const char hflag) bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag)
{ {
BMLoop *l_iter; BMLoop *l_iter;
BMLoop *l_first; BMLoop *l_first;
@ -1722,7 +1722,7 @@ bool BM_face_is_any_edge_flag_test(BMFace *f, const char hflag)
/** /**
* Use within assert's to check normals are valid. * Use within assert's to check normals are valid.
*/ */
bool BM_face_is_normal_valid(BMFace *f) bool BM_face_is_normal_valid(const BMFace *f)
{ {
const float eps = 0.0001f; const float eps = 0.0001f;
float no[3]; float no[3];
@ -1731,7 +1731,7 @@ bool BM_face_is_normal_valid(BMFace *f)
return len_squared_v3v3(no, f->no) < (eps * eps); return len_squared_v3v3(no, f->no) < (eps * eps);
} }
static void bm_mesh_calc_volume_face(BMFace *f, float *r_vol) static void bm_mesh_calc_volume_face(const BMFace *f, float *r_vol)
{ {
int tottri = f->len - 2; int tottri = f->len - 2;
BMLoop **loops = BLI_array_alloca(loops, f->len); BMLoop **loops = BLI_array_alloca(loops, f->len);

@ -58,26 +58,26 @@ int BM_edge_face_count(BMEdge *e);
int BM_vert_face_count(BMVert *v); int BM_vert_face_count(BMVert *v);
BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e); BMEdge *BM_vert_other_disk_edge(BMVert *v, BMEdge *e);
bool BM_vert_is_wire(BMVert *v); bool BM_vert_is_wire(const BMVert *v);
bool BM_edge_is_wire(BMEdge *e); bool BM_edge_is_wire(const BMEdge *e);
bool BM_vert_is_manifold(BMVert *v); bool BM_vert_is_manifold(const BMVert *v);
bool BM_edge_is_manifold(BMEdge *e); bool BM_edge_is_manifold(const BMEdge *e);
bool BM_vert_is_boundary(BMVert *v); bool BM_vert_is_boundary(const BMVert *v);
bool BM_edge_is_boundary(BMEdge *e); bool BM_edge_is_boundary(const BMEdge *e);
bool BM_edge_is_contiguous(BMEdge *e); bool BM_edge_is_contiguous(const BMEdge *e);
bool BM_edge_is_convex(BMEdge *e); bool BM_edge_is_convex(const BMEdge *e);
bool BM_loop_is_convex(BMLoop *l); bool BM_loop_is_convex(const BMLoop *l);
float BM_loop_calc_face_angle(BMLoop *l); float BM_loop_calc_face_angle(BMLoop *l);
void BM_loop_calc_face_normal(BMLoop *l, float r_normal[3]); void BM_loop_calc_face_normal(BMLoop *l, float r_normal[3]);
void BM_loop_calc_face_direction(BMLoop *l, float r_normal[3]); void BM_loop_calc_face_direction(BMLoop *l, float r_normal[3]);
void BM_loop_calc_face_tangent(BMLoop *l, float r_tangent[3]); void BM_loop_calc_face_tangent(BMLoop *l, float r_tangent[3]);
float BM_edge_calc_face_angle(BMEdge *e); float BM_edge_calc_face_angle(const BMEdge *e);
float BM_edge_calc_face_angle_signed(BMEdge *e); float BM_edge_calc_face_angle_signed(const BMEdge *e);
void BM_edge_calc_face_tangent(BMEdge *e, BMLoop *e_loop, float r_tangent[3]); void BM_edge_calc_face_tangent(const BMEdge *e, const BMLoop *e_loop, float r_tangent[3]);
float BM_vert_calc_edge_angle(BMVert *v); float BM_vert_calc_edge_angle(BMVert *v);
float BM_vert_calc_shell_factor(BMVert *v); float BM_vert_calc_shell_factor(BMVert *v);
@ -108,15 +108,15 @@ BMVert *BM_edge_share_vert(BMEdge *e1, BMEdge *e2);
BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v); BMLoop *BM_face_vert_share_loop(BMFace *f, BMVert *v);
BMLoop *BM_face_edge_share_loop(BMFace *f, BMEdge *e); BMLoop *BM_face_edge_share_loop(BMFace *f, BMEdge *e);
void BM_edge_ordered_verts(BMEdge *edge, BMVert **r_v1, BMVert **r_v2); void BM_edge_ordered_verts(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2);
void BM_edge_ordered_verts_ex(BMEdge *edge, BMVert **r_v1, BMVert **r_v2, void BM_edge_ordered_verts_ex(const BMEdge *edge, BMVert **r_v1, BMVert **r_v2,
BMLoop *edge_loop); const BMLoop *edge_loop);
bool BM_edge_is_any_vert_flag_test(BMEdge *e, const char hflag); bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag);
bool BM_face_is_any_vert_flag_test(BMFace *f, const char hflag); bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag);
bool BM_face_is_any_edge_flag_test(BMFace *f, const char hflag); bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag);
bool BM_face_is_normal_valid(BMFace *f); bool BM_face_is_normal_valid(const BMFace *f);
float BM_mesh_calc_volume(BMesh *bm, bool is_signed); float BM_mesh_calc_volume(BMesh *bm, bool is_signed);

@ -45,7 +45,7 @@ bool bmesh_vert_in_edge(const BMEdge *e, const BMVert *v)
if (e->v1 == v || e->v2 == v) return true; if (e->v1 == v || e->v2 == v) return true;
return false; return false;
} }
bool bmesh_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e) bool bmesh_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e)
{ {
if (e->v1 == v1 && e->v2 == v2) return true; if (e->v1 == v1 && e->v2 == v2) return true;
else if (e->v1 == v2 && e->v2 == v1) return true; else if (e->v1 == v2 && e->v2 == v1) return true;
@ -216,7 +216,7 @@ void bmesh_disk_edge_remove(BMEdge *e, BMVert *v)
* *
* \return Pointer to the next edge in the disk cycle for the vertex v. * \return Pointer to the next edge in the disk cycle for the vertex v.
*/ */
BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v) BMEdge *bmesh_disk_edge_next(const BMEdge *e, const BMVert *v)
{ {
if (v == e->v1) if (v == e->v1)
return e->v1_disk_link.next; return e->v1_disk_link.next;
@ -225,7 +225,7 @@ BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v)
return NULL; return NULL;
} }
BMEdge *bmesh_disk_edge_prev(BMEdge *e, BMVert *v) BMEdge *bmesh_disk_edge_prev(const BMEdge *e, const BMVert *v)
{ {
if (v == e->v1) if (v == e->v1)
return e->v1_disk_link.prev; return e->v1_disk_link.prev;
@ -234,7 +234,7 @@ BMEdge *bmesh_disk_edge_prev(BMEdge *e, BMVert *v)
return NULL; return NULL;
} }
BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2) BMEdge *bmesh_disk_edge_exists(const BMVert *v1, const BMVert *v2)
{ {
BMEdge *e_iter, *e_first; BMEdge *e_iter, *e_first;
@ -251,7 +251,7 @@ BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2)
return NULL; return NULL;
} }
int bmesh_disk_count(BMVert *v) int bmesh_disk_count(const BMVert *v)
{ {
if (v->e) { if (v->e) {
BMEdge *e_first, *e_iter; BMEdge *e_first, *e_iter;
@ -304,7 +304,7 @@ bool bmesh_disk_validate(int len, BMEdge *e, BMVert *v)
* equivalent to counting the number of * equivalent to counting the number of
* faces incident upon this vertex * faces incident upon this vertex
*/ */
int bmesh_disk_facevert_count(BMVert *v) int bmesh_disk_facevert_count(const BMVert *v)
{ {
/* is there an edge on this vert at all */ /* is there an edge on this vert at all */
if (v->e) { if (v->e) {
@ -333,29 +333,28 @@ int bmesh_disk_facevert_count(BMVert *v)
* vert's loops attached * vert's loops attached
* to it. * to it.
*/ */
BMEdge *bmesh_disk_faceedge_find_first(BMEdge *e, BMVert *v) BMEdge *bmesh_disk_faceedge_find_first(const BMEdge *e, const BMVert *v)
{ {
BMEdge *searchedge = NULL; const BMEdge *e_find = e;
searchedge = e;
do { do {
if (searchedge->l && bmesh_radial_facevert_count(searchedge->l, v)) { if (e_find->l && bmesh_radial_facevert_count(e_find->l, v)) {
return searchedge; return (BMEdge *)e_find;
} }
} while ((searchedge = bmesh_disk_edge_next(searchedge, v)) != e); } while ((e_find = bmesh_disk_edge_next(e_find, v)) != e);
return NULL; return NULL;
} }
BMEdge *bmesh_disk_faceedge_find_next(BMEdge *e, BMVert *v) BMEdge *bmesh_disk_faceedge_find_next(const BMEdge *e, const BMVert *v)
{ {
BMEdge *searchedge = NULL; BMEdge *e_find = NULL;
searchedge = bmesh_disk_edge_next(e, v); e_find = bmesh_disk_edge_next(e, v);
do { do {
if (searchedge->l && bmesh_radial_facevert_count(searchedge->l, v)) { if (e_find->l && bmesh_radial_facevert_count(e_find->l, v)) {
return searchedge; return e_find;
} }
} while ((searchedge = bmesh_disk_edge_next(searchedge, v)) != e); } while ((e_find = bmesh_disk_edge_next(e_find, v)) != e);
return e; return (BMEdge *)e;
} }
/*****radial cycle functions, e.g. loops surrounding edges**** */ /*****radial cycle functions, e.g. loops surrounding edges**** */
@ -435,19 +434,19 @@ void bmesh_radial_loop_remove(BMLoop *l, BMEdge *e)
* Finds the first loop of v around radial * Finds the first loop of v around radial
* cycle * cycle
*/ */
BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v) BMLoop *bmesh_radial_faceloop_find_first(const BMLoop *l, const BMVert *v)
{ {
BMLoop *l_iter; const BMLoop *l_iter;
l_iter = l; l_iter = l;
do { do {
if (l_iter->v == v) { if (l_iter->v == v) {
return l_iter; return (BMLoop *)l_iter;
} }
} while ((l_iter = l_iter->radial_next) != l); } while ((l_iter = l_iter->radial_next) != l);
return NULL; return NULL;
} }
BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v) BMLoop *bmesh_radial_faceloop_find_next(const BMLoop *l, const BMVert *v)
{ {
BMLoop *l_iter; BMLoop *l_iter;
l_iter = l->radial_next; l_iter = l->radial_next;
@ -456,12 +455,12 @@ BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v)
return l_iter; return l_iter;
} }
} while ((l_iter = l_iter->radial_next) != l); } while ((l_iter = l_iter->radial_next) != l);
return l; return (BMLoop *)l;
} }
int bmesh_radial_length(BMLoop *l) int bmesh_radial_length(const BMLoop *l)
{ {
BMLoop *l_iter = l; const BMLoop *l_iter = l;
int i = 0; int i = 0;
if (!l) if (!l)
@ -514,9 +513,9 @@ void bmesh_radial_append(BMEdge *e, BMLoop *l)
* Returns the number of times a vertex appears * Returns the number of times a vertex appears
* in a radial cycle * in a radial cycle
*/ */
int bmesh_radial_facevert_count(BMLoop *l, BMVert *v) int bmesh_radial_facevert_count(const BMLoop *l, const BMVert *v)
{ {
BMLoop *l_iter; const BMLoop *l_iter;
int count = 0; int count = 0;
l_iter = l; l_iter = l;
do { do {

@ -47,11 +47,11 @@ bool bmesh_loop_validate(BMFace *f);
/* DISK CYCLE MANAGMENT */ /* DISK CYCLE MANAGMENT */
void bmesh_disk_edge_append(BMEdge *e, BMVert *v); void bmesh_disk_edge_append(BMEdge *e, BMVert *v);
void bmesh_disk_edge_remove(BMEdge *e, BMVert *v); void bmesh_disk_edge_remove(BMEdge *e, BMVert *v);
BMEdge *bmesh_disk_edge_next(BMEdge *e, BMVert *v); BMEdge *bmesh_disk_edge_next(const BMEdge *e, const BMVert *v);
BMEdge *bmesh_disk_edge_prev(BMEdge *e, BMVert *v); BMEdge *bmesh_disk_edge_prev(const BMEdge *e, const BMVert *v);
int bmesh_disk_facevert_count(BMVert *v); int bmesh_disk_facevert_count(const BMVert *v);
BMEdge *bmesh_disk_faceedge_find_first(BMEdge *e, BMVert *v); BMEdge *bmesh_disk_faceedge_find_first(const BMEdge *e, const BMVert *v);
BMEdge *bmesh_disk_faceedge_find_next(BMEdge *e, BMVert *v); BMEdge *bmesh_disk_faceedge_find_next(const BMEdge *e, const BMVert *v);
/* RADIAL CYCLE MANAGMENT */ /* RADIAL CYCLE MANAGMENT */
void bmesh_radial_append(BMEdge *e, BMLoop *l); void bmesh_radial_append(BMEdge *e, BMLoop *l);
@ -60,18 +60,18 @@ void bmesh_radial_loop_remove(BMLoop *l, BMEdge *e);
* bmesh_radial_loop_next(BMLoop *l) / prev. * bmesh_radial_loop_next(BMLoop *l) / prev.
* just use member access l->radial_next, l->radial_prev now */ * just use member access l->radial_next, l->radial_prev now */
int bmesh_radial_facevert_count(BMLoop *l, BMVert *v); int bmesh_radial_facevert_count(const BMLoop *l, const BMVert *v);
BMLoop *bmesh_radial_faceloop_find_first(BMLoop *l, BMVert *v); BMLoop *bmesh_radial_faceloop_find_first(const BMLoop *l, const BMVert *v);
BMLoop *bmesh_radial_faceloop_find_next(BMLoop *l, BMVert *v); BMLoop *bmesh_radial_faceloop_find_next(const BMLoop *l, const BMVert *v);
BMLoop *bmesh_radial_faceloop_find_vert(BMFace *f, BMVert *v); BMLoop *bmesh_radial_faceloop_find_vert(const BMFace *f, const BMVert *v);
bool bmesh_radial_validate(int radlen, BMLoop *l); bool bmesh_radial_validate(int radlen, BMLoop *l);
/* EDGE UTILITIES */ /* EDGE UTILITIES */
bool bmesh_vert_in_edge(const BMEdge *e, const BMVert *v); bool bmesh_vert_in_edge(const BMEdge *e, const BMVert *v);
bool bmesh_verts_in_edge(BMVert *v1, BMVert *v2, BMEdge *e); 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 */ bool bmesh_edge_swapverts(BMEdge *e, BMVert *orig, BMVert *newv); /* relink edge */
BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v); BMVert *bmesh_edge_other_vert_get(BMEdge *e, BMVert *v);
BMEdge *bmesh_disk_edge_exists(BMVert *v1, BMVert *v2); BMEdge *bmesh_disk_edge_exists(const BMVert *v1, const BMVert *v2);
bool bmesh_disk_validate(int len, BMEdge *e, BMVert *v); bool bmesh_disk_validate(int len, BMEdge *e, BMVert *v);
#endif /* __BMESH_STRUCTURE_H__ */ #endif /* __BMESH_STRUCTURE_H__ */

@ -428,8 +428,9 @@ static int edbm_add_edge_face__smooth_get(BMesh *bm)
* Function used to get a fixed number of edges linked to a vertex that passes a test function. * Function used to get a fixed number of edges linked to a vertex that passes a test function.
* This is used so we can request all boundary edges connected to a vertex for eg. * This is used so we can request all boundary edges connected to a vertex for eg.
*/ */
static int edbm_add_edge_face_exec__vert_edge_lookup(BMVert *v, BMEdge *e_used, BMEdge **e_arr, const int e_arr_len, static int edbm_add_edge_face_exec__vert_edge_lookup(
bool (* func)(BMEdge *)) BMVert *v, BMEdge *e_used, BMEdge **e_arr, const int e_arr_len,
bool (* func)(const BMEdge *))
{ {
BMIter iter; BMIter iter;
BMEdge *e_iter; BMEdge *e_iter;