Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-03-25 12:20:19 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-03-25 12:20:19 +0400
commit3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (patch)
treeb3fdb366cb49bdea5b57dfa6ba4a82635c68d0ee /source/blender/bmesh/operators/bmo_utils.c
parenta2ebfc82dbe954acc432ae017ac62a30a11b6a16 (diff)
parente99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff)
Merged changes in the trunk up to revision 45133.
Conflicts resolved: source/blender/blenloader/intern/readfile.c source/blender/blenloader/intern/writefile.c source/blender/bmesh/intern/bmesh_construct.c source/blender/bmesh/intern/bmesh_mesh_conv.c source/blender/bmesh/intern/bmesh_mesh_conv.h source/blender/editors/interface/interface_templates.c source/blender/editors/interface/resources.c source/blender/editors/mesh/bmesh_select.c source/blender/editors/mesh/bmesh_tools.c source/blender/editors/space_view3d/drawobject.c source/blender/render/intern/source/shadeoutput.c
Diffstat (limited to 'source/blender/bmesh/operators/bmo_utils.c')
-rw-r--r--source/blender/bmesh/operators/bmo_utils.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c
index de82bb4f573..c9658b37022 100644
--- a/source/blender/bmesh/operators/bmo_utils.c
+++ b/source/blender/bmesh/operators/bmo_utils.c
@@ -49,7 +49,7 @@ void bmo_makevert_exec(BMesh *bm, BMOperator *op)
BMO_slot_vec_get(op, "co", vec);
BMO_elem_flag_enable(bm, BM_vert_create(bm, vec, NULL), 1);
- BMO_slot_buffer_from_flag(bm, op, "newvertout", 1, BM_VERT);
+ BMO_slot_buffer_from_flag(bm, op, "newvertout", BM_VERT, 1);
}
void bmo_transform_exec(BMesh *bm, BMOperator *op)
@@ -155,7 +155,7 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op)
BMO_elem_flag_enable(bm, e2, EDGE_OUT);
- /* dont touch again */
+ /* don't touch again */
BMO_elem_flag_enable(bm, fa, FACE_TAINT);
BMO_elem_flag_enable(bm, fb, FACE_TAINT);
}
@@ -163,7 +163,7 @@ void bmo_edgerotate_exec(BMesh *bm, BMOperator *op)
}
}
- BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_OUT, BM_EDGE);
+ BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EDGE_OUT);
#undef EDGE_OUT
#undef FACE_TAINT
@@ -259,14 +259,14 @@ void bmo_regionextend_exec(BMesh *bm, BMOperator *op)
int use_faces = BMO_slot_bool_get(op, "use_faces");
int constrict = BMO_slot_bool_get(op, "constrict");
- BMO_slot_buffer_flag_enable(bm, op, "geom", SEL_ORIG, BM_ALL);
+ BMO_slot_buffer_flag_enable(bm, op, "geom", BM_ALL, SEL_ORIG);
if (constrict)
bmo_regionextend_constrict(bm, op, use_faces);
else
bmo_regionextend_extend(bm, op, use_faces);
- BMO_slot_buffer_from_flag(bm, op, "geomout", SEL_FLAG, BM_ALL);
+ BMO_slot_buffer_from_flag(bm, op, "geomout", BM_ALL, SEL_FLAG);
}
/********* righthand faces implementation ****** */
@@ -310,7 +310,7 @@ void bmo_righthandfaces_exec(BMesh *bm, BMOperator *op)
startf = NULL;
maxx = -1.0e10;
- BMO_slot_buffer_flag_enable(bm, op, "faces", FACE_FLAG, BM_FACE);
+ BMO_slot_buffer_flag_enable(bm, op, "faces", BM_FACE, FACE_FLAG);
/* find a starting face */
BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) {
@@ -466,11 +466,11 @@ void bmo_vertexsmooth_exec(BMesh *bm, BMOperator *op)
*/
static float ngon_perimeter(BMesh *bm, BMFace *f)
{
- BMIter liter;
- BMLoop *l;
- int num_verts = 0;
- float v[3], sv[3];
- float perimeter = 0.0f;
+ BMIter liter;
+ BMLoop *l;
+ int num_verts = 0;
+ float v[3], sv[3];
+ float perimeter = 0.0f;
BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
if (num_verts == 0) {
@@ -498,11 +498,11 @@ static float ngon_perimeter(BMesh *bm, BMFace *f)
*/
static float ngon_fake_area(BMesh *bm, BMFace *f)
{
- BMIter liter;
- BMLoop *l;
- int num_verts = 0;
- float v[3], sv[3], c[3];
- float area = 0.0f;
+ BMIter liter;
+ BMLoop *l;
+ int num_verts = 0;
+ float v[3], sv[3], c[3];
+ float area = 0.0f;
BM_face_center_mean_calc(bm, f, c);
@@ -528,13 +528,13 @@ static float ngon_fake_area(BMesh *bm, BMFace *f)
* extra face data (computed data)
*/
typedef struct SimSel_FaceExt {
- BMFace *f; /* the face */
- float c[3]; /* center */
+ BMFace *f; /* the face */
+ float c[3]; /* center */
union {
- float area; /* area */
- float perim; /* perimeter */
- float d; /* 4th component of plane (the first three being the normal) */
- struct Image *t; /* image pointer */
+ float area; /* area */
+ float perim; /* perimeter */
+ float d; /* 4th component of plane (the first three being the normal) */
+ struct Image *t; /* image pointer */
};
} SimSel_FaceExt;
@@ -572,7 +572,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
}
/* allocate memory for the selected faces indices and for all temporary faces */
- indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c");
+ indices = (int *)MEM_callocN(sizeof(int) * num_sels, "face indices util.c");
f_ext = (SimSel_FaceExt *)MEM_callocN(sizeof(SimSel_FaceExt) * num_total, "f_ext util.c");
/* loop through all the faces and fill the faces/indices structure */
@@ -693,23 +693,23 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
MEM_freeN(indices);
/* transfer all marked faces to the output slot */
- BMO_slot_buffer_from_flag(bm, op, "faceout", FACE_MARK, BM_FACE);
+ BMO_slot_buffer_from_flag(bm, op, "faceout", BM_FACE, FACE_MARK);
}
/**************************************************************************** *
* Similar Edges
**************************************************************************** */
-#define EDGE_MARK 1
+#define EDGE_MARK 1
/*
* compute the angle of an edge (i.e. the angle between two faces)
*/
static float edge_angle(BMesh *bm, BMEdge *e)
{
- BMIter fiter;
- BMFace *f, *f_prev = NULL;
+ BMIter fiter;
+ BMFace *f, *f_prev = NULL;
- /* first edge faces, dont account for 3+ */
+ /* first edge faces, don't account for 3+ */
BM_ITER(f, &fiter, bm, BM_FACES_OF_EDGE, e) {
if (f_prev == NULL) {
@@ -726,15 +726,15 @@ static float edge_angle(BMesh *bm, BMEdge *e)
* extra edge information
*/
typedef struct SimSel_EdgeExt {
- BMEdge *e;
+ BMEdge *e;
union {
- float dir[3];
- float angle; /* angle between the face */
+ float dir[3];
+ float angle; /* angle between the face */
};
union {
- float length; /* edge length */
- int faces; /* faces count */
+ float length; /* edge length */
+ int faces; /* faces count */
};
} SimSel_EdgeExt;
@@ -745,9 +745,9 @@ typedef struct SimSel_EdgeExt {
void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
{
BMOIter es_iter; /* selected edges iterator */
- BMIter e_iter; /* mesh edges iterator */
- BMEdge *es; /* selected edge */
- BMEdge *e; /* mesh edge */
+ BMIter e_iter; /* mesh edges iterator */
+ BMEdge *es; /* selected edge */
+ BMEdge *e; /* mesh edge */
int idx = 0, i = 0 /* , f = 0 */;
int *indices = NULL;
SimSel_EdgeExt *e_ext = NULL;
@@ -767,7 +767,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
}
/* allocate memory for the selected edges indices and for all temporary edges */
- indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c");
+ indices = (int *)MEM_callocN(sizeof(int) * num_sels, "indices util.c");
e_ext = (SimSel_EdgeExt *)MEM_callocN(sizeof(SimSel_EdgeExt) * num_total, "e_ext util.c");
/* loop through all the edges and fill the edges/indices structure */
@@ -785,7 +785,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
for (i = 0; i < num_total; i++) {
switch (type) {
case SIMEDGE_LENGTH: /* compute the length of the edge */
- e_ext[i].length = len_v3v3(e_ext[i].e->v1->co, e_ext[i].e->v2->co);
+ e_ext[i].length = len_v3v3(e_ext[i].e->v1->co, e_ext[i].e->v2->co);
break;
case SIMEDGE_DIR: /* compute the direction */
@@ -793,11 +793,11 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
break;
case SIMEDGE_FACE: /* count the faces around the edge */
- e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
+ e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
break;
case SIMEDGE_FACE_ANGLE:
- e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
+ e_ext[i].faces = BM_edge_face_count(e_ext[i].e);
if (e_ext[i].faces == 2)
e_ext[i].angle = edge_angle(bm, e_ext[i].e);
break;
@@ -897,7 +897,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
MEM_freeN(indices);
/* transfer all marked edges to the output slot */
- BMO_slot_buffer_from_flag(bm, op, "edgeout", EDGE_MARK, BM_EDGE);
+ BMO_slot_buffer_from_flag(bm, op, "edgeout", BM_EDGE, EDGE_MARK);
}
/**************************************************************************** *
@@ -938,7 +938,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
}
/* allocate memory for the selected vertices indices and for all temporary vertices */
- indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices");
+ indices = (int *)MEM_mallocN(sizeof(int) * num_sels, "vertex indices");
v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra");
/* loop through all the vertices and fill the vertices/indices structure */
@@ -952,7 +952,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
switch (type) {
case SIMVERT_FACE:
/* calling BM_vert_face_count every time is time consumming, so call it only once per vertex */
- v_ext[i].num_faces = BM_vert_face_count(v);
+ v_ext[i].num_faces = BM_vert_face_count(v);
break;
case SIMVERT_VGROUP:
@@ -1013,7 +1013,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
MEM_freeN(indices);
MEM_freeN(v_ext);
- BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}
/**************************************************************************** *
@@ -1341,5 +1341,5 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
BLI_heap_free(h, NULL);
MEM_freeN(vert_list);
- BMO_slot_buffer_from_flag(bm, op, "vertout", VERT_MARK, BM_VERT);
+ BMO_slot_buffer_from_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
}