[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18207] branches/bmesh/bmesh: stuff compiles now

Joseph Eagar joeedh at gmail.com
Thu Jan 1 03:00:16 CET 2009


Revision: 18207
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18207
Author:   joeedh
Date:     2009-01-01 03:00:15 +0100 (Thu, 01 Jan 2009)

Log Message:
-----------
stuff compiles now

Modified Paths:
--------------
    branches/bmesh/bmesh/SConscript
    branches/bmesh/bmesh/bmesh_operators.h
    branches/bmesh/bmesh/intern/bmesh_mods.c
    branches/bmesh/bmesh/intern/bmesh_operators.c
    branches/bmesh/bmesh/intern/bmesh_walkers.c
    branches/bmesh/bmesh/operators/bmesh_dupeops.c
    branches/bmesh/bmesh/operators/subdivideop.c

Modified: branches/bmesh/bmesh/SConscript
===================================================================
--- branches/bmesh/bmesh/SConscript	2009-01-01 01:47:36 UTC (rev 18206)
+++ branches/bmesh/bmesh/SConscript	2009-01-01 02:00:15 UTC (rev 18207)
@@ -21,6 +21,8 @@
 
 
 sources = env.Glob('intern/*.c')
+sources = env.Glob('operators/*.c')
+
 #sources += env.Glob('tools/*.c')
 
 incs = ['#/intern/guardedalloc'] 

Modified: branches/bmesh/bmesh/bmesh_operators.h
===================================================================
--- branches/bmesh/bmesh/bmesh_operators.h	2009-01-01 01:47:36 UTC (rev 18206)
+++ branches/bmesh/bmesh/bmesh_operators.h	2009-01-01 02:00:15 UTC (rev 18207)
@@ -12,7 +12,7 @@
   dynamically allocated arrays*/
 #define BMOP_OPSLOT_INT_BUF		10	
 #define BMOP_OPSLOT_FLT_BUF		11		
