diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-14 20:42:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-14 20:42:43 +0400 |
commit | b27854bd47104300a484e3b06185b2cb1fa0b774 (patch) | |
tree | 3be00fa743238e3a50283f56d595d978ed36667b /source/blender/bmesh/operators/bmo_dissolve.c | |
parent | 6cdbd1b1aaae0f8b3018ecf2648699a0ea6d6be8 (diff) |
use booleans for bmesh api.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_dissolve.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_dissolve.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index d23c6d7332a..47b2497816f 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -41,7 +41,7 @@ #define VERT_MARK 1 -static int UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f) +static bool UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f) { BMWalker regwalker; BMIter liter2; @@ -62,14 +62,14 @@ static int UNUSED_FUNCTION(check_hole_in_region) (BMesh * bm, BMFace * f) BMO_elem_flag_test(bm, l2->f, FACE_MARK)) { if (!BMO_elem_flag_test(bm, l2->e, EDGE_MARK)) { - return FALSE; + return false; } } } } BMW_end(®walker); - return TRUE; + return true; } void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) @@ -83,7 +83,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) BMWalker regwalker; int i; - int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); + const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); if (use_verts) { /* tag verts that start out with only 2 edges, @@ -147,7 +147,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) while (faces[tot]) tot++; - f = BM_faces_join(bm, faces, tot, TRUE); + f = BM_faces_join(bm, faces, tot, true); if (!f) { BMO_error_raise(bm, op, BMERR_DISSOLVEFACES_FAILED, "Could not create merged face"); @@ -171,7 +171,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op) BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { if (BM_vert_edge_count(v) == 2) { - BM_vert_collapse_edge(bm, v->e, v, TRUE); + BM_vert_collapse_edge(bm, v->e, v, true); } } } @@ -212,7 +212,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op) /* BMESH_TODO - check on delaying edge removal since we may end up removing more then * one edge, and later reference a removed edge */ - BM_faces_join_pair(bm, fa, fb, e, TRUE); + BM_faces_join_pair(bm, fa, fb, e, true); } } @@ -225,7 +225,7 @@ void bmo_dissolve_edgeloop_exec(BMesh *bm, BMOperator *op) /* clean up extreneous 2-valence vertice */ for (i = 0; i < BLI_array_count(verts); i++) { if (verts[i]->e) { - BM_vert_collapse_edge(bm, verts[i]->e, verts[i], TRUE); + BM_vert_collapse_edge(bm, verts[i]->e, verts[i], true); } } @@ -251,7 +251,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) BMIter viter; BMVert *v; - int use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); + const bool use_verts = BMO_slot_bool_get(op->slots_in, "use_verts"); if (use_verts) { BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { @@ -268,7 +268,7 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) /* BMESH_TODO - check on delaying edge removal since we may end up removing more then * one edge, and later reference a removed edge */ - BM_faces_join_pair(bm, fa, fb, e, TRUE); + BM_faces_join_pair(bm, fa, fb, e, true); } } @@ -276,20 +276,20 @@ void bmo_dissolve_edges_exec(BMesh *bm, BMOperator *op) BM_ITER_MESH (v, &viter, bm, BM_VERTS_OF_MESH) { if (BMO_elem_flag_test(bm, v, VERT_MARK)) { if (BM_vert_edge_count(v) == 2) { - BM_vert_collapse_edge(bm, v->e, v, TRUE); + BM_vert_collapse_edge(bm, v->e, v, true); } } } } } -static int test_extra_verts(BMesh *bm, BMVert *v) +static bool test_extra_verts(BMesh *bm, BMVert *v) { BMIter iter, liter, iter2, iter3; BMFace *f, *f2; BMLoop *l; BMEdge *e; - int found; + bool found; /* test faces around verts for verts that would be wrongly killed * by dissolve faces. */ @@ -302,31 +302,31 @@ static int test_extra_verts(BMesh *bm, BMVert *v) * then dissolve faces won't destroy it. * also if it forms a boundary with one * of the face region */ - found = FALSE; + found = false; e = BM_iter_new(&iter2, bm, BM_EDGES_OF_VERT, l->v); for ( ; e; e = BM_iter_step(&iter2)) { if (BM_edge_is_boundary(e)) { - found = TRUE; + found = true; } f2 = BM_iter_new(&iter3, bm, BM_FACES_OF_EDGE, e); for ( ; f2; f2 = BM_iter_step(&iter3)) { if (!BMO_elem_flag_test(bm, f2, FACE_MARK)) { - found = TRUE; + found = true; break; } } - if (found == TRUE) { + if (found == true) { break; } } - if (found == FALSE) { - return FALSE; + if (found == false) { + return false; } } } } - return TRUE; + return true; } void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) { @@ -346,9 +346,9 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op) /* previously the faces were joined, but collapsing between 2 edges * gives some advantage/difference in using vertex-dissolve over edge-dissolve */ #if 0 - BM_vert_collapse_faces(bm, v->e, v, 1.0f, TRUE, TRUE); + BM_vert_collapse_faces(bm, v->e, v, 1.0f, true, true); #else - BM_vert_collapse_edge(bm, v->e, v, TRUE); + BM_vert_collapse_edge(bm, v->e, v, true); #endif continue; @@ -480,7 +480,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op) BMOpSlot *vinput = BMO_slot_get(op->slots_in, "verts"); const float angle_max = (float)M_PI / 2.0f; const float angle_limit = min_ff(angle_max, BMO_slot_float_get(op->slots_in, "angle_limit")); - const int do_dissolve_boundaries = BMO_slot_bool_get(op->slots_in, "use_dissolve_boundaries"); + const bool do_dissolve_boundaries = BMO_slot_bool_get(op->slots_in, "use_dissolve_boundaries"); BM_mesh_decimate_dissolve_ex(bm, angle_limit, do_dissolve_boundaries, (BMVert **)BMO_SLOT_AS_BUFFER(vinput), vinput->len, |