demoved some extraneous members from BMHeader

This commit is contained in:
Joseph Eagar
2011-05-12 18:17:23 +00:00
parent 6dc8a64d3e
commit 0400b2e136
6 changed files with 9 additions and 57 deletions

View File

@@ -61,11 +61,9 @@ struct Object;
typedef struct BMHeader {
void *data; /*customdata layers*/
struct BMFlagLayer *flags;
int eid; /*element id*/
short type; /*element geometric type (verts/edges/loops/faces)*/
short flag; /*this would be a CD layer, see below*/
short eflag1, eflag2;
int sysflag, index; /*note: do *not* touch sysflag! and use BMINDEX_GET/SET macros for index*/
int index; /*note: use BMINDEX_GET/SET macros for index*/
} BMHeader;
/*note: need some way to specify custom locations for custom data layers. so we can

View File

@@ -93,7 +93,7 @@ void BM_SelectMode_Flush(BMesh *bm)
totsel = 0;
l=(BMLoop*) bm_firstfaceloop(f);
do{
if(bmesh_test_sysflag(&(l->e->head), BM_SELECT))
if(BM_TestHFlag(&(l->e->head), BM_SELECT))
totsel++;
l = ((BMLoop*)(l->next));
}while(l!=bm_firstfaceloop(f));

View File

@@ -62,45 +62,6 @@ void bmesh_error(void)
printf("BM modelling error!");
}
/*
* BMESH SET SYSFLAG
*
* Sets a bitflag for a given element.
*
*/
void bmesh_set_sysflag(BMHeader *head, int flag)
{
head->flag |= flag;
}
/*
* BMESH CLEAR SYSFLAG
*
* Clears a bitflag for a given element.
*
*/
void bmesh_clear_sysflag(BMHeader *head, int flag)
{
head->flag &= ~flag;
}
/*
* BMESH TEST SYSFLAG
*
* Tests whether a bitflag is set for a given element.
*
*/
int bmesh_test_sysflag(BMHeader *head, int flag)
{
if(head->flag & flag)
return 1;
return 0;
}
/*
* BMESH MAKE MESH
*

View File

@@ -535,8 +535,6 @@ static int bmesh_loop_reverse_loop(BMesh *bm, BMFace *f, BMLoopList *lst){
len = bmesh_loop_length(l);
for(i=0, curloop = l; i< len; i++, curloop= ((BMLoop*)(curloop->next)) ){
curloop->e->head.eflag1 = 0;
curloop->e->head.eflag2 = bmesh_radial_length(curloop);
bmesh_radial_remove_loop(curloop, curloop->e);
/*in case of border edges we HAVE to zero out curloop->radial Next/Prev*/
curloop->radial_next = curloop->radial_prev = NULL;

View File

@@ -663,14 +663,14 @@ static int goodline(float (*projectverts)[3], BMFace *f, int v1i,
//for (i=0; i<nvert; i++) {
do {
i = l->v->head.eflag2;
i = BMINDEX_GET(l->v);
if (i == v1i || i == v2i || i == v3i) {
l = (BMLoop*)l->next;
continue;
}
VECCOPY(pv1, projectverts[l->v->head.eflag2]);
VECCOPY(pv2, projectverts[((BMLoop*)l->next)->v->head.eflag2]);
VECCOPY(pv1, projectverts[BMINDEX_GET(l->v)]);
VECCOPY(pv2, projectverts[BMINDEX_GET(((BMLoop*)l->next)->v)]);
//if (linecrosses(pv1, pv2, v1, v3)) return 0;
if (point_in_triangle(v1, v2, v3, pv1)) return 0;
@@ -707,8 +707,8 @@ static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3],
if (BM_Edge_Exist(v1, v3)) isear = 0;
if (isear && !goodline(verts, f, v1->head.eflag2, v2->head.eflag2,
v3->head.eflag2, nvert))
if (isear && !goodline(verts, f, BMINDEX_GET(v1), BMINDEX_GET(v2),
BMINDEX_GET(v3), nvert))
isear = 0;
if(isear) {
@@ -759,7 +759,7 @@ void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3],
l = bm_firstfaceloop(f);
do{
VECCOPY(projectverts[i], l->v->co);
l->v->head.eflag2 = i; /*warning, abuse! never duplicate in tools code! never you hear?*/ /*actually, get rid of this completely, use a new structure for this....*/
BMINDEX_SET(l->v, i);
i++;
l = (BMLoop*)(l->next);
}while(l != bm_firstfaceloop(f));
@@ -860,7 +860,7 @@ void BM_LegalSplits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len)
i = 0;
l = BMIter_New(&iter, bm, BM_LOOPS_OF_FACE, f);
for (; l; l=BMIter_Step(&iter)) {
l->head.eflag2 = i;
BMINDEX_SET(l, i);
VECCOPY(projverts[i], l->v->co);
i++;
}

View File

@@ -63,11 +63,6 @@ void bmesh_selectmode_flush(struct BMesh *bm);
void *bmesh_get_filter_callback(int type);
int bmesh_get_filter_argtype(int type);
/*system flag access*/
void bmesh_set_sysflag(struct BMHeader *element, int flag);
void bmesh_clear_sysflag(struct BMHeader *element, int flag);
int bmesh_test_sysflag(struct BMHeader *element, int flag);
/*NOTE: ensure different parts of the API do not conflict
on using these internal flags!*/
#define _FLAG_JF 1 /*join faces*/