diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 18:47:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 18:47:53 +0400 |
commit | c8ebfe1d12f87ae453fc9191fa7e3ae30aa800d4 (patch) | |
tree | 5fec94cb3019a6957fb8f094e51d34577c6dbeaa /source/blender/editors/mesh | |
parent | a55e97058b409dc9d62cbfc1634acd3810a2af0e (diff) |
code cleanup:
- use bmesh iterator macros in more places
- rename scanfill variables (were using same names as mesh faces/verts which was confusing)
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 5a99ddb9332..d49b77c7005 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1866,8 +1866,8 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) for (i = 0; i < totface; i++) { SmallHash *hash = &shash; - ScanFillFace *efa; - ScanFillVert *eve, *lasteve; + ScanFillFace *sf_tri; + ScanFillVert *sf_vert, *sf_vert_last; int j; float rndscale = FLT_EPSILON * 25; @@ -1881,55 +1881,55 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) for (entry = face_nets[i].first; entry; entry = entry->next) { if (!BLI_smallhash_haskey(hash, (intptr_t)entry->kfe->v1)) { - eve = BLI_scanfill_vert_add(&sf_ctx, entry->kfe->v1->v->co); - eve->poly_nr = 0; - rnd_offset_co(eve->co, rndscale); - eve->tmp.p = entry->kfe->v1->v; - BLI_smallhash_insert(hash, (intptr_t)entry->kfe->v1, eve); + sf_vert = BLI_scanfill_vert_add(&sf_ctx, entry->kfe->v1->v->co); + sf_vert->poly_nr = 0; + rnd_offset_co(sf_vert->co, rndscale); + sf_vert->tmp.p = entry->kfe->v1->v; + BLI_smallhash_insert(hash, (intptr_t)entry->kfe->v1, sf_vert); } if (!BLI_smallhash_haskey(hash, (intptr_t)entry->kfe->v2)) { - eve = BLI_scanfill_vert_add(&sf_ctx, entry->kfe->v2->v->co); - eve->poly_nr = 0; - rnd_offset_co(eve->co, rndscale); - eve->tmp.p = entry->kfe->v2->v; - BLI_smallhash_insert(hash, (intptr_t)entry->kfe->v2, eve); + sf_vert = BLI_scanfill_vert_add(&sf_ctx, entry->kfe->v2->v->co); + sf_vert->poly_nr = 0; + rnd_offset_co(sf_vert->co, rndscale); + sf_vert->tmp.p = entry->kfe->v2->v; + BLI_smallhash_insert(hash, (intptr_t)entry->kfe->v2, sf_vert); } } for (j = 0, entry = face_nets[i].first; entry; entry = entry->next, j++) { - lasteve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v1); - eve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v2); + sf_vert_last = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v1); + sf_vert = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v2); - eve->poly_nr++; - lasteve->poly_nr++; + sf_vert->poly_nr++; + sf_vert_last->poly_nr++; } for (j = 0, entry = face_nets[i].first; entry; entry = entry->next, j++) { - lasteve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v1); - eve = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v2); + sf_vert_last = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v1); + sf_vert = BLI_smallhash_lookup(hash, (intptr_t)entry->kfe->v2); - if (eve->poly_nr > 1 && lasteve->poly_nr > 1) { - ScanFillEdge *eed; - eed = BLI_scanfill_edge_add(&sf_ctx, lasteve, eve); + if (sf_vert->poly_nr > 1 && sf_vert_last->poly_nr > 1) { + ScanFillEdge *sf_edge; + sf_edge = BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert); if (entry->kfe->oe) - eed->f = SF_EDGE_BOUNDARY; /* mark as original boundary edge */ + sf_edge->f = SF_EDGE_BOUNDARY; /* mark as original boundary edge */ BMO_elem_flag_disable(bm, entry->kfe->e->v1, DEL); BMO_elem_flag_disable(bm, entry->kfe->e->v2, DEL); } else { - if (lasteve->poly_nr < 2) - BLI_remlink(&sf_ctx.fillvertbase, lasteve); - if (eve->poly_nr < 2) - BLI_remlink(&sf_ctx.fillvertbase, eve); + if (sf_vert_last->poly_nr < 2) + BLI_remlink(&sf_ctx.fillvertbase, sf_vert_last); + if (sf_vert->poly_nr < 2) + BLI_remlink(&sf_ctx.fillvertbase, sf_vert); } } BLI_scanfill_calc(&sf_ctx, FALSE); - for (efa = sf_ctx.fillfacebase.first; efa; efa = efa->next) { - BMVert *v1 = efa->v3->tmp.p, *v2 = efa->v2->tmp.p, *v3 = efa->v1->tmp.p; + for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) { + BMVert *v1 = sf_tri->v3->tmp.p, *v2 = sf_tri->v2->tmp.p, *v3 = sf_tri->v1->tmp.p; BMFace *f2; BMLoop *l_iter; BMVert *verts[3] = {v1, v2, v3}; |