Add BKE mesh function to update edge/poly hidden flags from verts.

This commit is contained in:
Nicholas Bishop 2012-03-14 06:31:14 +00:00
parent 38d4848020
commit 7f2acc173e
2 changed files with 34 additions and 0 deletions

@ -111,6 +111,13 @@ int poly_find_loop_from_vert(const struct MPoly *poly,
int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly,
const struct MLoop *mloop, unsigned vert);
/* update the hide flag for edges and polys from the corresponding
flag in verts */
void mesh_flush_hidden_from_verts(const struct MVert *mvert,
const struct MLoop *mloop,
struct MEdge *medge, int totedge,
struct MPoly *mpoly, int totpoly);
void unlink_mesh(struct Mesh *me);
void free_mesh(struct Mesh *me, int unlink);
struct Mesh *add_mesh(const char *name);

@ -2889,6 +2889,33 @@ int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly,
return corner;
}
/* update the hide flag for edges and faces from the corresponding
flag in verts */
void mesh_flush_hidden_from_verts(const MVert *mvert,
const MLoop *mloop,
MEdge *medge, int totedge,
MPoly *mpoly, int totpoly)
{
int i, j;
for(i = 0; i < totedge; i++) {
MEdge *e = &medge[i];
if(mvert[e->v1].flag & ME_HIDE ||
mvert[e->v2].flag & ME_HIDE)
e->flag |= ME_HIDE;
else
e->flag &= ~ME_HIDE;
}
for(i = 0; i < totpoly; i++) {
MPoly *p = &mpoly[i];
p->flag &= ~ME_HIDE;
for(j = 0; j < p->totloop; j++) {
if(mvert[mloop[p->loopstart + j].v].flag & ME_HIDE)
p->flag |= ME_HIDE;
}
}
}
/* basic vertex data functions */
int minmax_mesh(Mesh *me, float min[3], float max[3])
{