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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-11 09:27:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-11 09:27:15 +0400
commit2f436612fe0e4e2986452c3b9d0249b8fd340f8b (patch)
tree295b9822f987224573698cb4cd406fbf70a79468 /source
parenta0ae47f06c6232a91202bd06ea173b955735596b (diff)
replace BM_vert_face_count() use of BM_LOOPS_OF_VERT iterator with a direct call to bmesh_disk_facevert_count()
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/intern/bmesh_queries.c50
1 files changed, 15 insertions, 35 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c
index a9f146e4962..d850eb34477 100644
--- a/source/blender/bmesh/intern/bmesh_queries.c
+++ b/source/blender/bmesh/intern/bmesh_queries.c
@@ -470,31 +470,12 @@ int BM_edge_face_count(BMEdge *e)
}
/**
- * Returns the number of faces around this vert
+ * Returns the number of faces around this vert
+ * length matches #BM_LOOPS_OF_VERT iterator
*/
int BM_vert_face_count(BMVert *v)
{
- int count = 0;
- BMLoop *l;
- BMIter iter;
-
- BM_ITER_ELEM (l, &iter, v, BM_LOOPS_OF_VERT) {
- count++;
- }
-
- return count;
-#if 0 //this code isn't working
- BMEdge *curedge = NULL;
-
- if (v->e) {
- curedge = v->e;
- do {
- if (curedge->l) count += BM_edge_face_count(curedge);
- curedge = bmesh_disk_edge_next(curedge, v);
- } while (curedge != v->e);
- }
- return count;
-#endif
+ return bmesh_disk_facevert_count(v);
}
/**
@@ -503,22 +484,21 @@ int BM_vert_face_count(BMVert *v)
*/
int BM_vert_is_wire(BMVert *v)
{
- BMEdge *curedge;
+ if (v->e) {
+ BMEdge *e_first, *e_iter;
- if (v->e == NULL) {
+ e_first = e_iter = v->e;
+ do {
+ if (e_iter->l) {
+ return FALSE;
+ }
+ } while ((e_iter = bmesh_disk_edge_next(e_iter, v)) != e_first);
+
+ return TRUE;
+ }
+ else {
return FALSE;
}
-
- curedge = v->e;
- do {
- if (curedge->l) {
- return FALSE;
- }
-
- curedge = bmesh_disk_edge_next(curedge, v);
- } while (curedge != v->e);
-
- return TRUE;
}
/**