Cleanup: correct and update comments for bmesh walkers

- Correct variable names which were missed when refactoring.
- Use full sentences.
This commit is contained in:
2021-01-31 17:42:11 +11:00
parent 6b8f28a6b5
commit e6a5e548d5

View File

@@ -29,7 +29,7 @@
#include "bmesh.h" #include "bmesh.h"
#include "intern/bmesh_walkers_private.h" #include "intern/bmesh_walkers_private.h"
/* pop into stack memory (common operation) */ /* Pop into stack memory (common operation). */
#define BMW_state_remove_r(walker, owalk) \ #define BMW_state_remove_r(walker, owalk) \
{ \ { \
memcpy(owalk, BMW_current_state(walker), sizeof(*(owalk))); \ memcpy(owalk, BMW_current_state(walker), sizeof(*(owalk))); \
@@ -86,7 +86,7 @@ static bool bmw_mask_check_face(BMWalker *walker, BMFace *f)
static bool bmw_edge_is_wire(const BMWalker *walker, const BMEdge *e) static bool bmw_edge_is_wire(const BMWalker *walker, const BMEdge *e)
{ {
if (walker->flag & BMW_FLAG_TEST_HIDDEN) { if (walker->flag & BMW_FLAG_TEST_HIDDEN) {
/* check if this is a wire edge, ignoring hidden faces */ /* Check if this is a wire edge, ignoring hidden faces. */
if (BM_edge_is_wire(e)) { if (BM_edge_is_wire(e)) {
return true; return true;
} }
@@ -137,8 +137,7 @@ static void bmw_VertShellWalker_begin(BMWalker *walker, void *data)
switch (h->htype) { switch (h->htype) {
case BM_VERT: { case BM_VERT: {
/* starting the walk at a vert, add all the edges /* Starting the walk at a vert, add all the edges to the work-list. */
* to the worklist */
v = (BMVert *)h; v = (BMVert *)h;
BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
bmw_VertShellWalker_visitEdge(walker, e); bmw_VertShellWalker_visitEdge(walker, e);
@@ -147,8 +146,7 @@ static void bmw_VertShellWalker_begin(BMWalker *walker, void *data)
} }
case BM_EDGE: { case BM_EDGE: {
/* starting the walk at an edge, add the single edge /* Starting the walk at an edge, add the single edge to the work-list. */
* to the worklist */
e = (BMEdge *)h; e = (BMEdge *)h;
bmw_VertShellWalker_visitEdge(walker, e); bmw_VertShellWalker_visitEdge(walker, e);
break; break;
@@ -201,7 +199,7 @@ static void *bmw_VertShellWalker_step(BMWalker *walker)
BMW_state_remove(walker); BMW_state_remove(walker);
/* find the next edge whose other vertex has not been visite */ /* Find the next edge whose other vertex has not been visited. */
curedge = shellWalk.curedge; curedge = shellWalk.curedge;
do { do {
if (!BLI_gset_haskey(walker->visit_set, curedge)) { if (!BLI_gset_haskey(walker->visit_set, curedge)) {
@@ -212,11 +210,11 @@ static void *bmw_VertShellWalker_step(BMWalker *walker)
v_old = BM_edge_other_vert(curedge, shellWalk.base); v_old = BM_edge_other_vert(curedge, shellWalk.base);
/* push a new state onto the stac */ /* Push a new state onto the stack. */
newState = BMW_state_add(walker); newState = BMW_state_add(walker);
BLI_gset_insert(walker->visit_set, curedge); BLI_gset_insert(walker->visit_set, curedge);
/* populate the new stat */ /* Populate the new state. */
newState->base = v_old; newState->base = v_old;
newState->curedge = curedge; newState->curedge = curedge;
@@ -266,8 +264,7 @@ static void bmw_LoopShellWalker_begin(BMWalker *walker, void *data)
switch (h->htype) { switch (h->htype) {
case BM_LOOP: { case BM_LOOP: {
/* starting the walk at a vert, add all the edges /* Starting the walk at a vert, add all the edges to the work-list. */
* to the worklist */
BMLoop *l = (BMLoop *)h; BMLoop *l = (BMLoop *)h;
bmw_LoopShellWalker_visitLoop(walker, l); bmw_LoopShellWalker_visitLoop(walker, l);
break; break;
@@ -292,7 +289,7 @@ static void bmw_LoopShellWalker_begin(BMWalker *walker, void *data)
case BM_FACE: { case BM_FACE: {
BMFace *f = (BMFace *)h; BMFace *f = (BMFace *)h;
BMLoop *l = BM_FACE_FIRST_LOOP(f); BMLoop *l = BM_FACE_FIRST_LOOP(f);
/* walker will handle other loops within the face */ /* Walker will handle other loops within the face. */
bmw_LoopShellWalker_visitLoop(walker, l); bmw_LoopShellWalker_visitLoop(walker, l);
break; break;
} }
@@ -312,7 +309,7 @@ static void bmw_LoopShellWalker_step_impl(BMWalker *walker, BMLoop *l)
BMEdge *e_edj_pair[2]; BMEdge *e_edj_pair[2];
int i; int i;
/* seems paranoid, but one caller also walks edges */ /* Seems paranoid, but one caller also walks edges. */
BLI_assert(l->head.htype == BM_LOOP); BLI_assert(l->head.htype == BM_LOOP);
bmw_LoopShellWalker_visitLoop(walker, l->next); bmw_LoopShellWalker_visitLoop(walker, l->next);
@@ -409,7 +406,7 @@ static void bmw_LoopShellWireWalker_visitVert(BMWalker *walker, BMVert *v, const
bmw_LoopShellWalker_visitEdgeWire(walker, e); bmw_LoopShellWalker_visitEdgeWire(walker, e);
/* check if we step onto a non-wire vertex */ /* Check if we step onto a non-wire vertex. */
v_other = BM_edge_other_vert(e, v); v_other = BM_edge_other_vert(e, v);
BM_ITER_ELEM (l, &iter, v_other, BM_LOOPS_OF_VERT) { BM_ITER_ELEM (l, &iter, v_other, BM_LOOPS_OF_VERT) {
@@ -463,7 +460,7 @@ static void bmw_LoopShellWireWalker_begin(BMWalker *walker, void *data)
break; break;
} }
case BM_FACE: { case BM_FACE: {
/* wire verts will be walked over */ /* Wire verts will be walked over. */
break; break;
} }
default: default:
@@ -581,12 +578,12 @@ static void bmw_ConnectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
BMwConnectedVertexWalker *vwalk; BMwConnectedVertexWalker *vwalk;
if (BLI_gset_haskey(walker->visit_set, v)) { if (BLI_gset_haskey(walker->visit_set, v)) {
/* already visited */ /* Already visited. */
return; return;
} }
if (!bmw_mask_check_vert(walker, v)) { if (!bmw_mask_check_vert(walker, v)) {
/* not flagged for walk */ /* Not flagged for walk. */
return; return;
} }
@@ -670,10 +667,9 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
BMEdge *e; BMEdge *e;
BMFace *f; BMFace *f;
BMLoop *l; BMLoop *l;
/* int found = 0; */
memcpy(&owalk, BMW_current_state(walker), sizeof(owalk)); memcpy(&owalk, BMW_current_state(walker), sizeof(owalk));
/* normally we'd remove here, but delay until after error checking */ /* Normally we'd remove here, but delay until after error checking. */
iwalk = &owalk; iwalk = &owalk;
l = iwalk->curloop; l = iwalk->curloop;
@@ -681,7 +677,7 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
v = BM_edge_other_vert(e, iwalk->lastv); v = BM_edge_other_vert(e, iwalk->lastv);
/* pop off current state */ /* Pop off current state. */
BMW_state_remove(walker); BMW_state_remove(walker);
f = l->f; f = l->f;
@@ -699,7 +695,7 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
} }
} }
else { else {
/* treat non-manifold edges as boundaries */ /* Treat non-manifold edges as boundaries. */
f = l->f; f = l->f;
e = l->e; e = l->e;
break; break;
@@ -717,9 +713,16 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
iwalk = BMW_state_add(walker); iwalk = BMW_state_add(walker);
iwalk->base = owalk.base; iwalk->base = owalk.base;
// if (!BMO_face_flag_test(walker->bm, l->f, walker->restrictflag)) #if 0
// iwalk->curloop = l->radial_next; if (!BMO_face_flag_test(walker->bm, l->f, walker->restrictflag)) {
iwalk->curloop = l; // else iwalk->curloop = l; iwalk->curloop = l->radial_next;
}
else {
iwalk->curloop = l;
}
#else
iwalk->curloop = l;
#endif
iwalk->lastv = v; iwalk->lastv = v;
return owalk.curloop; return owalk.curloop;
@@ -763,7 +766,7 @@ static void *bmw_IslandWalker_step_ex(BMWalker *walker, bool only_manifold)
l_iter = l_first = BM_FACE_FIRST_LOOP(iwalk->cur); l_iter = l_first = BM_FACE_FIRST_LOOP(iwalk->cur);
do { do {
/* could skip loop here too, but don't add unless we need it */ /* Could skip loop here too, but don't add unless we need it. */
if (!bmw_mask_check_edge(walker, l_iter->e)) { if (!bmw_mask_check_edge(walker, l_iter->e)) {
continue; continue;
} }
@@ -772,7 +775,7 @@ static void *bmw_IslandWalker_step_ex(BMWalker *walker, bool only_manifold)
if (only_manifold && (l_iter->radial_next != l_iter)) { if (only_manifold && (l_iter->radial_next != l_iter)) {
int face_count = 1; int face_count = 1;
/* check other faces (not this one), ensure only one other can be walked onto. */ /* Check other faces (not this one), ensure only one other Can be walked onto. */
l_radial_iter = l_iter->radial_next; l_radial_iter = l_iter->radial_next;
do { do {
if (bmw_mask_check_face(walker, l_radial_iter->f)) { if (bmw_mask_check_face(walker, l_radial_iter->f)) {
@@ -796,7 +799,7 @@ static void *bmw_IslandWalker_step_ex(BMWalker *walker, bool only_manifold)
continue; continue;
} }
/* saves checking BLI_gset_haskey below (manifold edges there's a 50% chance) */ /* Saves checking #BLI_gset_haskey below (manifold edges there's a 50% chance). */
if (f == iwalk->cur) { if (f == iwalk->cur) {
continue; continue;
} }
@@ -947,12 +950,12 @@ static void bmw_EdgeLoopWalker_begin(BMWalker *walker, void *data)
} }
if (f_best) { if (f_best) {
/* only use hub selection for 5+ sides else this could /* Only use hub selection for 5+ sides else this could
* conflict with normal edge loop selection. */ * conflict with normal edge loop selection. */
lwalk->f_hub = f_best->len > 4 ? f_best : NULL; lwalk->f_hub = f_best->len > 4 ? f_best : NULL;
} }
else { else {
/* edge doesn't have any faces connected to it */ /* Edge doesn't have any faces connected to it. */
lwalk->f_hub = NULL; lwalk->f_hub = NULL;
} }
} }
@@ -960,7 +963,7 @@ static void bmw_EdgeLoopWalker_begin(BMWalker *walker, void *data)
lwalk->f_hub = NULL; lwalk->f_hub = NULL;
} }
/* rewind */ /* Rewind. */
while ((owalk_pt = BMW_current_state(walker))) { while ((owalk_pt = BMW_current_state(walker))) {
owalk = *((BMwEdgeLoopWalker *)owalk_pt); owalk = *((BMwEdgeLoopWalker *)owalk_pt);
BMW_walk(walker); BMW_walk(walker);
@@ -1007,7 +1010,7 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker)
nexte = BM_edge_exists(v, l->v); nexte = BM_edge_exists(v, l->v);
if (bmw_mask_check_edge(walker, nexte) && !BLI_gset_haskey(walker->visit_set, nexte) && if (bmw_mask_check_edge(walker, nexte) && !BLI_gset_haskey(walker->visit_set, nexte) &&
/* never step onto a boundary edge, this gives odd-results */ /* Never step onto a boundary edge, this gives odd-results. */
(BM_edge_is_boundary(nexte) == false)) { (BM_edge_is_boundary(nexte) == false)) {
lwalk = BMW_state_add(walker); lwalk = BMW_state_add(walker);
lwalk->cur = nexte; lwalk->cur = nexte;
@@ -1024,7 +1027,7 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker)
else if (l == NULL) { /* WIRE EDGE */ else if (l == NULL) { /* WIRE EDGE */
BMIter eiter; BMIter eiter;
/* match trunk: mark all connected wire edges */ /* Match trunk: mark all connected wire edges. */
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
v = i ? e->v2 : e->v1; v = i ? e->v2 : e->v1;
@@ -1051,9 +1054,8 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker)
vert_edge_tot = BM_vert_edge_count_nonwire(v); vert_edge_tot = BM_vert_edge_count_nonwire(v);
/* Typical loopiong over edges in the middle of a mesh */ /* Typical looping over edges in the middle of a mesh.
/* However, why use 2 here at all? * Why use 2 here at all? - for internal ngon loops it can be useful. */
* I guess for internal ngon loops it can be useful. Antony R. */
if (ELEM(vert_edge_tot, 4, 2)) { if (ELEM(vert_edge_tot, 4, 2)) {
int i_opposite = vert_edge_tot / 2; int i_opposite = vert_edge_tot / 2;
int i = 0; int i = 0;
@@ -1094,15 +1096,15 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker)
vert_edge_tot = BM_vert_edge_count_nonwire(v); vert_edge_tot = BM_vert_edge_count_nonwire(v);
/* check if we should step, this is fairly involved */ /* Check if we should step, this is fairly involved. */
if ( if (
/* walk over boundary of faces but stop at corners */ /* Walk over boundary of faces but stop at corners. */
(owalk.is_single == false && vert_edge_tot > 2) || (owalk.is_single == false && vert_edge_tot > 2) ||
/* initial edge was a boundary, so is this edge and vertex is only a part of this face /* Initial edge was a boundary, so is this edge and vertex is only a part of this face
* this lets us walk over the boundary of an ngon which is handy */ * this lets us walk over the boundary of an ngon which is handy. */
(owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e))) { (owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e))) {
/* find next boundary edge in the fan */ /* Find next boundary edge in the fan. */
do { do {
l = BM_loop_other_edge_loop(l, v); l = BM_loop_other_edge_loop(l, v);
if (BM_edge_is_manifold(l->e)) { if (BM_edge_is_manifold(l->e)) {
@@ -1148,14 +1150,16 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker)
* *
* Starts at a tool-flagged face and walks over the face loop * Starts at a tool-flagged face and walks over the face loop
* Conditions for starting and stepping the face loop have been * Conditions for starting and stepping the face loop have been
* tuned in an attempt to match the face loops built by EditMesh * tuned in an attempt to match the face loops built by edit-mesh
* \{ */ * \{ */
/* Check whether the face loop should includes the face specified /**
* by the given BMLoop */ * Check whether the face loop should includes the face specified
* by the given #BMLoop.
*/
static bool bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l) static bool bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
{ {
/* face must have degree 4 */ /* Face must have degree 4. */
if (l->f->len != 4) { if (l->f->len != 4) {
return false; return false;
} }
@@ -1164,7 +1168,7 @@ static bool bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
return false; return false;
} }
/* the face must not have been already visited */ /* The face must not have been already visited. */
if (BLI_gset_haskey(walker->visit_set, l->f) && BLI_gset_haskey(walker->visit_set_alt, l->e)) { if (BLI_gset_haskey(walker->visit_set, l->f) && BLI_gset_haskey(walker->visit_set_alt, l->e)) {
return false; return false;
} }
@@ -1172,23 +1176,22 @@ static bool bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
return true; return true;
} }
/* Check whether the face loop can start from the given edge */ /* Check whether the face loop can start from the given edge. */
static bool bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e) static bool bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
{ {
/* There is no face loop starting from a wire edge */ /* There is no face loop starting from a wire edge. */
if (BM_edge_is_wire(e)) { if (BM_edge_is_wire(e)) {
return false; return false;
} }
/* Don't start a loop from a boundary edge if it cannot /* Don't start a loop from a boundary edge if it cannot be extended to cover any faces. */
* be extended to cover any faces */
if (BM_edge_is_boundary(e)) { if (BM_edge_is_boundary(e)) {
if (!bmw_FaceLoopWalker_include_face(walker, e->l)) { if (!bmw_FaceLoopWalker_include_face(walker, e->l)) {
return false; return false;
} }
} }
/* Don't start a face loop from non-manifold edges */ /* Don't start a face loop from non-manifold edges. */
if (!BM_edge_is_manifold(e)) { if (!BM_edge_is_manifold(e)) {
return false; return false;
} }
@@ -1212,7 +1215,7 @@ static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
lwalk->no_calc = false; lwalk->no_calc = false;
BLI_gset_insert(walker->visit_set, lwalk->l->f); BLI_gset_insert(walker->visit_set, lwalk->l->f);
/* rewind */ /* Rewind. */
while ((owalk_pt = BMW_current_state(walker))) { while ((owalk_pt = BMW_current_state(walker))) {
owalk = *((BMwFaceLoopWalker *)owalk_pt); owalk = *((BMwFaceLoopWalker *)owalk_pt);
BMW_walk(walker); BMW_walk(walker);
@@ -1277,7 +1280,7 @@ static void *bmw_FaceLoopWalker_step(BMWalker *walker)
lwalk->no_calc = false; lwalk->no_calc = false;
} }
/* both may already exist */ /* Both may already exist. */
BLI_gset_add(walker->visit_set_alt, l->e); BLI_gset_add(walker->visit_set_alt, l->e);
BLI_gset_add(walker->visit_set, l->f); BLI_gset_add(walker->visit_set, l->f);
} }
@@ -1312,7 +1315,7 @@ static void bmw_EdgeringWalker_begin(BMWalker *walker, void *data)
BLI_gset_insert(walker->visit_set, lwalk->l->e); BLI_gset_insert(walker->visit_set, lwalk->l->e);
/* rewind */ /* Rewind. */
while ((owalk_pt = BMW_current_state(walker))) { while ((owalk_pt = BMW_current_state(walker))) {
owalk = *((BMwEdgeringWalker *)owalk_pt); owalk = *((BMwEdgeringWalker *)owalk_pt);
BMW_walk(walker); BMW_walk(walker);
@@ -1370,10 +1373,10 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
e = l->e; e = l->e;
if (!EDGE_CHECK(e)) { if (!EDGE_CHECK(e)) {
/* walker won't traverse to a non-manifold edge, but may /* Walker won't traverse to a non-manifold edge, but may
* be started on one, and should not traverse *away* from * be started on one, and should not traverse *away* from
* a non-manifold edge (non-manifold edges are never in an * a non-manifold edge (non-manifold edges are never in an
* edge ring with manifold edges */ * edge ring with manifold edges. */
return e; return e;
} }
@@ -1394,7 +1397,7 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
i -= 2; i -= 2;
} }
} }
/* only walk to manifold edge */ /* Only walk to manifold edge. */
if ((l->f->len % 2 == 0) && EDGE_CHECK(l->e) && !BLI_gset_haskey(walker->visit_set, l->e)) if ((l->f->len % 2 == 0) && EDGE_CHECK(l->e) && !BLI_gset_haskey(walker->visit_set, l->e))
#else #else
@@ -1404,7 +1407,7 @@ static void *bmw_EdgeringWalker_step(BMWalker *walker)
if ((l->f->len != 4) || !EDGE_CHECK(l->e) || !bmw_mask_check_face(walker, l->f)) { if ((l->f->len != 4) || !EDGE_CHECK(l->e) || !bmw_mask_check_face(walker, l->f)) {
l = owalk.l->next->next; l = owalk.l->next->next;
} }
/* only walk to manifold edge */ /* Only walk to manifold edge. */
if ((l->f->len == 4) && EDGE_CHECK(l->e) && !BLI_gset_haskey(walker->visit_set, l->e)) if ((l->f->len == 4) && EDGE_CHECK(l->e) && !BLI_gset_haskey(walker->visit_set, l->e))
#endif #endif
{ {
@@ -1547,8 +1550,8 @@ static void *bmw_UVEdgeWalker_step(BMWalker *walker)
return l; return l;
} }
/* go over loops around l->v and nl->v and see which ones share l and nl's /* Go over loops around `l->v` and `l->next->v` and see which ones share `l` and `l->next`
* mloopuv's coordinates. in addition, push on l->next if necessary */ * UV's coordinates. in addition, push on `l->next` if necessary. */
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
BMIter liter; BMIter liter;
BMLoop *l_pivot, *l_radial; BMLoop *l_pivot, *l_radial;
@@ -1600,7 +1603,7 @@ static BMWalker bmw_VertShellWalker_Type = {
bmw_VertShellWalker_yield, bmw_VertShellWalker_yield,
sizeof(BMwShellWalker), sizeof(BMwShellWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_EDGE, /* valid restrict masks */ BM_EDGE, /* Valid restrict masks. */
}; };
static BMWalker bmw_LoopShellWalker_Type = { static BMWalker bmw_LoopShellWalker_Type = {
@@ -1610,7 +1613,7 @@ static BMWalker bmw_LoopShellWalker_Type = {
bmw_LoopShellWalker_yield, bmw_LoopShellWalker_yield,
sizeof(BMwLoopShellWalker), sizeof(BMwLoopShellWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_EDGE, /* valid restrict masks */ BM_EDGE, /* Valid restrict masks. */
}; };
static BMWalker bmw_LoopShellWireWalker_Type = { static BMWalker bmw_LoopShellWireWalker_Type = {
@@ -1620,7 +1623,7 @@ static BMWalker bmw_LoopShellWireWalker_Type = {
bmw_LoopShellWireWalker_yield, bmw_LoopShellWireWalker_yield,
sizeof(BMwLoopShellWireWalker), sizeof(BMwLoopShellWireWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_EDGE, /* valid restrict masks */ BM_EDGE, /* Valid restrict masks. */
}; };
static BMWalker bmw_FaceShellWalker_Type = { static BMWalker bmw_FaceShellWalker_Type = {
@@ -1630,7 +1633,7 @@ static BMWalker bmw_FaceShellWalker_Type = {
bmw_FaceShellWalker_yield, bmw_FaceShellWalker_yield,
sizeof(BMwShellWalker), sizeof(BMwShellWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_EDGE, /* valid restrict masks */ BM_EDGE, /* Valid restrict masks. */
}; };
static BMWalker bmw_IslandboundWalker_Type = { static BMWalker bmw_IslandboundWalker_Type = {
@@ -1640,7 +1643,7 @@ static BMWalker bmw_IslandboundWalker_Type = {
bmw_IslandboundWalker_yield, bmw_IslandboundWalker_yield,
sizeof(BMwIslandboundWalker), sizeof(BMwIslandboundWalker),
BMW_DEPTH_FIRST, BMW_DEPTH_FIRST,
BM_FACE, /* valid restrict masks */ BM_FACE, /* Valid restrict masks. */
}; };
static BMWalker bmw_IslandWalker_Type = { static BMWalker bmw_IslandWalker_Type = {
@@ -1650,17 +1653,17 @@ static BMWalker bmw_IslandWalker_Type = {
bmw_IslandWalker_yield, bmw_IslandWalker_yield,
sizeof(BMwIslandWalker), sizeof(BMwIslandWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_EDGE | BM_FACE, /* valid restrict masks */ BM_EDGE | BM_FACE, /* Valid restrict masks. */
}; };
static BMWalker bmw_IslandManifoldWalker_Type = { static BMWalker bmw_IslandManifoldWalker_Type = {
BM_FACE, BM_FACE,
bmw_IslandWalker_begin, bmw_IslandWalker_begin,
bmw_IslandManifoldWalker_step, /* only difference with BMW_ISLAND */ bmw_IslandManifoldWalker_step, /* Only difference with #BMW_ISLAND. */
bmw_IslandWalker_yield, bmw_IslandWalker_yield,
sizeof(BMwIslandWalker), sizeof(BMwIslandWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_EDGE | BM_FACE, /* valid restrict masks */ BM_EDGE | BM_FACE, /* Valid restrict masks. */
}; };
static BMWalker bmw_EdgeLoopWalker_Type = { static BMWalker bmw_EdgeLoopWalker_Type = {
@@ -1671,7 +1674,7 @@ static BMWalker bmw_EdgeLoopWalker_Type = {
sizeof(BMwEdgeLoopWalker), sizeof(BMwEdgeLoopWalker),
BMW_DEPTH_FIRST, BMW_DEPTH_FIRST,
0, 0,
/* valid restrict masks */ /* could add flags here but so far none are used */ /* Valid restrict masks. */ /* Could add flags here but so far none are used. */
}; };
static BMWalker bmw_FaceLoopWalker_Type = { static BMWalker bmw_FaceLoopWalker_Type = {
@@ -1682,7 +1685,7 @@ static BMWalker bmw_FaceLoopWalker_Type = {
sizeof(BMwFaceLoopWalker), sizeof(BMwFaceLoopWalker),
BMW_DEPTH_FIRST, BMW_DEPTH_FIRST,
0, 0,
/* valid restrict masks */ /* could add flags here but so far none are used */ /* Valid restrict masks. */ /* Could add flags here but so far none are used. */
}; };
static BMWalker bmw_EdgeringWalker_Type = { static BMWalker bmw_EdgeringWalker_Type = {
@@ -1692,7 +1695,7 @@ static BMWalker bmw_EdgeringWalker_Type = {
bmw_EdgeringWalker_yield, bmw_EdgeringWalker_yield,
sizeof(BMwEdgeringWalker), sizeof(BMwEdgeringWalker),
BMW_DEPTH_FIRST, BMW_DEPTH_FIRST,
BM_EDGE, /* valid restrict masks */ BM_EDGE, /* Valid restrict masks. */
}; };
static BMWalker bmw_EdgeboundaryWalker_Type = { static BMWalker bmw_EdgeboundaryWalker_Type = {
@@ -1712,7 +1715,7 @@ static BMWalker bmw_UVEdgeWalker_Type = {
bmw_UVEdgeWalker_yield, bmw_UVEdgeWalker_yield,
sizeof(BMwUVEdgeWalker), sizeof(BMwUVEdgeWalker),
BMW_DEPTH_FIRST, BMW_DEPTH_FIRST,
BM_EDGE, /* valid restrict masks */ BM_EDGE, /* Valid restrict masks. */
}; };
static BMWalker bmw_ConnectedVertexWalker_Type = { static BMWalker bmw_ConnectedVertexWalker_Type = {
@@ -1722,23 +1725,23 @@ static BMWalker bmw_ConnectedVertexWalker_Type = {
bmw_ConnectedVertexWalker_yield, bmw_ConnectedVertexWalker_yield,
sizeof(BMwConnectedVertexWalker), sizeof(BMwConnectedVertexWalker),
BMW_BREADTH_FIRST, BMW_BREADTH_FIRST,
BM_VERT, /* valid restrict masks */ BM_VERT, /* Valid restrict masks. */
}; };
BMWalker *bm_walker_types[] = { BMWalker *bm_walker_types[] = {
&bmw_VertShellWalker_Type, /* BMW_VERT_SHELL */ &bmw_VertShellWalker_Type, /* #BMW_VERT_SHELL */
&bmw_LoopShellWalker_Type, /* BMW_LOOP_SHELL */ &bmw_LoopShellWalker_Type, /* #BMW_LOOP_SHELL */
&bmw_LoopShellWireWalker_Type, /* BMW_LOOP_SHELL_WIRE */ &bmw_LoopShellWireWalker_Type, /* #BMW_LOOP_SHELL_WIRE */
&bmw_FaceShellWalker_Type, /* BMW_FACE_SHELL */ &bmw_FaceShellWalker_Type, /* #BMW_FACE_SHELL */
&bmw_EdgeLoopWalker_Type, /* BMW_EDGELOOP */ &bmw_EdgeLoopWalker_Type, /* #BMW_EDGELOOP */
&bmw_FaceLoopWalker_Type, /* BMW_FACELOOP */ &bmw_FaceLoopWalker_Type, /* #BMW_FACELOOP */
&bmw_EdgeringWalker_Type, /* BMW_EDGERING */ &bmw_EdgeringWalker_Type, /* #BMW_EDGERING */
&bmw_EdgeboundaryWalker_Type, /* BMW_EDGEBOUNDARY */ &bmw_EdgeboundaryWalker_Type, /* #BMW_EDGEBOUNDARY */
&bmw_UVEdgeWalker_Type, /* BMW_LOOPDATA_ISLAND */ &bmw_UVEdgeWalker_Type, /* #BMW_LOOPDATA_ISLAND */
&bmw_IslandboundWalker_Type, /* BMW_ISLANDBOUND */ &bmw_IslandboundWalker_Type, /* #BMW_ISLANDBOUND */
&bmw_IslandWalker_Type, /* BMW_ISLAND */ &bmw_IslandWalker_Type, /* #BMW_ISLAND */
&bmw_IslandManifoldWalker_Type, /* BMW_ISLAND_MANIFOLD */ &bmw_IslandManifoldWalker_Type, /* #BMW_ISLAND_MANIFOLD */
&bmw_ConnectedVertexWalker_Type, /* BMW_CONNECTED_VERTEX */ &bmw_ConnectedVertexWalker_Type, /* #BMW_CONNECTED_VERTEX */
}; };
const int bm_totwalkers = ARRAY_SIZE(bm_walker_types); const int bm_totwalkers = ARRAY_SIZE(bm_walker_types);