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:
Diffstat (limited to 'source/blender/bmesh/operators/bmo_hull.c')
-rw-r--r--source/blender/bmesh/operators/bmo_hull.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/bmesh/operators/bmo_hull.c b/source/blender/bmesh/operators/bmo_hull.c
index b9c9398fbfa..117f65ae4ea 100644
--- a/source/blender/bmesh/operators/bmo_hull.c
+++ b/source/blender/bmesh/operators/bmo_hull.c
@@ -119,7 +119,7 @@ static void hull_output_triangles(BMesh *bm, GHash *hull_triangles)
};
BMFace *f, *example = NULL;
- if (BM_face_exists(bm, t->v, 3, &f)) {
+ if (BM_face_exists(t->v, 3, &f)) {
/* If the operator is run with "use_existing_faces"
* disabled, but an output face in the hull is the
* same as a face in the existing mesh, it should not
@@ -139,17 +139,17 @@ static void hull_output_triangles(BMesh *bm, GHash *hull_triangles)
f = BM_face_create_quad_tri_v(bm, t->v, 3, example, TRUE);
BM_face_copy_shared(bm, f);
}
- /* Mark face for 'geomout' slot and select */
+ /* Mark face for 'geom.out' slot and select */
BMO_elem_flag_enable(bm, f, HULL_FLAG_OUTPUT_GEOM);
BM_face_select_set(bm, f, TRUE);
- /* Mark edges for 'geomout' slot */
+ /* Mark edges for 'geom.out' slot */
for (i = 0; i < 3; i++) {
BMO_elem_flag_enable(bm, edges[i], HULL_FLAG_OUTPUT_GEOM);
}
}
else {
- /* Mark input edges for 'geomout' slot */
+ /* Mark input edges for 'geom.out' slot */
for (i = 0; i < 3; i++) {
const int next = (i == 2 ? 0 : i + 1);
BMEdge *e = BM_edge_exists(t->v[i], t->v[next]);
@@ -161,7 +161,7 @@ static void hull_output_triangles(BMesh *bm, GHash *hull_triangles)
}
}
- /* Mark verts for 'geomout' slot */
+ /* Mark verts for 'geom.out' slot */
for (i = 0; i < 3; i++) {
BMO_elem_flag_enable(bm, t->v[i], HULL_FLAG_OUTPUT_GEOM);
}
@@ -304,14 +304,14 @@ static void hull_mark_interior_elements(BMesh *bm, BMOperator *op,
BMOIter oiter;
/* Check for interior edges too */
- BMO_ITER (e, &oiter, bm, op, "input", BM_EDGE) {
+ BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) {
if (!hull_final_edges_lookup(final_edges, e->v1, e->v2))
BMO_elem_flag_enable(bm, e, HULL_FLAG_INTERIOR_ELE);
}
/* Mark all input faces as interior, some may be unmarked in
* hull_remove_overlapping() */
- BMO_ITER (f, &oiter, bm, op, "input", BM_FACE) {
+ BMO_ITER (f, &oiter, op->slots_in, "input", BM_FACE) {
BMO_elem_flag_enable(bm, f, HULL_FLAG_INTERIOR_ELE);
}
}
@@ -328,7 +328,7 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
* interior (i.e. were already part of the input, but not part of
* the hull), but that aren't also used by elements outside the
* input set */
- BMO_ITER (v, &oiter, bm, op, "input", BM_VERT) {
+ BMO_ITER (v, &oiter, op->slots_in, "input", BM_VERT) {
if (BMO_elem_flag_test(bm, v, HULL_FLAG_INTERIOR_ELE)) {
int del = TRUE;
@@ -351,7 +351,7 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
}
}
- BMO_ITER (e, &oiter, bm, op, "input", BM_EDGE) {
+ BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) {
if (BMO_elem_flag_test(bm, e, HULL_FLAG_INTERIOR_ELE)) {
int del = TRUE;
@@ -367,7 +367,7 @@ static void hull_tag_unused(BMesh *bm, BMOperator *op)
}
}
- BMO_ITER (f, &oiter, bm, op, "input", BM_FACE) {
+ BMO_ITER (f, &oiter, op->slots_in, "input", BM_FACE) {
if (BMO_elem_flag_test(bm, f, HULL_FLAG_INTERIOR_ELE))
BMO_elem_flag_enable(bm, f, HULL_FLAG_DEL);
}
@@ -382,10 +382,10 @@ static void hull_tag_holes(BMesh *bm, BMOperator *op)
/* Unmark any hole faces if they are isolated or part of a
* border */
- BMO_ITER (f, &oiter, bm, op, "input", BM_FACE) {
+ BMO_ITER (f, &oiter, op->slots_in, "input", BM_FACE) {
if (BMO_elem_flag_test(bm, f, HULL_FLAG_HOLE)) {
BM_ITER_ELEM (e, &iter, f, BM_EDGES_OF_FACE) {
- if (BM_edge_face_count(e) == 1) {
+ if (BM_edge_is_boundary(e)) {
BMO_elem_flag_disable(bm, f, HULL_FLAG_HOLE);
break;
}
@@ -395,7 +395,7 @@ static void hull_tag_holes(BMesh *bm, BMOperator *op)
/* Mark edges too if all adjacent faces are holes and the edge is
* not already isolated */
- BMO_ITER (e, &oiter, bm, op, "input", BM_EDGE) {
+ BMO_ITER (e, &oiter, op->slots_in, "input", BM_EDGE) {
int hole = TRUE;
int any_faces = FALSE;
@@ -412,20 +412,20 @@ static void hull_tag_holes(BMesh *bm, BMOperator *op)
}
}
-static int hull_input_vert_count(BMesh *bm, BMOperator *op)
+static int hull_input_vert_count(BMOperator *op)
{
BMOIter oiter;
BMVert *v;
int count = 0;
- BMO_ITER (v, &oiter, bm, op, "input", BM_VERT) {
+ BMO_ITER (v, &oiter, op->slots_in, "input", BM_VERT) {
count++;
}
return count;
}
-static BMVert **hull_input_verts_copy(BMesh *bm, BMOperator *op,
+static BMVert **hull_input_verts_copy(BMOperator *op,
const int num_input_verts)
{
BMOIter oiter;
@@ -434,7 +434,7 @@ static BMVert **hull_input_verts_copy(BMesh *bm, BMOperator *op,
num_input_verts, AT);
int i = 0;
- BMO_ITER (v, &oiter, bm, op, "input", BM_VERT) {
+ BMO_ITER (v, &oiter, op->slots_in, "input", BM_VERT) {
input_verts[i++] = v;
}
@@ -492,9 +492,9 @@ static void hull_from_bullet(BMesh *bm, BMOperator *op,
plConvexHull hull;
int i, count = 0;
- const int num_input_verts = hull_input_vert_count(bm, op);
+ const int num_input_verts = hull_input_vert_count(op);
- input_verts = hull_input_verts_copy(bm, op, num_input_verts);
+ input_verts = hull_input_verts_copy(op, num_input_verts);
coords = hull_verts_for_bullet(input_verts, num_input_verts);
hull = plConvexHullCompute(coords, num_input_verts);
@@ -535,13 +535,13 @@ static void hull_from_bullet(BMesh *bm, BMOperator *op,
}
/* Check that there are at least three vertices in the input */
-static int hull_num_input_verts_is_ok(BMesh *bm, BMOperator *op)
+static int hull_num_input_verts_is_ok(BMOperator *op)
{
BMOIter oiter;
BMVert *v;
int partial_num_verts = 0;
- BMO_ITER (v, &oiter, bm, op, "input", BM_VERT) {
+ BMO_ITER (v, &oiter, op->slots_in, "input", BM_VERT) {
partial_num_verts++;
if (partial_num_verts >= 3)
break;
@@ -559,14 +559,14 @@ void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
GHash *hull_triangles;
/* Verify that at least three verts in the input */
- if (!hull_num_input_verts_is_ok(bm, op)) {
+ if (!hull_num_input_verts_is_ok(op)) {
BMO_error_raise(bm, op, BMERR_CONVEX_HULL_FAILED,
"Requires at least three vertices");
return;
}
/* Tag input elements */
- BMO_ITER (ele, &oiter, bm, op, "input", BM_ALL) {
+ BMO_ITER (ele, &oiter, op->slots_in, "input", BM_ALL) {
BMO_elem_flag_enable(bm, ele, HULL_FLAG_INPUT);
/* Mark all vertices as interior to begin with */
@@ -584,7 +584,7 @@ void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
hull_mark_interior_elements(bm, op, final_edges);
/* Remove hull triangles covered by an existing face */
- if (BMO_slot_bool_get(op, "use_existing_faces")) {
+ if (BMO_slot_bool_get(op->slots_in, "use_existing_faces")) {
hull_remove_overlapping(bm, hull_triangles, final_edges);
hull_tag_holes(bm, op);
@@ -603,23 +603,23 @@ void bmo_convex_hull_exec(BMesh *bm, BMOperator *op)
/* Output slot of input elements that ended up inside the hull
* rather than part of it */
- BMO_slot_buffer_from_enabled_flag(bm, op, "interior_geom", BM_ALL,
- HULL_FLAG_INTERIOR_ELE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom_interior.out",
+ BM_ALL, HULL_FLAG_INTERIOR_ELE);
/* Output slot of input elements that ended up inside the hull and
* are are unused by other geometry. */
- BMO_slot_buffer_from_enabled_flag(bm, op, "unused_geom", BM_ALL,
- HULL_FLAG_DEL);
+ BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom_unused.out",
+ BM_ALL, HULL_FLAG_DEL);
/* Output slot of faces and edges that were in the input and on
* the hull (useful for cases like bridging where you want to
* delete some input geometry) */
- BMO_slot_buffer_from_enabled_flag(bm, op, "holes_geom", BM_ALL,
- HULL_FLAG_HOLE);
+ BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom_holes.out",
+ BM_ALL, HULL_FLAG_HOLE);
/* Output slot of all hull vertices, faces, and edges */
- BMO_slot_buffer_from_enabled_flag(bm, op, "geomout", BM_ALL,
- HULL_FLAG_OUTPUT_GEOM);
+ BMO_slot_buffer_from_enabled_flag(bm, op, op->slots_out, "geom.out",
+ BM_ALL, HULL_FLAG_OUTPUT_GEOM);
}
#endif /* WITH_BULLET */