Code Cleanup - naming consistancy for bmesh struct types
authorCampbell Barton <ideasman42@gmail.com>
Fri, 2 Mar 2012 12:44:34 +0000 (12:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 2 Mar 2012 12:44:34 +0000 (12:44 +0000)
source/blender/bmesh/intern/bmesh_walkers.c
source/blender/bmesh/intern/bmesh_walkers_impl.c
source/blender/bmesh/intern/bmesh_walkers_private.h
source/blender/bmesh/operators/bmo_dissolve.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/operators/bmo_subdivide.h
source/blender/bmesh/operators/bmo_utils.c

index f20c91c41282c1ef00c94f7e9c17862392f1d45c..029bc35f2e7732da516ba6a35a32487835391909 100644 (file)
@@ -178,7 +178,7 @@ void *BMW_walk(BMWalker *walker)
  */
 void *BMW_current_state(BMWalker *walker)
 {
-       bmesh_walkerGeneric *currentstate = walker->states.first;
+       BMwGenericWalker *currentstate = walker->states.first;
        if (currentstate) {
                /* Automatic update of depth. For most walkers that
                 * follow the standard "Step" pattern of:
@@ -220,7 +220,7 @@ void BMW_state_remove(BMWalker *walker)
  */
 void *BMW_state_add(BMWalker *walker)
 {
-       bmesh_walkerGeneric *newstate;
+       BMwGenericWalker *newstate;
        newstate = BLI_mempool_alloc(walker->worklist);
        newstate->depth = walker->depth;
        switch (walker->order)
index 014fa87ca1c7d2f0daf20270ab349dfd19f1f608..23cc18c8e265fe8148423bfece8328f84d9a0c72 100644 (file)
@@ -40,9 +40,9 @@
  *
  * \todo Add restriction flag/callback for wire edges.
  */
-static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e)
+static void bmw_ShellWalker_visitEdge(BMWalker *walker, BMEdge *e)
 {
-       shellWalker *shellWalk = NULL;
+       BMwShellWalker *shellWalk = NULL;
 
        if (BLI_ghash_haskey(walker->visithash, e)) {
                return;
@@ -57,7 +57,7 @@ static void shellWalker_visitEdge(BMWalker *walker, BMEdge *e)
        BLI_ghash_insert(walker->visithash, e, NULL);
 }
 
-static void shellWalker_begin(BMWalker *walker, void *data)
+static void bmw_ShellWalker_begin(BMWalker *walker, void *data)
 {
        BMIter eiter;
        BMHeader *h = data;
@@ -75,7 +75,7 @@ static void shellWalker_begin(BMWalker *walker, void *data)
                         * to the worklist */
                        v = (BMVert *)h;
                        BM_ITER(e, &eiter, walker->bm, BM_EDGES_OF_VERT, v) {
-                               shellWalker_visitEdge(walker, e);
+                               bmw_ShellWalker_visitEdge(walker, e);
                        }
                        break;
                }
@@ -85,21 +85,21 @@ static void shellWalker_begin(BMWalker *walker, void *data)
                        /* starting the walk at an edge, add the single edge
                         * to the worklist */
                        e = (BMEdge *)h;
-                       shellWalker_visitEdge(walker, e);
+                       bmw_ShellWalker_visitEdge(walker, e);
                        break;
                }
        }
 }
 
-static void *shellWalker_yield(BMWalker *walker)
+static void *bmw_ShellWalker_yield(BMWalker *walker)
 {
-       shellWalker *shellWalk = BMW_current_state(walker);
+       BMwShellWalker *shellWalk = BMW_current_state(walker);
        return shellWalk->curedge;
 }
 
-static void *shellWalker_step(BMWalker *walker)
+static void *bmw_ShellWalker_step(BMWalker *walker)
 {
-       shellWalker *swalk = BMW_current_state(walker);
+       BMwShellWalker *swalk = BMW_current_state(walker);
        BMEdge *e, *e2;
        BMVert *v;
        BMIter iter;
@@ -111,7 +111,7 @@ static void *shellWalker_step(BMWalker *walker)
        for (i = 0; i < 2; i++) {
                v = i ? e->v2 : e->v1;
                BM_ITER(e2, &iter, walker->bm, BM_EDGES_OF_VERT, v) {
-                       shellWalker_visitEdge(walker, e2);
+                       bmw_ShellWalker_visitEdge(walker, e2);
                }
        }
 
@@ -119,12 +119,12 @@ static void *shellWalker_step(BMWalker *walker)
 }
 
 #if 0
-static void *shellWalker_step(BMWalker *walker)
+static void *bmw_ShellWalker_step(BMWalker *walker)
 {
        BMEdge *curedge, *next = NULL;
        BMVert *ov = NULL;
        int restrictpass = 1;
-       shellWalker shellWalk = *((shellWalker *)BMW_current_state(walker));
+       BMwShellWalker shellWalk = *((BMwShellWalker *)BMW_current_state(walker));
        
        if (!BLI_ghash_haskey(walker->visithash, shellWalk.base)) {
                BLI_ghash_insert(walker->visithash, shellWalk.base, NULL);
@@ -140,7 +140,7 @@ static void *shellWalker_step(BMWalker *walker)
                        if (!walker->restrictflag ||
                            (walker->restrictflag && BMO_elem_flag_test(walker->bm, curedge, walker->restrictflag)))
                        {
-                               shellWalker *newstate;
+                               BMwShellWalker *newstate;
 
                                ov = BM_edge_other_vert(curedge, shellWalk.base);
                                
@@ -166,9 +166,9 @@ static void *shellWalker_step(BMWalker *walker)
  *
  * Similar to shell walker, but visits vertices instead of edges.
  */
-static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
+static void bmw_ConnectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
 {
-       connectedVertexWalker *vwalk;
+       BMwConnectedVertexWalker *vwalk;
 
        if (BLI_ghash_haskey(walker->visithash, v)) {
                /* already visited */
@@ -184,21 +184,21 @@ static void connectedVertexWalker_visitVertex(BMWalker *walker, BMVert *v)
        BLI_ghash_insert(walker->visithash, v, NULL);
 }
 
-static void connectedVertexWalker_begin(BMWalker *walker, void *data)
+static void bmw_ConnectedVertexWalker_begin(BMWalker *walker, void *data)
 {
        BMVert *v = data;
-       connectedVertexWalker_visitVertex(walker, v);
+       bmw_ConnectedVertexWalker_visitVertex(walker, v);
 }
 
-static void *connectedVertexWalker_yield(BMWalker *walker)
+static void *bmw_ConnectedVertexWalker_yield(BMWalker *walker)
 {
-       connectedVertexWalker *vwalk = BMW_current_state(walker);
+       BMwConnectedVertexWalker *vwalk = BMW_current_state(walker);
        return vwalk->curvert;
 }
 
-static void *connectedVertexWalker_step(BMWalker *walker)
+static void *bmw_ConnectedVertexWalker_step(BMWalker *walker)
 {
-       connectedVertexWalker *vwalk = BMW_current_state(walker);
+       BMwConnectedVertexWalker *vwalk = BMW_current_state(walker);
        BMVert *v, *v2;
        BMEdge *e;
        BMIter iter;
@@ -210,7 +210,7 @@ static void *connectedVertexWalker_step(BMWalker *walker)
        BM_ITER(e, &iter, walker->bm, BM_EDGES_OF_VERT, v) {
                v2 = BM_edge_other_vert(e, v);
                if (!BLI_ghash_haskey(walker->visithash, v2)) {
-                       connectedVertexWalker_visitVertex(walker, v2);
+                       bmw_ConnectedVertexWalker_visitVertex(walker, v2);
                }
        }
 
@@ -224,10 +224,10 @@ static void *connectedVertexWalker_step(BMWalker *walker)
  *
  * \todo Add restriction flag/callback for wire edges.
  */
-static void islandboundWalker_begin(BMWalker *walker, void *data)
+static void bmw_IslandboundWalker_begin(BMWalker *walker, void *data)
 {
        BMLoop *l = data;
-       islandboundWalker *iwalk = NULL;
+       BMwIslandboundWalker *iwalk = NULL;
 
        iwalk = BMW_state_add(walker);
 
@@ -238,16 +238,16 @@ static void islandboundWalker_begin(BMWalker *walker, void *data)
 
 }
 
-static void *islandboundWalker_yield(BMWalker *walker)
+static void *bmw_IslandboundWalker_yield(BMWalker *walker)
 {
-       islandboundWalker *iwalk = BMW_current_state(walker);
+       BMwIslandboundWalker *iwalk = BMW_current_state(walker);
 
        return iwalk->curloop;
 }
 
-static void *islandboundWalker_step(BMWalker *walker)
+static void *bmw_IslandboundWalker_step(BMWalker *walker)
 {
-       islandboundWalker *iwalk = BMW_current_state(walker), owalk;
+       BMwIslandboundWalker *iwalk = BMW_current_state(walker), owalk;
        BMVert *v;
        BMEdge *e = iwalk->curloop->e;
        BMFace *f;
@@ -317,9 +317,9 @@ static void *islandboundWalker_step(BMWalker *walker)
  *
  * \todo Add restriction flag/callback for wire edges.
  */
-static void islandWalker_begin(BMWalker *walker, void *data)
+static void bmw_IslandWalker_begin(BMWalker *walker, void *data)
 {
-       islandWalker *iwalk = NULL;
+       BMwIslandWalker *iwalk = NULL;
 
        if (walker->mask_face && !BMO_elem_flag_test(walker->bm, (BMElemF *)data, walker->mask_face)) {
                return;
@@ -331,17 +331,17 @@ static void islandWalker_begin(BMWalker *walker, void *data)
        iwalk->cur = data;
 }
 
-static void *islandWalker_yield(BMWalker *walker)
+static void *bmw_IslandWalker_yield(BMWalker *walker)
 {
-       islandWalker *iwalk = BMW_current_state(walker);
+       BMwIslandWalker *iwalk = BMW_current_state(walker);
 
        return iwalk->cur;
 }
 
-static void *islandWalker_step(BMWalker *walker)
+static void *bmw_IslandWalker_step(BMWalker *walker)
 {
-       islandWalker *iwalk = BMW_current_state(walker);
-       /* islandWalker *owalk = iwalk; */ /* UNUSED */
+       BMwIslandWalker *iwalk = BMW_current_state(walker);
+       /* BMwIslandWalker *owalk = iwalk; */ /* UNUSED */
        BMIter iter, liter;
        BMFace *f, *curf = iwalk->cur;
        BMLoop *l;
@@ -381,9 +381,9 @@ static void *islandWalker_step(BMWalker *walker)
  *
  * Starts at a tool-flagged edge and walks over the edge loop
  */
-static void loopWalker_begin(BMWalker *walker, void *data)
+static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
 {
-       loopWalker *lwalk = NULL, owalk;
+       BMwLoopWalker *lwalk = NULL, owalk;
        BMEdge *e = data;
        BMVert *v;
        /* int found = 1, val; */ /* UNUSED */
@@ -402,7 +402,7 @@ static void loopWalker_begin(BMWalker *walker, void *data)
 
        /* rewin */
        while (BMW_current_state(walker)) {
-               owalk = *((loopWalker *)BMW_current_state(walker));
+               owalk = *((BMwLoopWalker *)BMW_current_state(walker));
                BMW_walk(walker);
        }
 
@@ -419,16 +419,16 @@ static void loopWalker_begin(BMWalker *walker, void *data)
        BLI_ghash_insert(walker->visithash, owalk.cur, NULL);
 }
 
-static void *loopWalker_yield(BMWalker *walker)
+static void *bmw_LoopWalker_yield(BMWalker *walker)
 {
-       loopWalker *lwalk = BMW_current_state(walker);
+       BMwLoopWalker *lwalk = BMW_current_state(walker);
 
        return lwalk->cur;
 }
 
-static void *loopWalker_step(BMWalker *walker)
+static void *bmw_LoopWalker_step(BMWalker *walker)
 {
-       loopWalker *lwalk = BMW_current_state(walker), owalk;
+       BMwLoopWalker *lwalk = BMW_current_state(walker), owalk;
        BMIter eiter;
        BMEdge *e = lwalk->cur, *nexte = NULL;
        BMLoop *l, *l2;
@@ -517,7 +517,7 @@ static void *loopWalker_step(BMWalker *walker)
 
 /* Check whether the face loop should includes the face specified
  * by the given BMLoop */
-static int faceloopWalker_include_face(BMWalker *walker, BMLoop *l)
+static int bmw_FaceLoopWalker_include_face(BMWalker *walker, BMLoop *l)
 {
        /* face must have degree 4 */
        if (l->f->len != 4) {
@@ -533,7 +533,7 @@ static int faceloopWalker_include_face(BMWalker *walker, BMLoop *l)
 }
 
 /* Check whether the face loop can start from the given edge */
-static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
+static int bmw_FaceLoopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
 {
        BMesh *bm = walker->bm;
 
@@ -545,7 +545,7 @@ static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
        /* Don't start a loop from a boundary edge if it cannot
         * be extended to cover any faces */
        if (BM_edge_face_count(e) == 1) {
-               if (!faceloopWalker_include_face(walker, e->l)) {
+               if (!bmw_FaceLoopWalker_include_face(walker, e->l)) {
                        return FALSE;
                }
        }
@@ -558,14 +558,14 @@ static int faceloopWalker_edge_begins_loop(BMWalker *walker, BMEdge *e)
        return TRUE;
 }
 
-static void faceloopWalker_begin(BMWalker *walker, void *data)
+static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
 {
-       faceloopWalker *lwalk, owalk;
+       BMwFaceLoopWalker *lwalk, owalk;
        BMEdge *e = data;
        /* BMesh *bm = walker->bm; */ /* UNUSED */
        /* int fcount = BM_edge_face_count(e); */ /* UNUSED */
 
-       if (!faceloopWalker_edge_begins_loop(walker, e))
+       if (!bmw_FaceLoopWalker_edge_begins_loop(walker, e))
                return;
 
        lwalk = BMW_state_add(walker);
@@ -575,7 +575,7 @@ static void faceloopWalker_begin(BMWalker *walker, void *data)
 
        /* rewin */
        while (BMW_current_state(walker)) {
-               owalk = *((faceloopWalker *)BMW_current_state(walker));
+               owalk = *((BMwFaceLoopWalker *)BMW_current_state(walker));
                BMW_walk(walker);
        }
 
@@ -588,9 +588,9 @@ static void faceloopWalker_begin(BMWalker *walker, void *data)
        BLI_ghash_insert(walker->visithash, lwalk->l->f, NULL);
 }
 
-static void *faceloopWalker_yield(BMWalker *walker)
+static void *bmw_FaceLoopWalker_yield(BMWalker *walker)
 {
-       faceloopWalker *lwalk = BMW_current_state(walker);
+       BMwFaceLoopWalker *lwalk = BMW_current_state(walker);
        
        if (!lwalk) {
                return NULL;
@@ -599,9 +599,9 @@ static void *faceloopWalker_yield(BMWalker *walker)
        return lwalk->l->f;
 }
 
-static void *faceloopWalker_step(BMWalker *walker)
+static void *bmw_FaceLoopWalker_step(BMWalker *walker)
 {
-       faceloopWalker *lwalk = BMW_current_state(walker);
+       BMwFaceLoopWalker *lwalk = BMW_current_state(walker);
        BMFace *f = lwalk->l->f;
        BMLoop *l = lwalk->l, *origl = lwalk->l;
 
@@ -612,7 +612,7 @@ static void *faceloopWalker_step(BMWalker *walker)
        if (lwalk->nocalc)
                return f;
 
-       if (!faceloopWalker_include_face(walker, l)) {
+       if (!bmw_FaceLoopWalker_include_face(walker, l)) {
                l = lwalk->l;
                l = l->next->next;
                if (BM_edge_face_count(l->e) != 2) {
@@ -621,7 +621,7 @@ static void *faceloopWalker_step(BMWalker *walker)
                l = l->radial_next;
        }
 
-       if (faceloopWalker_include_face(walker, l)) {
+       if (bmw_FaceLoopWalker_include_face(walker, l)) {
                lwalk = BMW_state_add(walker);
                lwalk->l = l;
 
@@ -646,9 +646,9 @@ static void *faceloopWalker_step(BMWalker *walker)
  * Conditions for starting and stepping the edge ring have been
  * tuned in an attempt to match the edge rings built by EditMesh
  */
-static void edgeringWalker_begin(BMWalker *walker, void *data)
+static void bmw_EdgeringWalker_begin(BMWalker *walker, void *data)
 {
-       edgeringWalker *lwalk, owalk;
+       BMwEdgeringWalker *lwalk, owalk;
        BMEdge *e = data;
 
        lwalk = BMW_state_add(walker);
@@ -666,7 +666,7 @@ static void edgeringWalker_begin(BMWalker *walker, void *data)
 
        /* rewin */
        while (BMW_current_state(walker)) {
-               owalk = *((edgeringWalker *)BMW_current_state(walker));
+               owalk = *((BMwEdgeringWalker *)BMW_current_state(walker));
                BMW_walk(walker);
        }
 
@@ -681,9 +681,9 @@ static void edgeringWalker_begin(BMWalker *walker, void *data)
        BLI_ghash_insert(walker->visithash, lwalk->l->e, NULL);
 }
 
-static void *edgeringWalker_yield(BMWalker *walker)
+static void *bmw_EdgeringWalker_yield(BMWalker *walker)
 {
-       edgeringWalker *lwalk = BMW_current_state(walker);
+       BMwEdgeringWalker *lwalk = BMW_current_state(walker);
        
        if (!lwalk) {
                return NULL;
@@ -695,9 +695,9 @@ static void *edgeringWalker_yield(BMWalker *walker)
                return lwalk->wireedge;
 }
 
-static void *edgeringWalker_step(BMWalker *walker)
+static void *bmw_EdgeringWalker_step(BMWalker *walker)
 {
-       edgeringWalker *lwalk = BMW_current_state(walker);
+       BMwEdgeringWalker *lwalk = BMW_current_state(walker);
        BMEdge *e;
        BMLoop *l = lwalk->l /* , *origl = lwalk->l */;
        BMesh *bm = walker->bm;
@@ -748,9 +748,9 @@ static void *edgeringWalker_step(BMWalker *walker)
        return e;
 }
 
-static void uvedgeWalker_begin(BMWalker *walker, void *data)
+static void bmw_UVEdgeWalker_begin(BMWalker *walker, void *data)
 {
-       uvedgeWalker *lwalk;
+       BMwUVEdgeWalker *lwalk;
        BMLoop *l = data;
 
        if (BLI_ghash_haskey(walker->visithash, l))
@@ -761,9 +761,9 @@ static void uvedgeWalker_begin(BMWalker *walker, void *data)
        BLI_ghash_insert(walker->visithash, l, NULL);
 }
 
-static void *uvedgeWalker_yield(BMWalker *walker)
+static void *bmw_UVEdgeWalker_yield(BMWalker *walker)
 {
-       uvedgeWalker *lwalk = BMW_current_state(walker);
+       BMwUVEdgeWalker *lwalk = BMW_current_state(walker);
        
        if (!lwalk) {
                return NULL;
@@ -772,9 +772,9 @@ static void *uvedgeWalker_yield(BMWalker *walker)
        return lwalk->l;
 }
 
-static void *uvedgeWalker_step(BMWalker *walker)
+static void *bmw_UVEdgeWalker_step(BMWalker *walker)
 {
-       uvedgeWalker *lwalk = BMW_current_state(walker);
+       BMwUVEdgeWalker *lwalk = BMW_current_state(walker);
        BMLoop *l, *l2, *l3, *nl, *cl;
        BMIter liter;
        void *d1, *d2;
@@ -826,87 +826,87 @@ static void *uvedgeWalker_step(BMWalker *walker)
        return l;
 }
 
-static BMWalker shell_walker_type = {
-       shellWalker_begin,
-       shellWalker_step,
-       shellWalker_yield,
-       sizeof(shellWalker),
+static BMWalker bmw_ShellWalker_Type = {
+       bmw_ShellWalker_begin,
+       bmw_ShellWalker_step,
+       bmw_ShellWalker_yield,
+       sizeof(BMwShellWalker),
        BMW_BREADTH_FIRST,
        BM_EDGE, /* valid restrict masks */
 };
 
-static BMWalker islandbound_walker_type = {
-       islandboundWalker_begin,
-       islandboundWalker_step,
-       islandboundWalker_yield,
-       sizeof(islandboundWalker),
+static BMWalker bmw_IslandboundWalker_Type = {
+       bmw_IslandboundWalker_begin,
+       bmw_IslandboundWalker_step,
+       bmw_IslandboundWalker_yield,
+       sizeof(BMwIslandboundWalker),
        BMW_DEPTH_FIRST,
        BM_FACE, /* valid restrict masks */
 };
 
-static BMWalker island_walker_type = {
-       islandWalker_begin,
-       islandWalker_step,
-       islandWalker_yield,
-       sizeof(islandWalker),
+static BMWalker bmw_IslandWalker_Type = {
+       bmw_IslandWalker_begin,
+       bmw_IslandWalker_step,
+       bmw_IslandWalker_yield,
+       sizeof(BMwIslandWalker),
        BMW_BREADTH_FIRST,
        BM_EDGE | BM_FACE, /* valid restrict masks */
 };
 
-static BMWalker loop_walker_type = {
-       loopWalker_begin,
-       loopWalker_step,
-       loopWalker_yield,
-       sizeof(loopWalker),
+static BMWalker bmw_LoopWalker_Type = {
+       bmw_LoopWalker_begin,
+       bmw_LoopWalker_step,
+       bmw_LoopWalker_yield,
+       sizeof(BMwLoopWalker),
        BMW_DEPTH_FIRST,
        0, /* valid restrict masks */ /* could add flags here but so far none are used */
 };
 
-static BMWalker faceloop_walker_type = {
-       faceloopWalker_begin,
-       faceloopWalker_step,
-       faceloopWalker_yield,
-       sizeof(faceloopWalker),
+static BMWalker bmw_FaceLoopWalker_Type = {
+       bmw_FaceLoopWalker_begin,
+       bmw_FaceLoopWalker_step,
+       bmw_FaceLoopWalker_yield,
+       sizeof(BMwFaceLoopWalker),
        BMW_DEPTH_FIRST,
        0, /* valid restrict masks */ /* could add flags here but so far none are used */
 };
 
-static BMWalker edgering_walker_type = {
-       edgeringWalker_begin,
-       edgeringWalker_step,
-       edgeringWalker_yield,
-       sizeof(edgeringWalker),
+static BMWalker bmw_EdgeringWalker_Type = {
+       bmw_EdgeringWalker_begin,
+       bmw_EdgeringWalker_step,
+       bmw_EdgeringWalker_yield,
+       sizeof(BMwEdgeringWalker),
        BMW_DEPTH_FIRST,
        0, /* valid restrict masks */ /* could add flags here but so far none are used */
 };
 
-static BMWalker loopdata_region_walker_type = {
-       uvedgeWalker_begin,
-       uvedgeWalker_step,
-       uvedgeWalker_yield,
-       sizeof(uvedgeWalker),
+static BMWalker bmw_UVEdgeWalker_Type = {
+       bmw_UVEdgeWalker_begin,
+       bmw_UVEdgeWalker_step,
+       bmw_UVEdgeWalker_yield,
+       sizeof(BMwUVEdgeWalker),
        BMW_DEPTH_FIRST,
        BM_EDGE, /* valid restrict masks */
 };
 
-static BMWalker connected_vertex_walker_type = {
-       connectedVertexWalker_begin,
-       connectedVertexWalker_step,
-       connectedVertexWalker_yield,
-       sizeof(connectedVertexWalker),
+static BMWalker bmw_ConnectedVertexWalker_Type = {
+       bmw_ConnectedVertexWalker_begin,
+       bmw_ConnectedVertexWalker_step,
+       bmw_ConnectedVertexWalker_yield,
+       sizeof(BMwConnectedVertexWalker),
        BMW_BREADTH_FIRST,
        BM_VERT, /* valid restrict masks */
 };
 
 BMWalker *bm_walker_types[] = {
-       &shell_walker_type,              /* BMW_SHELL */
-       &loop_walker_type,               /* BMW_LOOP */
-       &faceloop_walker_type,           /* BMW_FACELOOP */
-       &edgering_walker_type,           /* BMW_EDGERING */
-       &loopdata_region_walker_type,    /* BMW_LOOPDATA_ISLAND */
-       &islandbound_walker_type,        /* BMW_ISLANDBOUND */
-       &island_walker_type,             /* BMW_ISLAND */
-       &connected_vertex_walker_type,   /* BMW_CONNECTED_VERTEX */
+       &bmw_ShellWalker_Type,              /* BMW_SHELL */
+       &bmw_LoopWalker_Type,               /* BMW_LOOP */
+       &bmw_FaceLoopWalker_Type,           /* BMW_FACELOOP */
+       &bmw_EdgeringWalker_Type,           /* BMW_EDGERING */
+       &bmw_UVEdgeWalker_Type,             /* BMW_LOOPDATA_ISLAND */
+       &bmw_IslandboundWalker_Type,        /* BMW_ISLANDBOUND */
+       &bmw_IslandWalker_Type,             /* BMW_ISLAND */
+       &bmw_ConnectedVertexWalker_Type,    /* BMW_CONNECTED_VERTEX */
 };
 
-int bm_totwalkers = sizeof(bm_walker_types) / sizeof(*bm_walker_types);
+const int bm_totwalkers = sizeof(bm_walker_types) / sizeof(*bm_walker_types);
index 963018856ad061824a38d39f3cee2093031e9247..b1447b52d1afcdb057a9b119c71fcd2a00454524 100644 (file)
  */
 
 extern BMWalker *bm_walker_types[];
-extern int bm_totwalkers;
+extern const int bm_totwalkers;
 
 
-/* Pointer hiding*/
-typedef struct bmesh_walkerGeneric {
+/* Pointer hiding */
+typedef struct BMwGenericWalker {
        Link link;
        int depth;
-} bmesh_walkerGeneric;
+} BMwGenericWalker;
 
 
-typedef struct shellWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwShellWalker {
+       BMwGenericWalker header;
        BMEdge *curedge;
-} shellWalker;
+} BMwShellWalker;
 
-typedef struct islandboundWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwIslandboundWalker {
+       BMwGenericWalker header;
        BMLoop *base;
        BMVert *lastv;
        BMLoop *curloop;
-} islandboundWalker;
+} BMwIslandboundWalker;
 
-typedef struct islandWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwIslandWalker {
+       BMwGenericWalker header;
        BMFace *cur;
-} islandWalker;
+} BMwIslandWalker;
 
-typedef struct loopWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwLoopWalker {
+       BMwGenericWalker header;
        BMEdge *cur, *start;
        BMVert *lastv, *startv;
        int startrad, stage2;
-} loopWalker;
+} BMwLoopWalker;
 
-typedef struct faceloopWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwFaceLoopWalker {
+       BMwGenericWalker header;
        BMLoop *l;
        int nocalc;
-} faceloopWalker;
+} BMwFaceLoopWalker;
 
-typedef struct edgeringWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwEdgeringWalker {
+       BMwGenericWalker header;
        BMLoop *l;
        BMEdge *wireedge;
-} edgeringWalker;
+} BMwEdgeringWalker;
 
-typedef struct uvedgeWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwUVEdgeWalker {
+       BMwGenericWalker header;
        BMLoop *l;
-} uvedgeWalker;
+} BMwUVEdgeWalker;
 
-typedef struct connectedVertexWalker {
-       bmesh_walkerGeneric header;
+typedef struct BMwConnectedVertexWalker {
+       BMwGenericWalker header;
        BMVert *curvert;
-} connectedVertexWalker;
+} BMwConnectedVertexWalker;
 
 #endif /* __BMESH_WALKERS_PRIVATE_H__ */
index 162992f7df88cb128a0888bd1f145f6c2fd47d62..9e07cb177ddbe3205174e6492fe45e6a6d80a1ad 100644 (file)
@@ -324,13 +324,11 @@ static int test_extra_verts(BMesh *bm, BMVert *v)
 }
 void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
 {
-       BMOpSlot *vinput;
        BMIter iter, fiter;
        BMVert *v;
        BMFace *f;
        /* int i; */
-       
-       vinput = BMO_slot_get(op, "verts");
+
        BMO_slot_buffer_flag_enable(bm, op, "verts", VERT_MARK, BM_VERT);
        
        for (v = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL); v; v = BM_iter_step(&iter)) {
@@ -468,14 +466,14 @@ void dummy_exec(BMesh *bm, BMOperator *op)
 #endif
 
 /**/
-typedef struct DissolveElemWeight_t {
+typedef struct DissolveElemWeight {
        BMHeader *ele;
        float weight;
-} DissolveElemWeight_t;
+} DissolveElemWeight;
 
 static int dissolve_elem_cmp(const void *a1, const void *a2)
 {
-       const struct DissolveElemWeight_t *d1 = a1, *d2 = a2;
+       const struct DissolveElemWeight *d1 = a1, *d2 = a2;
 
        if      (d1->weight > d2->weight) return  1;
        else if (d1->weight < d2->weight) return -1;
@@ -488,8 +486,8 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
        BMOpSlot *vinput = BMO_slot_get(op, "verts");
        const float angle_max = (float)M_PI / 2.0f;
        const float angle_limit = minf(angle_max, BMO_slot_float_get(op, "angle_limit"));
-       DissolveElemWeight_t *weight_elems = MEM_mallocN(MAX2(einput->len, vinput->len) *
-                                                        sizeof(DissolveElemWeight_t), __func__);
+       DissolveElemWeight *weight_elems = MEM_mallocN(MAX2(einput->len, vinput->len) *
+                                                        sizeof(DissolveElemWeight), __func__);
        int i, tot_found;
 
        /* --- first edges --- */
@@ -511,7 +509,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
        }
 
        if (tot_found != 0) {
-               qsort(weight_elems, einput->len, sizeof(DissolveElemWeight_t), dissolve_elem_cmp);
+               qsort(weight_elems, einput->len, sizeof(DissolveElemWeight), dissolve_elem_cmp);
 
                for (i = 0; i < tot_found; i++) {
                        BMEdge *e = (BMEdge *)weight_elems[i].ele;
@@ -546,7 +544,7 @@ void bmo_dissolve_limit_exec(BMesh *bm, BMOperator *op)
        }
 
        if (tot_found != 0) {
-               qsort(weight_elems, vinput->len, sizeof(DissolveElemWeight_t), dissolve_elem_cmp);
+               qsort(weight_elems, vinput->len, sizeof(DissolveElemWeight), dissolve_elem_cmp);
 
                for (i = 0; i < tot_found; i++) {
                        BMVert *v = (BMVert *)weight_elems[i].ele;
index 234749c97860e5bdde31c6ce341f95c4b5f3961d..494185be9d45b50505e21ee015e286bffbe27752 100644 (file)
@@ -94,7 +94,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v1, BMVert *v2, BMFace *
        return NULL;
 }
 /* calculates offset for co, based on fractal, sphere or smooth settings  */
-static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdparams *params, float perc,
+static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const SubDParams *params, float perc,
                      BMVert *vsta, BMVert *vend)
 {
        float tvec[3], prev_co[3], fac;
@@ -177,7 +177,7 @@ static void alter_co(BMesh *bm, BMVert *v, BMEdge *UNUSED(origed), const subdpar
 /* percent defines the interpolation, rad and flag are for special options */
 /* results in new vertex with correct coordinate, vertex normal and weight group info */
 static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge,
-                                         const subdparams *params, float percent,
+                                         const SubDParams *params, float percent,
                                          float percent2,
                                          BMEdge **out, BMVert *vsta, BMVert *vend)
 {
@@ -209,7 +209,7 @@ static BMVert *bm_subdivide_edge_addvert(BMesh *bm, BMEdge *edge, BMEdge *oedge,
 }
 
 static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge,
-                                int curpoint, int totpoint, const subdparams *params,
+                                int curpoint, int totpoint, const SubDParams *params,
                                 BMEdge **newe, BMVert *vsta, BMVert *vend)
 {
        BMVert *ev;
@@ -228,7 +228,7 @@ static BMVert *subdivideedgenum(BMesh *bm, BMEdge *edge, BMEdge *oedge,
        return ev;
 }
 
-static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *params,
+static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const SubDParams *params,
                                   BMVert *vsta, BMVert *vend)
 {
        BMEdge *eed = edge, *newe, temp = *edge;
@@ -271,7 +271,7 @@ static void bm_subdivide_multicut(BMesh *bm, BMEdge *edge, const subdparams *par
  *  v4---v0---v1
  */
 static void quad_1edge_split(BMesh *bm, BMFace *UNUSED(face),
-                             BMVert **verts, const subdparams *params)
+                             BMVert **verts, const SubDParams *params)
 {
        BMFace *nf;
        int i, add, numcuts = params->numcuts;
@@ -315,7 +315,7 @@ static SubDPattern quad_1edge = {
  *  v7-v0--v1-v2
  */
 static void quad_2edge_split_path(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                                  const subdparams *params)
+                                  const SubDParams *params)
 {
        BMFace *nf;
        int i, numcuts = params->numcuts;
@@ -341,7 +341,7 @@ static SubDPattern quad_2edge_path = {
  *  v7-v0--v1-v2
  */
 static void quad_2edge_split_innervert(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                                       const subdparams *params)
+                                       const SubDParams *params)
 {
        BMFace *nf;
        BMVert *v, *lastv;
@@ -382,7 +382,7 @@ static SubDPattern quad_2edge_innervert = {
  *
  */
 static void quad_2edge_split_fan(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                                 const subdparams *params)
+                                 const SubDParams *params)
 {
        BMFace *nf;
        /* BMVert *v; */               /* UNUSED */
@@ -413,7 +413,7 @@ static SubDPattern quad_2edge_fan = {
  *  v9-v0--v1-v2
  */
 static void quad_3edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                             const subdparams *params)
+                             const SubDParams *params)
 {
        BMFace *nf;
        int i, add = 0, numcuts = params->numcuts;
@@ -450,7 +450,7 @@ static SubDPattern quad_3edge = {
  *            it goes from bottom up
  */
 static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                                 const subdparams *params)
+                                 const SubDParams *params)
 {
        BMFace *nf;
        BMVert *v, *v1, *v2;
@@ -529,7 +529,7 @@ static void quad_4edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts
  *      s    s
  */
 static void tri_1edge_split(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                            const subdparams *params)
+                            const SubDParams *params)
 {
        BMFace *nf;
        int i, numcuts = params->numcuts;
@@ -555,7 +555,7 @@ static SubDPattern tri_1edge = {
  *      s    s
  */
 static void tri_3edge_subdivide(BMesh *bm, BMFace *UNUSED(face), BMVert **verts,
-                                const subdparams *params)
+                                const SubDParams *params)
 {
        BMFace *nf;
        BMEdge *e, *ne, temp;
@@ -659,18 +659,18 @@ static SubDPattern *patterns[] = {
 
 #define PLEN   (sizeof(patterns) / sizeof(void *))
 
-typedef struct subd_facedata {
+typedef struct SubDFaceData {
        BMVert *start; SubDPattern *pat;
        int totedgesel; //only used if pat was NULL, e.g. no pattern was found
        BMFace *face;
-} subd_facedata;
+} SubDFaceData;
 
 void bmo_esubd_exec(BMesh *bmesh, BMOperator *op)
 {
        BMOpSlot *einput;
        SubDPattern *pat;
-       subdparams params;
-       subd_facedata *facedata = NULL;
+       SubDParams params;
+       SubDFaceData *facedata = NULL;
        BMIter viter, fiter, liter;
        BMVert *v, **verts = NULL;
        BMEdge *edge, **edges = NULL;
@@ -1080,7 +1080,7 @@ void bmo_edgebisect_exec(BMesh *bm, BMOperator *op)
 {
        BMOIter siter;
        BMEdge *e;
-       subdparams params;
+       SubDParams params;
        int skey;
        
        params.numcuts = BMO_slot_get(op, "numcuts")->data.i;
index dd5198bdc303cb67a05e9c1536a38f74a7e725b3..24d621aed8ec039e9680f222038aa6ed02d7a2a4 100644 (file)
@@ -27,7 +27,7 @@
  *  \ingroup bmesh
  */
 
-typedef struct subdparams {
+typedef struct SubDParams {
        int numcuts;
        float smooth;
        float fractal;
@@ -36,10 +36,10 @@ typedef struct subdparams {
        int origkey; /* shapekey holding displaced vertex coordinates for current geometry */
        BMOperator *op;
        float off[3];
-} subdparams;
+} SubDParams;
 
 typedef void (*subd_pattern_fill_fp)(BMesh *bm, BMFace *face, BMVert **verts,
-                                     const subdparams *params);
+                                     const SubDParams *params);
 
 /*
  * note: this is a pattern-based edge subdivider.
index f00fa50f146517f4f6e33c992c88ff6bac28a502..b7418e428ed5248c190fb4c4ec60b83cfd418ac1 100644 (file)
@@ -494,7 +494,7 @@ static float ngon_fake_area(BMesh *bm, BMFace *f)
 /*
  * extra face data (computed data)
  */
-typedef struct tmp_face_ext {
+typedef struct SimSel_FaceExt {
        BMFace          *f;                     /* the face */
        float   c[3];                   /* center */
        union {
@@ -503,7 +503,7 @@ typedef struct tmp_face_ext {
                float   d;                      /* 4th component of plane (the first three being the normal) */
                struct Image    *t;     /* image pointer */
        };
-} tmp_face_ext;
+} SimSel_FaceExt;
 
 /*
  * Select similar faces, the choices are in the enum in source/blender/bmesh/bmesh_operators.h
@@ -516,7 +516,7 @@ void bmo_similarfaces_exec(BMesh *bm, BMOperator *op)
        BMOIter fs_iter;
        int num_sels = 0, num_total = 0, i = 0, idx = 0;
        float angle = 0.0f;
-       tmp_face_ext *f_ext = NULL;
+       SimSel_FaceExt *f_ext = NULL;
        int *indices = NULL;
        float t_no[3];  /* temporary normal */
        int type = BMO_slot_int_get(op, "type");
@@ -540,7 +540,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");
-       f_ext = (tmp_face_ext *)MEM_callocN(sizeof(tmp_face_ext) * num_total, "f_ext 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 */
        BM_ITER(fm, &fm_iter, bm, BM_FACES_OF_MESH, NULL) {
@@ -685,7 +685,7 @@ static float edge_angle(BMesh *bm, BMEdge *e)
 /*
  * extra edge information
  */
-typedef struct tmp_edge_ext {
+typedef struct SimSel_EdgeExt {
        BMEdge          *e;
        union {
                float           dir[3];
@@ -696,7 +696,7 @@ typedef struct tmp_edge_ext {
                float           length;                 /* edge length */
                int                     faces;                  /* faces count */
        };
-} tmp_edge_ext;
+} SimSel_EdgeExt;
 
 /*
  * select similar edges: the choices are in the enum in source/blender/bmesh/bmesh_operators.h
@@ -710,7 +710,7 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
        BMEdge  *e;             /* mesh edge */
        int idx = 0, i = 0 /* , f = 0 */;
        int *indices = NULL;
-       tmp_edge_ext *e_ext = NULL;
+       SimSel_EdgeExt *e_ext = NULL;
        // float *angles = NULL;
        float angle;
 
@@ -728,7 +728,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");
-       e_ext = (tmp_edge_ext *)MEM_callocN(sizeof(tmp_edge_ext) * num_total, "e_ext 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 */
        BM_ITER(e, &e_iter, bm, BM_EDGES_OF_MESH, NULL) {
@@ -858,13 +858,13 @@ void bmo_similaredges_exec(BMesh *bm, BMOperator *op)
 **************************************************************************** */
 #define VERT_MARK      1
 
-typedef struct tmp_vert_ext {
+typedef struct SimSel_VertExt {
        BMVert *v;
        union {
                int num_faces; /* adjacent faces */
                MDeformVert *dvert; /* deform vertex */
        };
-} tmp_vert_ext;
+} SimSel_VertExt;
 
 /*
  * select similar vertices: the choices are in the enum in source/blender/bmesh/bmesh_operators.h
@@ -876,7 +876,7 @@ void bmo_similarverts_exec(BMesh *bm, BMOperator *op)
        BMIter v_iter;          /* mesh verts iterator */
        BMVert *vs;             /* selected vertex */
        BMVert *v;                      /* mesh vertex */
-       tmp_vert_ext *v_ext = NULL;
+       SimSel_VertExt *v_ext = NULL;
        int *indices = NULL;
        int num_total = 0, num_sels = 0, i = 0, idx = 0;
        int type = BMO_slot_int_get(op, "type");
@@ -892,7 +892,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");
-       v_ext = (tmp_vert_ext *)MEM_mallocN(sizeof(tmp_vert_ext) * num_total, "vertex extra");
+       v_ext = (SimSel_VertExt *)MEM_mallocN(sizeof(SimSel_VertExt) * num_total, "vertex extra");
 
        /* loop through all the vertices and fill the vertices/indices structure */
        BM_ITER(v, &v_iter, bm, BM_VERTS_OF_MESH, NULL) {
@@ -1191,12 +1191,12 @@ void bmo_face_reversecolors_exec(BMesh *bm, BMOperator *op)
 ** shortest vertex path select
 **************************************************************************** */
 
-typedef struct element_node {
+typedef struct ElemNode {
        BMVert *v;      /* vertex */
        BMVert *parent; /* node parent id */
        float weight;   /* node weight */
        HeapNode *hn;   /* heap node */
-} element_node;
+} ElemNode;
 
 void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
 {
@@ -1206,7 +1206,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
        BMVert *v;              /* mesh vertex */
        Heap *h = NULL;
 
-       element_node *vert_list = NULL;
+       ElemNode *vert_list = NULL;
 
        int num_total = 0 /*, num_sels = 0 */, i = 0;
        int type = BMO_slot_int_get(op, "type");
@@ -1221,7 +1221,7 @@ void bmo_vertexshortestpath_exec(BMesh *bm, BMOperator *op)
        num_total = BM_mesh_elem_count(bm, BM_VERT);
 
        /* allocate memory for the nodes */
-       vert_list = (element_node *)MEM_mallocN(sizeof(element_node) * num_total, "vertex nodes");
+       vert_list = (ElemNode *)MEM_mallocN(sizeof(ElemNode) * num_total, "vertex nodes");
 
        /* iterate through all the mesh vertices */
        /* loop through all the vertices and fill the vertices/indices structure */