diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/bmesh.h | 12 | ||||
-rw-r--r-- | source/blender/bmesh/bmesh_marking.h | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_construct.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_inline.c | 34 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_marking.c | 32 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_newcore.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_private.h | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_subdivide.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/bmesh_tools.c | 10 |
9 files changed, 55 insertions, 55 deletions
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h index c72f846ed26..1b15e5497a8 100644 --- a/source/blender/bmesh/bmesh.h +++ b/source/blender/bmesh/bmesh.h @@ -144,12 +144,12 @@ BMFace *BM_face_create_ngon(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge **edges, i #define BM_elem_flag_toggle( ele, hflag) _bm_elem_flag_toggle (&(ele)->head, hflag) #define BM_elem_flag_merge( ele_a, ele_b) _bm_elem_flag_merge (&(ele_a)->head, &(ele_b)->head) -BM_INLINE char _bm_elem_flag_test(const BMHeader *element, const char hflag); -BM_INLINE void _bm_elem_flag_enable(BMHeader *element, const char hflag); -BM_INLINE void _bm_elem_flag_disable(BMHeader *element, const char hflag); -BM_INLINE void _bm_elem_flag_set(BMHeader *ele, const char hflag, const int val); -BM_INLINE void _bm_elem_flag_toggle(BMHeader *ele, const char hflag); -BM_INLINE void _bm_elem_flag_merge(BMHeader *ele_a, BMHeader *ele_b); +BM_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag); +BM_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag); +BM_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag); +BM_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val); +BM_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag); +BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b); /* notes on BM_elem_index_set(...) usage, * Set index is sometimes abused as temp storage, other times we cant be diff --git a/source/blender/bmesh/bmesh_marking.h b/source/blender/bmesh/bmesh_marking.h index 578cc137691..3f9f666ab3f 100644 --- a/source/blender/bmesh/bmesh_marking.h +++ b/source/blender/bmesh/bmesh_marking.h @@ -35,13 +35,15 @@ typedef struct BMEditSelection } BMEditSelection; /* geometry hiding code */ -void BM_elem_hide_set(BMesh *bm, void *element, int hide); +#define BM_elem_hide_set(bm, ele, hide) _bm_elem_hide_set(bm, &(ele)->head, hide) +void _bm_elem_hide_set(BMesh *bm, BMHeader *ele, int hide); void BM_vert_hide_set(BMesh *bm, BMVert *v, int hide); void BM_edge_hide_set(BMesh *bm, BMEdge *e, int hide); void BM_face_hide_set(BMesh *bm, BMFace *f, int hide); /* Selection code */ -void BM_elem_select_set(BMesh *bm, void *element, int select); +#define BM_elem_select_set(bm, ele, hide) _bm_elem_select_set(bm, &(ele)->head, hide) +void _bm_elem_select_set(BMesh *bm, BMHeader *ele, int select); /* use BM_elem_flag_test(ele, BM_ELEM_SELECT) to test selection */ diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index dd122dbeab1..c91bd83ed0e 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -567,7 +567,7 @@ void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *sour /* First we copy select */ if (BM_elem_flag_test((BMElem *)sheader, BM_ELEM_SELECT)) { - BM_elem_select_set(target_mesh, target, TRUE); + BM_elem_select_set(target_mesh, (BMElem *)target, TRUE); } /* Now we copy flags */ diff --git a/source/blender/bmesh/intern/bmesh_inline.c b/source/blender/bmesh/intern/bmesh_inline.c index 0f2932fde24..f7a0fb5c45c 100644 --- a/source/blender/bmesh/intern/bmesh_inline.c +++ b/source/blender/bmesh/intern/bmesh_inline.c @@ -31,46 +31,46 @@ #include "bmesh.h" -BM_INLINE char _bm_elem_flag_test(const BMHeader *ele, const char hflag) +BM_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag) { - return ele->hflag & hflag; + return head->hflag & hflag; } -BM_INLINE void _bm_elem_flag_enable(BMHeader *ele, const char hflag) +BM_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag) { - ele->hflag |= hflag; + head->hflag |= hflag; } -BM_INLINE void _bm_elem_flag_disable(BMHeader *ele, const char hflag) +BM_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag) { - ele->hflag &= ~hflag; + head->hflag &= ~hflag; } -BM_INLINE void _bm_elem_flag_set(BMHeader *ele, const char hflag, const int val) +BM_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val) { - if (val) _bm_elem_flag_enable(ele, hflag); - else _bm_elem_flag_disable(ele, hflag); + if (val) _bm_elem_flag_enable(head, hflag); + else _bm_elem_flag_disable(head, hflag); } -BM_INLINE void _bm_elem_flag_toggle(BMHeader *ele, const char hflag) +BM_INLINE void _bm_elem_flag_toggle(BMHeader *head, const char hflag) { - ele->hflag ^= hflag; + head->hflag ^= hflag; } -BM_INLINE void _bm_elem_flag_merge(BMHeader *ele_a, BMHeader *ele_b) +BM_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b) { - ele_a->hflag = ele_b->hflag = ele_a->hflag | ele_b->hflag; + head_a->hflag = head_b->hflag = head_a->hflag | head_b->hflag; } -BM_INLINE void _bm_elem_index_set(BMHeader *ele, const int index) +BM_INLINE void _bm_elem_index_set(BMHeader *head, const int index) { - ele->index = index; + head->index = index; } -BM_INLINE int _bm_elem_index_get(const BMHeader *ele) +BM_INLINE int _bm_elem_index_get(const BMHeader *head) { - return ele->index; + return head->index; } #endif /* __BMESH_INLINE_C__ */ diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 78c85e089e1..8548c7816a9 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -475,19 +475,17 @@ int BM_mesh_count_flag(struct BMesh *bm, const char htype, const char hflag, int } /* note: by design, this will not touch the editselection history stuff */ -void BM_elem_select_set(struct BMesh *bm, void *element, int select) +void _bm_elem_select_set(struct BMesh *bm, BMHeader *head, int select) { - BMHeader *head = element; - switch (head->htype) { case BM_VERT: - BM_vert_select_set(bm, (BMVert *)element, select); + BM_vert_select_set(bm, (BMVert *)head, select); break; case BM_EDGE: - BM_edge_select_set(bm, (BMEdge *)element, select); + BM_edge_select_set(bm, (BMEdge *)head, select); break; case BM_FACE: - BM_face_select_set(bm, (BMFace *)element, select); + BM_face_select_set(bm, (BMFace *)head, select); break; default: BLI_assert(0); @@ -881,25 +879,25 @@ void BM_face_hide_set(BMesh *bm, BMFace *f, int hide) } } -void BM_elem_hide_set(BMesh *bm, void *element, int hide) +void _bm_elem_hide_set(BMesh *bm, BMHeader *head, int hide) { - BMHeader *h = element; - /* Follow convention of always deselecting before * hiding an element */ - if (hide) { - BM_elem_select_set(bm, element, FALSE); - } - - switch (h->htype) { + switch (head->htype) { case BM_VERT: - BM_vert_hide_set(bm, element, hide); + if (hide) BM_vert_select_set(bm, (BMVert *)head, FALSE); + BM_vert_hide_set(bm, (BMVert *)head, hide); break; case BM_EDGE: - BM_edge_hide_set(bm, element, hide); + if (hide) BM_edge_select_set(bm, (BMEdge *)head, FALSE); + BM_edge_hide_set(bm, (BMEdge *)head, hide); break; case BM_FACE: - BM_face_hide_set(bm, element, hide); + if (hide) BM_face_select_set(bm, (BMFace *)head, FALSE); + BM_face_hide_set(bm, (BMFace *)head, hide); + break; + default: + BMESH_ASSERT(0); break; } } diff --git a/source/blender/bmesh/intern/bmesh_newcore.c b/source/blender/bmesh/intern/bmesh_newcore.c index e0f50481e00..0d1475aaec4 100644 --- a/source/blender/bmesh/intern/bmesh_newcore.c +++ b/source/blender/bmesh/intern/bmesh_newcore.c @@ -330,7 +330,7 @@ BMFace *BM_face_create(BMesh *bm, BMVert **verts, BMEdge **edges, const int len, return f; } -int bmesh_element_check(BMesh *UNUSED(bm), void *element, const char htype) +int bmesh_elem_check(BMesh *UNUSED(bm), void *element, const char htype) { BMHeader *head = element; int err = 0; diff --git a/source/blender/bmesh/intern/bmesh_private.h b/source/blender/bmesh/intern/bmesh_private.h index 730078a5f4d..c62a135bb4e 100644 --- a/source/blender/bmesh/intern/bmesh_private.h +++ b/source/blender/bmesh/intern/bmesh_private.h @@ -40,13 +40,13 @@ struct Link; struct BMLoop; /* returns positive nonzero on error */ -int bmesh_element_check(BMesh *bm, void *element, const char htype); +int bmesh_elem_check(BMesh *bm, void *element, const char htype); #define BM_CHECK_ELEMENT(bm, el) \ - if (bmesh_element_check(bm, el, ((BMHeader *)el)->htype)) { \ + if (bmesh_elem_check(bm, el, ((BMHeader *)el)->htype)) { \ printf("check_element failure, with code %i on line %i in file\n" \ " \"%s\"\n\n", \ - bmesh_element_check(bm, el, ((BMHeader *)el)->htype), \ + bmesh_elem_check(bm, el, ((BMHeader *)el)->htype), \ __LINE__, __FILE__); \ } diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 9967764200e..efbb31d9cb3 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -1031,7 +1031,7 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s if (seltype == SUBDIV_SELECT_INNER) { BMOIter iter; - BMHeader *ele; + BMElem *ele; // int i; ele = BMO_iter_new(&iter, bm, &op, "outinner", BM_EDGE|BM_VERT); @@ -1041,7 +1041,7 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s } else if (seltype == SUBDIV_SELECT_LOOPCUT) { BMOIter iter; - BMHeader *ele; + BMElem *ele; // int i; /* deselect input */ @@ -1051,7 +1051,7 @@ void BM_mesh_esubdivideflag(Object *UNUSED(obedit), BMesh *bm, int flag, float s for ( ; ele; ele = BMO_iter_step(&iter)) { BM_elem_select_set(bm, ele, TRUE); - if (ele->htype == BM_VERT) { + if (ele->head.htype == BM_VERT) { BMEdge *e; BMIter eiter; diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 7dd34c907b1..5bc40079613 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -245,7 +245,7 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, BMEdge *edge; BMFace *f; ModifierData *md; - BMHeader *el; + BMElem *ele; BMO_op_init(bm, &extop, "extrudefaceregion"); BMO_slot_from_hflag(bm, &extop, "edgefacein", @@ -315,11 +315,11 @@ static short EDBM_Extrude_edge(Object *obedit, BMEditMesh *em, const char hflag, nor[0] = nor[1] = nor[2] = 0.0f; - BMO_ITER(el, &siter, bm, &extop, "geomout", BM_ALL) { - BM_elem_select_set(bm, el, TRUE); + BMO_ITER(ele, &siter, bm, &extop, "geomout", BM_ALL) { + BM_elem_select_set(bm, ele, TRUE); - if (el->htype == BM_FACE) { - f = (BMFace *)el; + if (ele->head.htype == BM_FACE) { + f = (BMFace *)ele; add_normal_aligned(nor, f->no); }; } |