[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36941] branches/soc-2011-avocado/blender/ source/blender/editors/mesh/bmesh_tools.c: Test code written to compute dual graph of mesh using only small fixed size array .
shuvro sarker
shuvro05 at gmail.com
Fri May 27 03:55:53 CEST 2011
Revision: 36941
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36941
Author: shuvro
Date: 2011-05-27 01:55:52 +0000 (Fri, 27 May 2011)
Log Message:
-----------
Test code written to compute dual graph of mesh using only small fixed size array.
Modified Paths:
--------------
branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c
Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c 2011-05-26 23:51:02 UTC (rev 36940)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/bmesh_tools.c 2011-05-27 01:55:52 UTC (rev 36941)
@@ -1227,6 +1227,42 @@
RNA_def_boolean(ot->srna, "inclusive", 0, "Inclusive", "Selects geometry around selected geometry, occording to selection mode");
}
+static int compute_dual_graph(BMesh *bm)
+{
+ BMEdge *eed;
+ BMIter iter, iter2;
+ BMLoop *l;
+ //int count = 0;
+
+ float dummy_dual_graph[1000][1000];
+ int i,face_index[2];
+
+
+ for(eed = BMIter_New(&iter, bm, BM_EDGES_OF_MESH, bm ); eed; eed= BMIter_Step(&iter))
+ {
+ /* if not boundary edge */
+ if(!BM_Boundary_Edge(eed)){
+
+ printf("index : %d\n", eed->head.index);
+ i = 0;
+
+ BM_ITER(l, &iter2, bm, BM_LOOPS_OF_EDGE, eed) {
+ printf("%d ", l->f->head.index);
+ face_index[i++] = l->f->head.index;
+ }
+ dummy_dual_graph[face_index[0]][face_index[1]] = 1;
+ }
+ else
+ {
+ printf("visiting boundary edge.\n");
+ }
+ }
+
+
+ return 0;
+}
+
+
/* ************************* SEAMS AND EDGES **************** */
static int editbmesh_mark_seam(bContext *C, wmOperator *op)
@@ -1263,6 +1299,7 @@
/* just as a demo to show call to autoseam */
BKE_use_autoseam();
+ compute_dual_graph(bm);
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
More information about the Bf-blender-cvs
mailing list