Revision: 18272 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18272 Author: briggs Date: 2009-01-02 23:34:07 +0100 (Fri, 02 Jan 2009)
Log Message: ----------- -> Cleanup of operator defines Cleaned up the dupe/split/del operator slot definitions. Generally speaking input/output slots that are collections of mesh elements shoudl be mixed unless there is a good reason to seperate them out. Also got rid of some defines left over from aborted flag layer twiddling from previous commits. Modified Paths: -------------- branches/bmesh/bmesh/bmesh_operators.h branches/bmesh/bmesh/operators/bmesh_dupeops.c Modified: branches/bmesh/bmesh/bmesh_operators.h =================================================================== --- branches/bmesh/bmesh/bmesh_operators.h 2009-01-02 22:15:05 UTC (rev 18271) +++ branches/bmesh/bmesh/bmesh_operators.h 2009-01-02 22:34:07 UTC (rev 18272) @@ -69,66 +69,37 @@ 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); -/*operator option flags*/ -#define NEEDFLAGS 1 /*note: doesn't do anything*/ - /*--------------------begin operator defines------------------------*/ /*split op*/ #define BMOP_SPLIT 0 -#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 +#define BMOP_SPLIT_MULTIN 0 +#define BMOP_SPLIT_MULTOUT 1 +#define BMOP_SPLIT_TOTSLOT 2 static 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 }; -#define SPLIT_OPTIONS NEEDFLAGS - /*dupe op*/ #define BMOP_DUPE 1 -#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 +#define BMOP_DUPE_MULTIN 0 +#define BMOP_DUPE_ORIG 1 +#define BMOP_DUPE_NEW 2 +#define BMOP_DUPE_TOTSLOT 3 static 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, }; -#define DUPE_OPTIONS NEEDFLAGS /*delete op*/ #define BMOP_DEL 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 +#define BMOP_DEL_MULTIN 0 +#define BMOP_DEL_CONTEXT 1 +#define BMOP_DEL_TOTSLOT 2 /*BMOP_DEL_CONTEXT*/ #define BMOP_DEL_VERTS 1 @@ -139,13 +110,9 @@ static const int BMOP_DEL_TYPEINFO[BMOP_DEL_TOTSLOT] = { BMOP_OPSLOT_PNT_BUF, - BMOP_OPSLOT_PNT_BUF, - BMOP_OPSLOT_PNT_BUF, BMOP_OPSLOT_INT }; -#define DEL_OPTIONS NEEDFLAGS - /*editmesh->bmesh op*/ #define BMOP_FROM_EDITMESH 3 #define BMOP_FROM_EDITMESH_EM 0 @@ -166,7 +133,6 @@ BMOP_OPSLOT_PNT }; -#define TOEDIT_OPTIONS NEEDFLAGS #define BMOP_ESUBDIVIDE 5 #define BMOP_ESUBDIVIDE_EDGES 0 @@ -176,8 +142,6 @@ BMOP_OPSLOT_PNT_BUF }; -#define SUBD_OPTIONS NEEDFLAGS - /*keep this updated!*/ #define BMOP_TOTAL_OPS 6 /*-------------------------------end operator defines-------------------------------*/ @@ -201,13 +165,4 @@ BMOP_ESUBDIVIDE_TOTSLOT }; -static const int BMOP_OPTIONS[] = { - SPLIT_OPTIONS, - DUPE_OPTIONS, - DEL_OPTIONS, - FROMEDIT_OPTIONS, - TOEDIT_OPTIONS, - SUBD_OPTIONS, -}; - #endif Modified: branches/bmesh/bmesh/operators/bmesh_dupeops.c =================================================================== --- branches/bmesh/bmesh/operators/bmesh_dupeops.c 2009-01-02 22:15:05 UTC (rev 18271) +++ branches/bmesh/bmesh/operators/bmesh_dupeops.c 2009-01-02 22:34:07 UTC (rev 18272) @@ -264,30 +264,18 @@ void dupeop_exec(BMesh *bm, BMOperator *op) { BMOperator *dupeop = op; - BMOpSlot *vinput, *einput, *finput; - vinput = BMO_GetSlot(dupeop, BMOP_DUPE_VINPUT); - einput = BMO_GetSlot(dupeop, BMOP_DUPE_EINPUT); - finput = BMO_GetSlot(dupeop, BMOP_DUPE_FINPUT); - - /*go through vinput, einput, and finput and flag elements with private flags*/ - BMO_Flag_Buffer(bm, dupeop, BMOP_DUPE_VINPUT, DUPE_INPUT); - BMO_Flag_Buffer(bm, dupeop, BMOP_DUPE_EINPUT, DUPE_INPUT); - BMO_Flag_Buffer(bm, dupeop, BMOP_DUPE_FINPUT, DUPE_INPUT); - + /*flag input*/ + BMO_Flag_Buffer(bm, dupeop, BMOP_DUPE_MULTIN, DUPE_INPUT); /*use the internal copy function*/ copy_mesh(bm, bm); /*Output*/ /*First copy the input buffers to output buffers - original data*/ - BMO_CopySlot(dupeop, dupeop, vinput->index, BMOP_DUPE_VORIGINAL); - BMO_CopySlot(dupeop, dupeop, einput->index, BMOP_DUPE_EORIGINAL); - BMO_CopySlot(dupeop, dupeop, finput->index, BMOP_DUPE_FORIGINAL); + BMO_CopySlot(dupeop, dupeop, BMOP_DUPE_MULTIN, BMOP_DUPE_ORIG); /*Now alloc the new output buffers*/ - BMO_Flag_To_Slot(bm, dupeop, BMOP_DUPE_VNEW, DUPE_NEW, BM_VERT); - BMO_Flag_To_Slot(bm, dupeop, BMOP_DUPE_ENEW, DUPE_NEW, BM_EDGE); - BMO_Flag_To_Slot(bm, dupeop, BMOP_DUPE_FNEW, DUPE_NEW, BM_FACE); + BMO_Flag_To_Slot(bm, dupeop, BMOP_DUPE_NEW, DUPE_NEW, BM_VERT|BM_EDGE|BM_FACE); } @@ -320,23 +308,17 @@ BMO_Init_Op(&dupeop, BMOP_DUPE); BMO_Init_Op(&delop, BMOP_DEL); - BMO_CopySlot(&dupeop, &delop, BMOP_SPLIT_VINPUT, BMOP_DUPE_VINPUT); - BMO_CopySlot(&dupeop, &delop, BMOP_SPLIT_EINPUT, BMOP_DUPE_EINPUT); - BMO_CopySlot(&dupeop, &delop, BMOP_SPLIT_FINPUT, BMOP_DUPE_FINPUT); + BMO_Set_Int(&delop, BMOP_DEL_CONTEXT, BMOP_DEL_FACES); + BMO_CopySlot(&dupeop, &delop, BMOP_SPLIT_MULTIN, BMOP_DUPE_MULTIN); BMO_Exec_Op(bm, &dupeop); /*connect outputs of dupe to delete*/ - BMO_CopySlot(&dupeop, &delop, BMOP_DUPE_VORIGINAL, BMOP_DEL_VINPUT); - BMO_CopySlot(&dupeop, &delop, BMOP_DUPE_EORIGINAL, BMOP_DEL_EINPUT); - BMO_CopySlot(&dupeop, &delop, BMOP_DUPE_FORIGINAL, BMOP_DEL_FINPUT); - + BMO_CopySlot(&dupeop, &delop, BMOP_DUPE_ORIG, BMOP_DEL_MULTIN); BMO_Exec_Op(bm, &delop); /*now we make our outputs by copying the dupe outputs*/ - BMO_CopySlot(&dupeop, splitop, BMOP_DUPE_VNEW, BMOP_SPLIT_VOUTPUT); - BMO_CopySlot(&dupeop, splitop, BMOP_DUPE_ENEW, BMOP_SPLIT_EOUTPUT); - BMO_CopySlot(&dupeop, splitop, BMOP_DUPE_FNEW, BMOP_SPLIT_FOUTPUT); + BMO_CopySlot(&dupeop, splitop, BMOP_DUPE_NEW, BMOP_SPLIT_MULTOUT); /*cleanup*/ BMO_Finish_Op(bm, &dupeop); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs