7 NOTE: do NOT modify topology while walking a mesh!
11 typedef struct BMWalker {
12 void (*begin) (struct BMWalker *walker, void *start);
13 void *(*step) (struct BMWalker *walker);
14 void *(*yield)(struct BMWalker *walker);
25 /*initialize a walker. searchmask restricts some (not all) walkers to
26 elements with a specific tool flag set. flags is specific to each walker.*/
27 void BMW_Init(struct BMWalker *walker, BMesh *bm, int type, int searchmask, int flags);
28 void *BMW_Begin(BMWalker *walker, void *start);
29 void *BMW_Step(struct BMWalker *walker);
30 void BMW_End(struct BMWalker *walker);
32 /*these are used by custom walkers*/
33 void BMW_pushstate(BMWalker *walker);
34 void BMW_popstate(BMWalker *walker);
35 void *BMW_walk(BMWalker *walker);
36 void BMW_reset(BMWalker *walker);
39 example of usage, walking over an island of tool flagged faces:
44 BMW_Init(&walker, bm, BMW_ISLAND, SOME_OP_FLAG);
45 f = BMW_Begin(&walker, some_start_face);
46 for (; f; f=BMW_Step(&walker)) {
53 /*walk over connected geometry. can restrict to a search flag,
54 or not, it's optional.
56 takes a vert as an arugment, and spits out edges, restrict flag acts
57 on the edges as well.*/
59 /*walk over an edge loop. search flag doesn't do anything.*/
63 /*#define BMW_RING 2*/
64 //walk over uv islands; takes a loop as input. restrict flag
65 //restricts the walking to loops whose vert has restrict flag set as a
68 //the flag parameter to BMW_Init maps to a loop customdata layer index.
70 /*walk over an island of flagged faces. note, that this doesn't work on
71 non-manifold geometry. it might be better to rewrite this to extract
72 boundary info from the island walker, rather then directly walking
73 over the boundary. raises an error if it encouters nonmanifold
76 /*walk over all faces in an island of tool flagged faces.*/
78 /*do not intitialze function pointers and struct size in BMW_Init*/