diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-02 00:09:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-02 00:09:17 +0400 |
commit | 9aafe32147064a41aa653a95c89b50d9585ab3c1 (patch) | |
tree | 8d3f000b54f9adf3245548cb4586973ea5f3ec22 /source/blender/bmesh/bmesh_class.h | |
parent | d534f0e16dfdf3ed2a3360ad9f317a258cd8cc8e (diff) |
bmmesh api - use struct rather than int[4] to initialize mesh sizes.
also correct bad assert() in previous commit.
Diffstat (limited to 'source/blender/bmesh/bmesh_class.h')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index f071e00211c..1c7717ac5f0 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -47,6 +47,19 @@ struct Object; * * hrm. it doesnt but stull works ok, remove the comment above? - campbell. */ + +/** + * BMHeader + * + * All mesh elements begin with a BMHeader. This structure + * hold several types of data + * + * 1: The type of the element (vert, edge, loop or face) + * 2: Persistant "header" flags/markings (smooth, seam, select, hidden, ect) + * note that this is different from the "tool" flags. + * 3: Unique ID in the bmesh. + * 4: some elements for internal record keeping. + */ typedef struct BMHeader { void *data; /* customdata layers */ int index; /* notes: @@ -188,4 +201,37 @@ typedef struct BMesh { int opflag; /* current operator flag */ } BMesh; +/* BMHeader->htype (char) */ +enum { + BM_VERT = 1, + BM_EDGE = 2, + BM_LOOP = 4, + BM_FACE = 8 +}; + +#define BM_ALL (BM_VERT | BM_EDGE | BM_LOOP | BM_FACE) + +/* BMHeader->hflag (char) */ +enum { + BM_ELEM_SELECT = (1 << 0), + BM_ELEM_HIDDEN = (1 << 1), + BM_ELEM_SEAM = (1 << 2), + BM_ELEM_SMOOTH = (1 << 3), /* used for faces and edges, note from the user POV, + * this is a sharp edge when disabled */ + + BM_ELEM_TAG = (1 << 4), /* internal flag, used for ensuring correct normals + * during multires interpolation, and any other time + * when temp tagging is handy. + * always assume dirty & clear before use. */ + + /* we have 2 spare flags which is awesome but since we're limited to 8 + * only add new flags with care! - campbell */ + /* BM_ELEM_SPARE = (1 << 5), */ + /* BM_ELEM_SPARE = (1 << 6), */ + + BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging, + * since tools may want to tag verts and + * not have functions clobber them */ +}; + #endif /* __BMESH_CLASS_H__ */ |