-#define BMOP_OPSLOT_PNT_BUF		12	
+#define BMOP_OPSLOT_PNT_BUF		12
 #define BMOP_OPSLOT_TYPES		13
 
 typedef struct BMOpSlot{
@@ -47,7 +47,6 @@
 void BMO_Init_Op(struct BMOperator *op, int opcode);
 void BMO_Exec_Op(struct BMesh *bm, struct BMOperator *op);
 void BMO_Finish_Op(struct BMesh *bm, struct BMOperator *op);
-void BMO_Init_Op(struct BMOpSlot *s1, struct BMOpSlot *s2);
 BMOpSlot *BMO_GetSlot(struct BMOperator *op, int slotcode);
 void BMO_CopySlot(struct BMOperator *source_op, struct BMOperator *dest_op, int src, int dst);
 void BMO_Set_Float(struct BMOperator *op, int slotcode, float f);
@@ -61,46 +60,61 @@
 void BMO_Flag_To_Slot(struct BMesh *bm, struct BMOperator *op, int slotcode, int flag, int type);
 void BMO_Flag_Buffer(struct BMesh *bm, struct BMOperator *op, int slotcode, int flag);
 
-#define BMOP_OPSLOT_INT			0
-#define BMOP_OPSLOT_FLT			1
-#define BMOP_OPSLOT_PNT			2
-#define BMOP_OPSLOT_VEC			3
-#define BMOP_OPSLOT_INT_BUF		4		
-#define BMOP_OPSLOT_FLT_BUF		5		
-#define BMOP_OPSLOT_PNT_BUF		6		
-#define BMOP_OPSLOT_TYPES		7
-
 /*defines for individual operators*/
 /*split op*/
 #define BMOP_SPLIT				0
-#define BMOP_SPLIT_MULTINPUT	0
-#define BMOP_SPLIT_MULTOUTPUT	1
-#define BMOP_SPLIT_TOTSLOT		2
+#define BMOP_SPLIT_VINPUT		1
+#define BMOP_SPLIT_EINPUT		2
+#define BMOP_SPLIT_FINPUT		3
+#define BMOP_SPLIT_VOUTPUT		4
+#define BMOP_SPLIT_EOUTPUT		5
+#define BMOP_SPLIT_FOUTPUT		6
+#define BMOP_SPLIT_TOTSLOT		7
 
 const int BMOP_SPLIT_TYPEINFO[BMOP_SPLIT_TOTSLOT] = {
 	BMOP_OPSLOT_PNT_BUF,
-	BMOP_OPSLOT_PNT_BUF
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
 };
 
-/*----------begin operator defines--------*/
+/*--------------------begin operator defines------------------------*/
 /*dupe op*/
 #define BMOP_DUPE				1
-#define BMOP_DUPE_MULTINPUT		0
-#define BMOP_DUPE_ORIGINAL		1
-#define BMOP_DUPE_NEW			2
-#define BMOP_DUPE_TOTSLOT		3
 
+#define BMOP_DUPE_VINPUT		0
+#define BMOP_DUPE_EINPUT		1
+#define BMOP_DUPE_FINPUT		2
+#define BMOP_DUPE_VORIGINAL		3
+#define BMOP_DUPE_EORIGINAL		4
+#define BMOP_DUPE_FORIGINAL		5
+#define BMOP_DUPE_VNEW			6
+#define BMOP_DUPE_ENEW			7
+#define BMOP_DUPE_FNEW			8
+#define BMOP_DUPE_TOTSLOT		9
+
 const int BMOP_DUPE_TYPEINFO[BMOP_DUPE_TOTSLOT] = {
 	BMOP_OPSLOT_PNT_BUF,
 	BMOP_OPSLOT_PNT_BUF,
-	BMOP_OPSLOT_PNT_BUF
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
 };
 
 /*delete op*/
 #define BMOP_DEL			2
-#define BMOP_DEL_MULTINPUT	0
-#define BMOP_DEL_CONTEXT	1
-#define BMOP_DEL_TOTSLOT	2
+#define BMOP_DEL_VINPUT		0
+#define BMOP_DEL_EINPUT		1
+#define BMOP_DEL_FINPUT		2
+#define BMOP_DEL_CONTEXT	3
+#define BMOP_DEL_TOTSLOT	4
 
 /*BMOP_DEL_CONTEXT*/
 #define BMOP_DEL_VERTS				1
@@ -111,6 +125,8 @@
 
 const int BMOP_DEL_TYPEINFO[BMOP_DEL_TOTSLOT] = {
 	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
+	BMOP_OPSLOT_PNT_BUF,
 	BMOP_OPSLOT_INT
 };
 
@@ -128,27 +144,37 @@
 #define BMOP_TO_EDITMESH_EM		0
 #define BMOP_TO_EDITMESH_TOTSLOT 1
 
-/*keep this updated!*/
-#define BMOP_TOTAL_OPS				5
-/*----------end operator defines--------*/
-
 const int BMOP_TO_EDITMESH_TYPEINFO[BMOP_TO_EDITMESH_TOTSLOT] = {
 	BMOP_OPSLOT_PNT
 };
 
+#define BMOP_ESUBDIVIDE			5
+#define BMOP_ESUBDIVIDE_EDGES	0
+#define BMOP_ESUBDIVIDE_TOTSLOT	1
+
+const int BMOP_ESUBDIVIDE_TYPEINFO[] = {
+	BMOP_OPSLOT_PNT_BUF
+};
+
+/*keep this updated!*/
+#define BMOP_TOTAL_OPS				6
+/*-------------------------------end operator defines-------------------------------*/
+
 /*Following arrays are used by the init functions to init operator slot typecodes*/
 const int *BMOP_TYPEINFO[BMOP_TOTAL_OPS] = {
 	BMOP_SPLIT_TYPEINFO,
 	BMOP_DEL_TYPEINFO,
 	BMOP_FROM_EDITMESH_TYPEINFO,
-	BMOP_TO_EDITMESH_TYPEINFO
+	BMOP_TO_EDITMESH_TYPEINFO,
+	BMOP_ESUBDIVIDE_TYPEINFO
 };
 
 const int BMOP_TYPETOTALS[BMOP_TOTAL_OPS] = {
 	BMOP_SPLIT_TOTSLOT,
 	BMOP_DEL_TOTSLOT,
 	BMOP_FROM_EDITMESH_TOTSLOT,
-	BMOP_TO_EDITMESH_TOTSLOT
+	BMOP_TO_EDITMESH_TOTSLOT,
+	BMOP_ESUBDIVIDE_TOTSLOT
 };
 
 #endif

Modified: branches/bmesh/bmesh/intern/bmesh_mods.c
===================================================================
--- branches/bmesh/bmesh/intern/bmesh_mods.c	2009-01-01 01:47:36 UTC (rev 18206)
+++ branches/bmesh/bmesh/intern/bmesh_mods.c	2009-01-01 02:00:15 UTC (rev 18207)
@@ -205,7 +205,7 @@
  *  purposes.
  *
  *  Returns -
- *	Nothing
+ *	the new vert
  */
 
 BMVert *BM_Split_Edge(BMesh *bm, BMVert *v, BMEdge *e, BMEdge **ne, float percent, int calcnorm) {

Modified: branches/bmesh/bmesh/intern/bmesh_operators.c
===================================================================
--- branches/bmesh/bmesh/intern/bmesh_operators.c	2009-01-01 01:47:36 UTC (rev 18206)
+++ branches/bmesh/bmesh/intern/bmesh_operators.c	2009-01-01 02:00:15 UTC (rev 18207)
@@ -319,7 +319,7 @@
 	if(totelement){
 		alloc_slot_buffer(op, slotcode, totelement);
 
-		if (type & BM_VERT) {
+		if (type & BMESH_VERT) {
 			for (e = BMIter_New(&elements, bm, BM_VERTS, bm); e; e = BMIter_Step(&elements)) {
 				if(BMO_TestFlag(bm, e, flag)){
 					((BMHeader**)output->data.p)[i] = e;
@@ -328,7 +328,7 @@
 			}
 		}
 
-		if (type & BM_EDGE) {
+		if (type & BMESH_EDGE) {
 			for (e = BMIter_New(&elements, bm, BM_EDGES, bm); e; e = BMIter_Step(&elements)) {
 				if(BMO_TestFlag(bm, e, flag)){
 					((BMHeader**)output->data.p)[i] = e;
@@ -337,7 +337,7 @@
 			}
 		}
 
-		if (type & BM_FACE) {
+		if (type & BMESH_FACE) {
 			for (e = BMIter_New(&elements, bm, BM_FACES, bm); e; e = BMIter_Step(&elements)) {
 				if(BMO_TestFlag(bm, e, flag)){
 					((BMHeader**)output->data.p)[i] = e;

Modified: branches/bmesh/bmesh/intern/bmesh_walkers.c
===================================================================
--- branches/bmesh/bmesh/intern/bmesh_walkers.c	2009-01-01 01:47:36 UTC (rev 18206)
+++ branches/bmesh/bmesh/intern/bmesh_walkers.c	2009-01-01 02:00:15 UTC (rev 18207)
@@ -27,7 +27,7 @@
 */
 
 /*Forward declerations*/
-static int request_walkerMask(struct BMMesh *bm);
+static int request_walkerMask(struct BMesh *bm);
 static void *bmeshWalker_walk(struct BMWalker *walker);
 static void bmeshWalker_popState(struct BMWalker *walker);
 static void bmeshWalker_pushState(struct BMWalker *walker);
@@ -55,7 +55,7 @@
  *
 */
 
-static int request_walkerMask(BMMesh *bm)
+static int request_walkerMask(BMesh *bm)
 {
 	int i;
 	for(i=0; i < BMESH_MAXWALKERS; i++){
@@ -79,7 +79,7 @@
  *
 */
 
-void bmeshWalker_init(BMWalker *walker, BMMesh *bm, int type, int searchmask)
+void bmeshWalker_init(BMWalker *walker, BMesh *bm, int type, int searchmask)
 {
 	int visitedmask = request_walkerMask(bm);
 	int size = 0;

Modified: branches/bmesh/bmesh/operators/bmesh_dupeops.c
===================================================================
--- branches/bmesh/bmesh/operators/bmesh_dupeops.c	2009-01-01 01:47:36 UTC (rev 18206)
+++ branches/bmesh/bmesh/operators/bmesh_dupeops.c	2009-01-01 02:00:15 UTC (rev 18207)
@@ -1,7 +1,24 @@
+#include "MEM_guardedalloc.h"
+
+#include "BKE_utildefines.h"
+
+#include "BLI_ghash.h"
+#include "BLI_memarena.h"
+#include "BLI_blenlib.h"
+#include "BLI_arithb.h"
+
 #include "bmesh.h"
 #include "bmesh_operators_private.h"
 
+/*local flag defines*/
+#define DUPE_INPUT		1			/*input from operator*/
+#define DUPE_NEW		2
+#define DUPE_DONE		4
 
+#ifndef SELECT
+#define SELECT		1
+#endif
+
 /*
  *  COPY VERTEX
  *
@@ -13,7 +30,7 @@
 	BMVert *target_vertex = NULL;
 
 	/*create a new vertex*/
-	target_vertex = BM_Make_Vert(target, source_vertex->co,  NULL);
+	target_vertex = BM_Make_Vert(target_mesh, source_vertex->co,  NULL);
 
 	/*insert new vertex into the vert hash*/
 	BLI_ghash_insert(vhash, source_vertex, target_vertex);	
@@ -21,9 +38,9 @@
 	/*copy custom data in this function since we cannot be assured that byte layout is same between meshes*/
 	CustomData_bmesh_copy_data(&source_mesh->vdata, &target_mesh->vdata, source_vertex->data, &target_vertex->data);	
 
-	/*Copy Markings*/
-	if(BM_Is_Selected((BMHeader*)source_vertex)) BM_Select_Vert(target_mesh, target_vertex, 1);
-	if(BM_Is_Hidden((BMHeader*)source_vertex)) BM_Mark_Hidden((BMHeader*)target_vertex, 1);
+	/*Copy Flags*/
+	if(source_vertex->head.flag & SELECT) BM_Select_Vert(target_mesh, target_vertex, 1);
+	target_vertex->head.flag |= source_vertex->head.flag;
 
 	BMO_SetFlag(target_mesh, (BMHeader*)target_vertex, DUPE_NEW);
 	
@@ -68,9 +85,8 @@
  *  Copy an existing face from one bmesh to another.
  *
 */
-static BMFace *copy_face(BMesh *source_mesh, BMFace *source_face, BMesh *target_mesh, BMEdge **edar, GHash *verthash, GHash *ehash)
+static BMFace *copy_face(BMesh *source_mesh, BMFace *source_face, BMesh *target_mesh, BMEdge **edar, GHash *vhash, GHash *ehash)
 {
-	BMEdge  *target_edge;
 	BMVert *target_vert1, *target_vert2;
 	BMLoop *source_loop, *target_loop;
 	BMFace *target_face = NULL;
@@ -78,7 +94,7 @@
 	
 	/*lookup the first and second verts*/
 	target_vert1 = BLI_ghash_lookup(vhash, source_face->loopbase->v);
-	target_vert2 = BLI_ghash_lookup(vhash, source_face->loopbase->next->v);
+	target_vert2 = BLI_ghash_lookup(vhash, source_face->loopbase->radial.next->data);
 	
 	/*lookup edges*/
 	i = 0;
@@ -86,7 +102,7 @@
 	do{
 		edar[i] = BLI_ghash_lookup(ehash, source_loop->e);
 		i++;
-		source_loop = source_loop->next;
+		source_loop = source_loop->radial.next->data;
 	}while(source_loop != source_face->loopbase);
 	
 	/*create new face*/
@@ -97,7 +113,7 @@
 
 	/*copy flags*/
 	target_face->head.flags = source_face->head.flags;
-	if(BM_Is_Selected((BMHeader*)source_face)) BM_Select_face(target, target_face, 1);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list