Revision: 44075 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44075 Author: campbellbarton Date: 2012-02-13 02:42:50 +0000 (Mon, 13 Feb 2012) Log Message: ----------- more bmesh minor api cleanup * remove BMO_elem_flag_* functions, since there are already defines for this. * ifdef unused bevel functions. * rename defines BMOP_ --> BMO_OP_
Modified Paths: -------------- branches/bmesh/blender/source/blender/bmesh/bmesh.h branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h branches/bmesh/blender/source/blender/bmesh/bmesh_queries.h branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_interp.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mods.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_newcore.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_opdefines.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c branches/bmesh/blender/source/blender/bmesh/intern/bmesh_private.h branches/bmesh/blender/source/blender/bmesh/intern/bmesh_structure.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_bevel.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_dupe.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_edgesplit.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_extrude.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_removedoubles.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_subdivide.c branches/bmesh/blender/source/blender/bmesh/operators/bmo_triangulate.c branches/bmesh/blender/source/blender/bmesh/tools/BME_bevel.c branches/bmesh/blender/source/blender/editors/mesh/bmesh_tools.c branches/bmesh/blender/source/blender/editors/mesh/knifetool.c branches/bmesh/blender/source/blender/editors/mesh/loopcut.c branches/bmesh/blender/source/blender/editors/transform/transform.c Modified: branches/bmesh/blender/source/blender/bmesh/bmesh.h =================================================================== --- branches/bmesh/blender/source/blender/bmesh/bmesh.h 2012-02-12 19:57:47 UTC (rev 44074) +++ branches/bmesh/blender/source/blender/bmesh/bmesh.h 2012-02-13 02:42:50 UTC (rev 44075) @@ -194,7 +194,7 @@ /* copies attributes, e.g. customdata, header flags, etc, from one element * to another of the same type.*/ -void BM_elem_copy_attrs(BMesh *source_mesh, BMesh *target_mesh, const void *source, void *target); +void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *source, void *target); /* Modification */ /* join two adjacent faces together along an edge. note that Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h =================================================================== --- branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h 2012-02-12 19:57:47 UTC (rev 44074) +++ branches/bmesh/blender/source/blender/bmesh/bmesh_operator_api.h 2012-02-13 02:42:50 UTC (rev 44075) @@ -77,23 +77,23 @@ /* slot type arrays are terminated by the last member * having a slot type of 0.*/ -#define BMOP_OPSLOT_SENTINEL 0 -#define BMOP_OPSLOT_INT 1 -#define BMOP_OPSLOT_FLT 2 -#define BMOP_OPSLOT_PNT 3 -#define BMOP_OPSLOT_MAT 4 -#define BMOP_OPSLOT_VEC 7 +#define BMO_OP_SLOT_SENTINEL 0 +#define BMO_OP_SLOT_INT 1 +#define BMO_OP_SLOT_FLT 2 +#define BMO_OP_SLOT_PNT 3 +#define BMO_OP_SLOT_MAT 4 +#define BMO_OP_SLOT_VEC 7 -/* after BMOP_OPSLOT_VEC, everything is +/* after BMO_OP_SLOT_VEC, everything is * dynamically allocated arrays. we * leave a space in the identifiers * for future growth. */ //it's very important this remain a power of two -#define BMOP_OPSLOT_ELEMENT_BUF 8 -#define BMOP_OPSLOT_MAPPING 9 -/* #define BMOP_OPSLOT_TOTAL_TYPES 10 */ /* not used yet */ +#define BMO_OP_SLOT_ELEMENT_BUF 8 +#define BMO_OP_SLOT_MAPPING 9 +/* #define BMO_OP_SLOT_TOTAL_TYPES 10 */ /* not used yet */ /* please ignore all these structures, don't touch them in tool code, except * for when your defining an operator with BMOpDefine.*/ @@ -113,7 +113,7 @@ } data; } BMOpSlot; -#define BMOP_MAX_SLOTS 16 /* way more than probably needed */ +#define BMO_OP_MAX_SLOTS 16 /* way more than probably needed */ #ifdef slots #undef slots @@ -124,7 +124,7 @@ int slottype; int needflag; int flag; - struct BMOpSlot slots[BMOP_MAX_SLOTS]; + struct BMOpSlot slots[BMO_OP_MAX_SLOTS]; void (*exec)(struct BMesh *bm, struct BMOperator *op); MemArena *arena; } BMOperator; @@ -138,20 +138,19 @@ typedef struct BMOpDefine { const char *name; - BMOSlotType slottypes[BMOP_MAX_SLOTS]; + BMOSlotType slottypes[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, BMOperator *op); int flag; } BMOpDefine; -/*BMOpDefine->flag*/ -#define BMOP_UNTAN_MULTIRES 1 /*switch from multires tangent space to absolute coordinates*/ +/* BMOpDefine->flag */ +#define BMO_OP_FLAG_UNTAN_MULTIRES 1 /*switch from multires tangent space to absolute coordinates*/ - /* ensures consistent normals before operator execution, * restoring the original ones windings/normals afterwards. * keep in mind, this won't work if the input mesh isn't * manifold.*/ -#define BMOP_RATIONALIZE_NORMALS 2 +#define BMO_OP_FLAG_RATIONALIZE_NORMALS 2 /*------------- Operator API --------------*/ @@ -458,7 +457,7 @@ BMOpSlot *slot = BMO_slot_get(op, slotname); /*sanity check*/ - if (slot->slottype != BMOP_OPSLOT_MAPPING) { + if (slot->slottype != BMO_OP_SLOT_MAPPING) { return; } @@ -499,7 +498,7 @@ BMOpSlot *slot = BMO_slot_get(op, slotname); /*sanity check*/ - if (slot->slottype != BMOP_OPSLOT_MAPPING) return 0; + if (slot->slottype != BMO_OP_SLOT_MAPPING) return 0; if (!slot->data.ghash) return 0; return BLI_ghash_haskey(slot->data.ghash, element); @@ -512,7 +511,7 @@ BMOpSlot *slot = BMO_slot_get(op, slotname); /*sanity check*/ - if (slot->slottype != BMOP_OPSLOT_MAPPING) return NULL; + if (slot->slottype != BMO_OP_SLOT_MAPPING) return NULL; if (!slot->data.ghash) return NULL; mapping = (BMOElemMapping *)BLI_ghash_lookup(slot->data.ghash, element); Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h =================================================================== --- branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h 2012-02-12 19:57:47 UTC (rev 44074) +++ branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h 2012-02-13 02:42:50 UTC (rev 44075) @@ -98,8 +98,8 @@ #if 0 void BMO_dupe_from_flag(struct BMesh *bm, int etypeflag, const char hflag); #endif -void BM_esubdivideflag(struct Object *obedit, BMesh *bm, int flag, float smooth, - float fractal, int beauty, int numcuts, int seltype, - int cornertype, int singleedge, int gridfill, int seed); +void BM_mesh_esubdivideflag(struct Object *obedit, BMesh *bm, int flag, float smooth, + float fractal, int beauty, int numcuts, int seltype, + int cornertype, int singleedge, int gridfill, int seed); #endif /* __BMESH_OPERATORS_H__ */ Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_queries.h =================================================================== --- branches/bmesh/blender/source/blender/bmesh/bmesh_queries.h 2012-02-12 19:57:47 UTC (rev 44074) +++ branches/bmesh/blender/source/blender/bmesh/bmesh_queries.h 2012-02-13 02:42:50 UTC (rev 44075) @@ -52,8 +52,6 @@ /*finds other loop that shares v with e's loop in f.*/ struct BMLoop *BM_face_other_loop(BMEdge *e, BMFace *f, BMVert *v); -//#define BM_edge_other_vert(e, v) (v==e->v1?e->v2:e->v1) - /*returns the edge existing between v1 and v2, or NULL if there isn't one.*/ struct BMEdge *BM_edge_exists(struct BMVert *v1, struct BMVert *v2); Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c =================================================================== --- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c 2012-02-12 19:57:47 UTC (rev 44074) +++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c 2012-02-13 02:42:50 UTC (rev 44075) @@ -46,8 +46,8 @@ #define SELECT 1 /* prototypes */ -static void bm_copy_loop_attributes(BMesh *source_mesh, BMesh *target_mesh, - const BMLoop *source_loop, BMLoop *target_loop); +static void bm_loop_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, + const BMLoop *source_loop, BMLoop *target_loop); #if 0 /* @@ -177,7 +177,7 @@ f = BM_face_create(bm, verts, edar, len, FALSE); if (example && f) { - BM_elem_copy_attrs(bm, bm, example, f); + BM_elem_attrs_copy(bm, bm, example, f); } } @@ -199,11 +199,11 @@ if (l2 && l2 != l) { if (l2->v == l->v) { - bm_copy_loop_attributes(bm, bm, l2, l); + bm_loop_attrs_copy(bm, bm, l2, l); } else { l2 = l2->next; - bm_copy_loop_attributes(bm, bm, l2, l); + bm_loop_attrs_copy(bm, bm, l2, l); } } } @@ -244,7 +244,7 @@ /* put edges in correct order */ for (i = 0; i < len; i++) { - bmesh_api_setflag(edges[i], _FLAG_MF); + BM_ELEM_API_FLAG_ENABLE(edges[i], _FLAG_MF); } ev1 = edges[0]->v1; @@ -268,7 +268,7 @@ do { e2 = bmesh_disk_nextedge(e2, v); - if (e2 != e && bmesh_api_getflag(e2, _FLAG_MF)) { + if (e2 != e && BM_ELEM_API_FLAG_TEST(e2, _FLAG_MF)) { v = BM_edge_other_vert(e2, v); break; } @@ -327,7 +327,7 @@ /* clean up flags */ for (i = 0; i < len; i++) { - bmesh_api_clearflag(edges2[i], _FLAG_MF); + BM_ELEM_API_FLAG_DISABLE(edges2[i], _FLAG_MF); } BLI_array_free(verts); @@ -337,7 +337,7 @@ err: for (i = 0; i < len; i++) { - bmesh_api_clearflag(edges[i], _FLAG_MF); + BM_ELEM_API_FLAG_DISABLE(edges[i], _FLAG_MF); } BLI_array_free(verts); @@ -568,13 +568,8 @@ /*************************************************************/ - - - - - -static void bm_copy_vert_attributes(BMesh *source_mesh, BMesh *target_mesh, - const BMVert *source_vertex, BMVert *target_vertex) +static void bm_vert_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, + const BMVert *source_vertex, BMVert *target_vertex) { if ((source_mesh == target_mesh) && (source_vertex == target_vertex)) { return; @@ -585,8 +580,8 @@ source_vertex->head.data, &target_vertex->head.data); } -static void bm_copy_edge_attributes(BMesh *source_mesh, BMesh *target_mesh, - const BMEdge *source_edge, BMEdge *target_edge) +static void bm_edge_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, + const BMEdge *source_edge, BMEdge *target_edge) { if ((source_mesh == target_mesh) && (source_edge == target_edge)) { return; @@ -596,8 +591,8 @@ source_edge->head.data, &target_edge->head.data); } -static void bm_copy_loop_attributes(BMesh *source_mesh, BMesh *target_mesh, - const BMLoop *source_loop, BMLoop *target_loop) +static void bm_loop_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, + const BMLoop *source_loop, BMLoop *target_loop) { if ((source_mesh == target_mesh) && (source_loop == target_loop)) { return; @@ -607,8 +602,8 @@ source_loop->head.data, &target_loop->head.data); } -static void bm_copy_face_attributes(BMesh *source_mesh, BMesh *target_mesh, - const BMFace *source_face, BMFace *target_face) +static void bm_face_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, + const BMFace *source_face, BMFace *target_face) { if ((source_mesh == target_mesh) && (source_face == target_face)) { return; @@ -622,7 +617,7 @@ /* BMESH_TODO: Special handling for hide flags? */ -void BM_elem_copy_attrs(BMesh *source_mesh, BMesh *target_mesh, const void *source, void *target) +void BM_elem_attrs_copy(BMesh *source_mesh, BMesh *target_mesh, const void *source, void *target) { const BMHeader *sheader = source; BMHeader *theader = target; @@ -638,13 +633,13 @@ /* Copy specific attributes */ if (theader->htype == BM_VERT) @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs