diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 11:28:37 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 11:28:37 +0400 |
commit | 89b906db9f758fb9642e01d9b4433b97557369fb (patch) | |
tree | 89f0e670a581728e7102a9ca00c5261befb18a57 /source/blender/editors/mesh/editmesh_add.c | |
parent | 22fec544c8d07e6099580b0e799e309dcfeeed6b (diff) |
editmesh accessor functions. most editmesh access now goes through:
EditMesh *EM_GetEditMesh(Mesh *me);
void EM_EndEditMesh(Mesh *me, EditMesh *em);
as discussed on the mailling list, this is to facilitate migration to bmesh.
next step is to merge this this to the bmesh branch. this was done in the 2.5
branch to prevent too great a divergance.
also, made makesdna/makesrna work on cygwin/msvc2008/scons.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 04d90453d57..9307f0c14ef 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -80,18 +80,18 @@ /* XXX */ static float icovert[12][3] = { - {0,0,-200}, - {144.72, -105.144,-89.443}, - {-55.277, -170.128,-89.443}, - {-178.885,0,-89.443}, - {-55.277,170.128,-89.443}, - {144.72,105.144,-89.443}, - {55.277,-170.128,89.443}, - {-144.72,-105.144,89.443}, - {-144.72,105.144,89.443}, - {55.277,170.128,89.443}, - {178.885,0,89.443}, - {0,0,200} + {0.0f,0.0f,-200.0f}, + {144.72f, -105.144f,-89.443f}, + {-55.277f, -170.128,-89.443f}, + {-178.885f,0.0f,-89.443f}, + {-55.277f,170.128f,-89.443f}, + {144.72f,105.144f,-89.443f}, + {55.277f,-170.128f,89.443f}, + {-144.72f,-105.144f,89.443f}, + {-144.72f,105.144f,89.443f}, + {55.277f,170.128f,89.443f}, + {178.885f,0.0f,89.443f}, + {0.0f,0.0f,200.0f} }; static short icoface[20][3] = { {1,0,2}, @@ -339,15 +339,18 @@ int make_fgon(EditMesh *em, wmOperator *op, int make) static int make_fgon_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); - EditMesh *em= ((Mesh *)obedit->data)->edit_mesh; + EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data)); if( make_fgon(em, op, 1) ) { DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + + EM_EndEditMesh(obedit->data, em); return OPERATOR_FINISHED; } + + EM_EndEditMesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -368,15 +371,18 @@ void MESH_OT_fgon_make(struct wmOperatorType *ot) static int clear_fgon_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); - EditMesh *em= ((Mesh *)obedit->data)->edit_mesh; + EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data)); if( make_fgon(em, op, 0) ) { DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - + + EM_EndEditMesh(obedit->data, em); return OPERATOR_FINISHED; } + + EM_EndEditMesh(obedit->data, em); return OPERATOR_CANCELLED; } @@ -779,7 +785,7 @@ static void addedgeface_mesh(EditMesh *em, wmOperator *op) static int addedgeface_mesh_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); - EditMesh *em= ((Mesh *)obedit->data)->edit_mesh; + EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data)); addedgeface_mesh(em, op); @@ -787,6 +793,7 @@ static int addedgeface_mesh_exec(bContext *C, wmOperator *op) DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + EM_EndEditMesh(obedit->data, em); return OPERATOR_FINISHED; } @@ -976,7 +983,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se * fill - end capping, and option to fill in circle * cent[3] - center of the data. * */ - EditMesh *em= ((Mesh *)obedit->data)->edit_mesh; + EditMesh *em= EM_GetEditMesh(((Mesh *)obedit->data)); EditVert *eve, *v1=NULL, *v2, *v3, *v4=NULL, *vtop, *vdown; float phi, phid, vec[3]; float q[4], cmat[3][3], nor[3]= {0.0, 0.0, 0.0}; @@ -984,8 +991,8 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se EM_clear_flag_all(em, SELECT); - phid= 2*M_PI/tot; - phi= .25*M_PI; + phid= 2.0f*(float)M_PI/tot; + phi= .25f*(float)M_PI; switch(type) { case PRIM_GRID: /* grid */ @@ -1257,6 +1264,8 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se if(type!=0 && type!=13) righthandfaces(em, 1); /* otherwise monkey has eyes in wrong direction */ + + EM_EndEditMesh(obedit->data, em); } |