update bmesh design doc and added some comments to the code from it.

This commit is contained in:
Campbell Barton 2012-02-27 12:25:47 +00:00
parent 47c373c7a9
commit 21f1c99a78
3 changed files with 24 additions and 21 deletions

@ -30,7 +30,7 @@
/* bmesh data structures */
/* dissable holes for now, these are ifdef'd because they use more memory and cant be saved in DNA currently */
// define USE_BMESH_HOLES
#define USE_BMESH_HOLES
struct BMesh;
struct BMVert;
@ -95,7 +95,7 @@ typedef struct BMLoop {
/* notice no flags layer */
struct BMVert *v;
struct BMEdge *e;
struct BMEdge *e; /* edge, using verts (v, next->v) */
struct BMFace *f;
struct BMLoop *radial_next, *radial_prev;

@ -90,24 +90,26 @@ BM_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const shor
/* slot type arrays are terminated by the last member
* having a slot type of 0.*/
#define BMO_OP_SLOT_SENTINEL 0
#define BMO_OP_SLOT_BOOL 1
#define BMO_OP_SLOT_INT 2
#define BMO_OP_SLOT_FLT 3
#define BMO_OP_SLOT_PNT 4
#define BMO_OP_SLOT_MAT 5
#define BMO_OP_SLOT_VEC 8
enum {
BMO_OP_SLOT_SENTINEL = 0,
BMO_OP_SLOT_BOOL = 1,
BMO_OP_SLOT_INT = 2,
BMO_OP_SLOT_FLT = 3,
/* after BMO_OP_SLOT_VEC, everything is
/* normally store pointers to object, scene,
* _never_ store arrays corresponding to mesh elements with this */
BMO_OP_SLOT_PNT = 4,
BMO_OP_SLOT_MAT = 5,
BMO_OP_SLOT_VEC = 8,
* dynamically allocated arrays. we
* leave a space in the identifiers
* for future growth.
*/
//it's very important this remain a power of two
#define BMO_OP_SLOT_ELEMENT_BUF 9
#define BMO_OP_SLOT_MAPPING 10
#define BMO_OP_SLOT_TOTAL_TYPES 11
/* after BMO_OP_SLOT_VEC, everything is dynamically allocated arrays.
* We leave a space in the identifiers for future growth.
*
* it's very important this remain a power of two */
BMO_OP_SLOT_ELEMENT_BUF = 9, /* list of verts/edges/faces */
BMO_OP_SLOT_MAPPING = 10 /* simple hash map */
};
#define BMO_OP_SLOT_TOTAL_TYPES 11
/* please ignore all these structures, don't touch them in tool code, except
* for when your defining an operator with BMOpDefine.*/

@ -40,9 +40,9 @@ typedef enum {
/*Walkers*/
typedef struct BMWalker {
void (*begin) (struct BMWalker *walker, void *start);
void *(*step) (struct BMWalker *walker);
void *(*yield)(struct BMWalker *walker);
void (*begin) (struct BMWalker *walker, void *start);
void *(*step) (struct BMWalker *walker);
void *(*yield) (struct BMWalker *walker);
int structsize;
BMWOrder order;
int valid_mask;
@ -54,6 +54,7 @@ typedef struct BMWalker {
BLI_mempool *worklist;
ListBase states;
/* these masks are to be tested against elements BMO_elem_flag_test() */
short mask_vert;
short mask_edge;
short mask_loop;