diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-22 21:19:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-22 21:19:05 +0400 |
commit | 23baf8c9c366a6f4e029de0119e72de45722d1f0 (patch) | |
tree | 16bf608f71c21878ae02d554d9bb0455db9d4bf2 /source/blender/bmesh | |
parent | 612768760ada094b0a6d47982d747394830a7a71 (diff) |
code cleanup: check defgroup_name_index() return value != -1, rather then checking >= 0.
also remove unused bmesh decimator code.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_decimate.c | 45 |
2 files changed, 1 insertions, 46 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 2fcdc4b03ef..cff7da78ef2 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -226,7 +226,7 @@ enum { BM_ELEM_DRAW = (1 << 5), /* edge display */ /* spare tag, assumed dirty, use define in each function to name based on use */ - _BM_ELEM_TAG_ALT = (1 << 6), + // _BM_ELEM_TAG_ALT = (1 << 6), // UNUSED BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging, * since tools may want to tag verts and diff --git a/source/blender/bmesh/intern/bmesh_decimate.c b/source/blender/bmesh/intern/bmesh_decimate.c index 978a1674121..ed68d47c6b0 100644 --- a/source/blender/bmesh/intern/bmesh_decimate.c +++ b/source/blender/bmesh/intern/bmesh_decimate.c @@ -45,19 +45,12 @@ /* defines for testing */ #define USE_CUSTOMDATA #define USE_TRIANGULATE -// #define USE_PRESERVE_BOUNDARY /* could disable but its nicer not to mix boundary/non-boundry verts */ /* these checks are for rare cases that we can't avoid since they are valid meshes still */ #define USE_SAFETY_CHECKS #define BOUNDARY_PRESERVE_WEIGHT 100.0f - -#ifdef USE_PRESERVE_BOUNDARY -/* re-use smooth for tagging boundary edges, not totally great */ -#define BM_ELEM_IS_BOUNDARY _BM_ELEM_TAG_ALT -#endif - typedef enum CD_UseFlag { CD_DO_VERT, CD_DO_EDGE, @@ -112,12 +105,6 @@ static void bm_decim_build_quadrics(BMesh *bm, Quadric *vquadrics) BLI_quadric_add_qu_qu(&vquadrics[BM_elem_index_get(e->v2)], &q); } } -#ifdef USE_PRESERVE_BOUNDARY - /* init: runs first! */ - /* unrelated, but do on an edge loop before we start collapsing */ - BM_elem_flag_disable(e->v1, BM_ELEM_IS_BOUNDARY); - BM_elem_flag_disable(e->v2, BM_ELEM_IS_BOUNDARY); -#endif } } @@ -222,15 +209,6 @@ static void bm_decim_build_edge_cost(BMesh *bm, BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) { eheap_table[i] = NULL; /* keep sanity check happy */ bm_decim_build_edge_cost_single(e, vquadrics, vweights, eheap, eheap_table); - -#ifdef USE_PRESERVE_BOUNDARY - /* init: runs second! */ - if (BM_edge_is_boundary(e)) { - /* unrelated, but do on an edge loop before we start collapsing */ - BM_elem_flag_enable(e->v1, BM_ELEM_IS_BOUNDARY); - BM_elem_flag_enable(e->v2, BM_ELEM_IS_BOUNDARY); - } -#endif } } @@ -525,29 +503,6 @@ static int bm_edge_collapse_is_degenerate(BMEdge *e_first) BMEdge *e_iter; -#ifdef USE_PRESERVE_BOUNDARY - const int is_boundary = BM_edge_is_boundary(e_first); - - if (BM_elem_flag_test(e_first->v1, BM_ELEM_IS_BOUNDARY) != - BM_elem_flag_test(e_first->v2, BM_ELEM_IS_BOUNDARY)) - { - return TRUE; - } - if ((is_boundary == FALSE) && - (BM_elem_flag_test(e_first->v1, BM_ELEM_IS_BOUNDARY) || - BM_elem_flag_test(e_first->v2, BM_ELEM_IS_BOUNDARY))) - { - return TRUE; - } - - /* sanity */ - if (is_boundary == TRUE) { - BLI_assert(BM_elem_flag_test(e_first->v1, BM_ELEM_IS_BOUNDARY) != FALSE); - BLI_assert(BM_elem_flag_test(e_first->v2, BM_ELEM_IS_BOUNDARY) != FALSE); - } - -#endif /* USE_PRESERVE_BOUNDARY */ - /* clear flags on both disks */ e_iter = e_first; do { |