BMesh: arg reorder

This commit is contained in:
Campbell Barton
2014-11-03 08:30:33 +01:00
parent c14d34322b
commit d57ce42dfa
5 changed files with 12 additions and 13 deletions

View File

@@ -56,7 +56,7 @@ const char bm_iter_itype_htype_map[BM_ITYPE_MAX] = {
/** /**
* Utility function. * Utility function.
*/ */
int BM_iter_mesh_count(BMesh *bm, const char itype) int BM_iter_mesh_count(const char itype, BMesh *bm)
{ {
int count; int count;

View File

@@ -94,7 +94,7 @@ extern const char bm_iter_itype_htype_map[BM_ITYPE_MAX];
#ifdef DEBUG #ifdef DEBUG
# define BM_ITER_MESH_MUTABLE(ele, ele_next, iter, bm, itype) \ # define BM_ITER_MESH_MUTABLE(ele, ele_next, iter, bm, itype) \
for (ele = BM_iter_new(iter, bm, itype, NULL); \ for (ele = BM_iter_new(iter, bm, itype, NULL); \
ele ? ((void)((iter)->count = BM_iter_mesh_count(bm, itype)), \ ele ? ((void)((iter)->count = BM_iter_mesh_count(itype, bm)), \
(void)(ele_next = BM_iter_step(iter)), 1) : 0; \ (void)(ele_next = BM_iter_step(iter)), 1) : 0; \
ele = ele_next) ele = ele_next)
#else #else
@@ -185,7 +185,6 @@ typedef struct BMIter {
char itype; char itype;
} BMIter; } BMIter;
int BM_iter_mesh_count(BMesh *bm, const char itype);
void *BM_iter_at_index(BMesh *bm, const char itype, void *data, int index) ATTR_WARN_UNUSED_RESULT; void *BM_iter_at_index(BMesh *bm, const char itype, void *data, int index) ATTR_WARN_UNUSED_RESULT;
int BM_iter_as_array(BMesh *bm, const char itype, void *data, void **array, const int len); int BM_iter_as_array(BMesh *bm, const char itype, void *data, void **array, const int len);
void *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len, void *BM_iter_as_arrayN(BMesh *bm, const char itype, void *data, int *r_len,
@@ -196,9 +195,9 @@ void *BMO_iter_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *sl
int *r_len, int *r_len,
/* optional args to avoid an alloc (normally stack array) */ /* optional args to avoid an alloc (normally stack array) */
void **stack_array, int stack_array_size); void **stack_array, int stack_array_size);
int BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const bool value); int BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const bool value);
int BMO_iter_elem_count_flag(BMesh *bm, const char itype, void *data, const short oflag, const bool value); int BMO_iter_elem_count_flag(BMesh *bm, const char itype, void *data, const short oflag, const bool value);
int BM_iter_mesh_count(const char itype, BMesh *bm);
int BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const bool value); int BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const bool value);
/* private for bmesh_iterators_inline.c */ /* private for bmesh_iterators_inline.c */

View File

