Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-02-26 02:23:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-02-26 02:23:40 +0400
commitc65b3b73fd2c0c0011ef36d8fc36301de4a42fe0 (patch)
tree3a45d161d5814bf403ffa9093a2d417b6f7a960e /source/blender/bmesh/intern/bmesh_operators.c
parent72e1316dc4b607440430779d78a26a76a4527c4b (diff)
bmesh api cleanup
* better type safety for BM_elem_flag_* and BM_elem_index_* functions. * add BMElem type to be used where BMFace/Edge/Vert/Loop can be interchanged. * fix bug in select manifold, found when making functions more strict.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operators.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_operators.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c
index f0898734d4c..af291eca072 100644
--- a/source/blender/bmesh/intern/bmesh_operators.c
+++ b/source/blender/bmesh/intern/bmesh_operators.c
@@ -693,7 +693,7 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
const char hflag, const char htype)
{
BMIter elements;
- BMHeader *e;
+ BMElem *ele;
BMOpSlot *output = BMO_slot_get(op, slotname);
int totelement = 0, i = 0;
@@ -703,27 +703,27 @@ void BMO_slot_from_hflag(BMesh *bm, BMOperator *op, const char *slotname,
bmo_slot_buffer_alloc(op, slotname, totelement);
if (htype & BM_VERT) {
- for (e = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
- if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, hflag)) {
- ((BMHeader **)output->data.p)[i] = e;
+ for (ele = BM_iter_new(&elements, bm, BM_VERTS_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
+ if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+ ((BMElem **)output->data.p)[i] = ele;
i++;
}
}
}
if (htype & BM_EDGE) {
- for (e = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
- if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, hflag)) {
- ((BMHeader **)output->data.p)[i] = e;
+ for (ele = BM_iter_new(&elements, bm, BM_EDGES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
+ if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+ ((BMElem **)output->data.p)[i] = ele;
i++;
}
}
}
if (htype & BM_FACE) {
- for (e = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); e; e = BM_iter_step(&elements)) {
- if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN) && BM_elem_flag_test(e, hflag)) {
- ((BMHeader **)output->data.p)[i] = e;
+ for (ele = BM_iter_new(&elements, bm, BM_FACES_OF_MESH, bm); ele; ele = BM_iter_step(&elements)) {
+ if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) && BM_elem_flag_test(ele, hflag)) {
+ ((BMElem **)output->data.p)[i] = ele;
i++;
}
}
@@ -796,7 +796,7 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam
const char hflag, const char htype, char do_flush_select)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
- BMHeader **data = slot->data.p;
+ BMElem **data = slot->data.p;
int i;
BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
@@ -806,7 +806,7 @@ void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotnam
}
for (i = 0; i < slot->len; i++) {
- if (!(htype & data[i]->htype))
+ if (!(htype & data[i]->head.htype))
continue;
if (do_flush_select) {
@@ -827,7 +827,7 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotna
const char hflag, const char htype, char do_flush_select)
{
BMOpSlot *slot = BMO_slot_get(op, slotname);
- BMHeader **data = slot->data.p;
+ BMElem **data = slot->data.p;
int i;
BLI_assert(slot->slottype > BMO_OP_SLOT_VEC);
@@ -837,7 +837,7 @@ void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotna
}
for (i = 0; i < slot->len; i++) {
- if (!(htype & data[i]->htype))
+ if (!(htype & data[i]->head.htype))
continue;
if (do_flush_select) {