@@ -95,7 +95,7 @@ static void verttag_add_adjacent(Heap *heap, BMVert *v_a, BMVert **verts_prev, f
LinkNode *BM_mesh_calc_path_vert( LinkNode *BM_mesh_calc_path_vert(
BMesh *bm, BMVert *v_src, BMVert *v_dst, const bool use_length, BMesh *bm, BMVert *v_src, BMVert *v_dst, const bool use_length,
void *user_data, bool (*test_fn)(BMVert *, void *user_data)) bool (*test_fn)(BMVert *, void *user_data), void *user_data)
{ {
LinkNode *path = NULL; LinkNode *path = NULL;
/* BM_ELEM_TAG flag is used to store visited edges */ /* BM_ELEM_TAG flag is used to store visited edges */
@@ -221,7 +221,7 @@ static void edgetag_add_adjacent(Heap *heap, BMEdge *e1, BMEdge **edges_prev, fl
LinkNode *BM_mesh_calc_path_edge( LinkNode *BM_mesh_calc_path_edge(
BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const bool use_length, BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const bool use_length,
void *user_data, bool (*filter_fn)(BMEdge *, void *user_data)) bool (*filter_fn)(BMEdge *, void *user_data), void *user_data)
{ {
LinkNode *path = NULL; LinkNode *path = NULL;
/* BM_ELEM_TAG flag is used to store visited edges */ /* BM_ELEM_TAG flag is used to store visited edges */
@@ -347,7 +347,7 @@ static void facetag_add_adjacent(Heap *heap, BMFace *f_a, BMFace **faces_prev, f
LinkNode *BM_mesh_calc_path_face( LinkNode *BM_mesh_calc_path_face(
BMesh *bm, BMFace *f_src, BMFace *f_dst, const bool use_length, BMesh *bm, BMFace *f_src, BMFace *f_dst, const bool use_length,
void *user_data, bool (*test_fn)(BMFace *, void *user_data)) bool (*test_fn)(BMFace *, void *user_data), void *user_data)
{ {
LinkNode *path = NULL; LinkNode *path = NULL;
/* BM_ELEM_TAG flag is used to store visited edges */ /* BM_ELEM_TAG flag is used to store visited edges */

View File

@@ -29,14 +29,14 @@
struct LinkNode *BM_mesh_calc_path_vert( struct LinkNode *BM_mesh_calc_path_vert(
BMesh *bm, BMVert *v_src, BMVert *v_dst, const bool use_length, BMesh *bm, BMVert *v_src, BMVert *v_dst, const bool use_length,
void *user_data, bool (*filter_fn)(BMVert *, void *)); bool (*filter_fn)(BMVert *, void *), void *user_data);
struct LinkNode *BM_mesh_calc_path_edge( struct LinkNode *BM_mesh_calc_path_edge(
BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const bool use_length, BMesh *bm, BMEdge *e_src, BMEdge *e_dst, const bool use_length,
void *user_data, bool (*filter_fn)(BMEdge *, void *)); bool (*filter_fn)(BMEdge *, void *), void *user_data);
struct LinkNode *BM_mesh_calc_path_face( struct LinkNode *BM_mesh_calc_path_face(
BMesh *bm, BMFace *f_src, BMFace *f_dst, const bool use_length, BMesh *bm, BMFace *f_src, BMFace *f_dst, const bool use_length,
void *user_data, bool (*test_fn)(BMFace *, void *)); bool (*test_fn)(BMFace *, void *), void *user_data);
#endif /* __BMESH_PATH_H__ */ #endif /* __BMESH_PATH_H__ */

View File

@@ -99,7 +99,7 @@ static bool mouse_mesh_shortest_path_vert(ViewContext *vc)
if (v_act && (v_act != v_dst)) { if (v_act && (v_act != v_dst)) {
if ((path = BM_mesh_calc_path_vert(bm, v_act, v_dst, use_length, if ((path = BM_mesh_calc_path_vert(bm, v_act, v_dst, use_length,
&user_data, verttag_filter_cb))) verttag_filter_cb, &user_data)))
{ {
BM_select_history_remove(bm, v_act); BM_select_history_remove(bm, v_act);
} }
@@ -267,7 +267,7 @@ static bool mouse_mesh_shortest_path_edge(ViewContext *vc)
if (e_act && (e_act != e_dst)) { if (e_act && (e_act != e_dst)) {
if ((path = BM_mesh_calc_path_edge(bm, e_act, e_dst, use_length, if ((path = BM_mesh_calc_path_edge(bm, e_act, e_dst, use_length,
&user_data, edgetag_filter_cb))) edgetag_filter_cb, &user_data)))
{ {
BM_select_history_remove(bm, e_act); BM_select_history_remove(bm, e_act);
} }
@@ -388,7 +388,7 @@ static bool mouse_mesh_shortest_path_face(ViewContext *vc)
if (f_act) { if (f_act) {
if (f_act != f_dst) { if (f_act != f_dst) {
if ((path = BM_mesh_calc_path_face(bm, f_act, f_dst, use_length, if ((path = BM_mesh_calc_path_face(bm, f_act, f_dst, use_length,
&user_data, facetag_filter_cb))) facetag_filter_cb, &user_data)))
{ {
BM_select_history_remove(bm, f_act); BM_select_history_remove(bm, f_act);
} }