diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-03-30 04:32:10 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-03-30 04:32:10 +0400 |
commit | cfd90889e2cf1eaf7f663d5f342d2039b1fab00c (patch) | |
tree | 34805856335963d9f72ba574b3cdf30ea6479185 /source/blender/blenkernel/BKE_DerivedMesh.h | |
parent | 340748fd5c4463c290f207f7539a7f96fad9c44d (diff) |
- made some DerivedMesh drawing functions more generic (take callback
to determine if element should be drawn and to set draw options),
which meant some could be combined - eases implementation of new
DerivedMesh types and keeps more app specific logic out of DerivedMesh
implementations.
Diffstat (limited to 'source/blender/blenkernel/BKE_DerivedMesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_DerivedMesh.h | 52 |
1 files changed, 15 insertions, 37 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 4fb8ae49052..386076d5c48 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -94,55 +94,33 @@ struct DerivedMesh { */ void (*drawFacesTex)(DerivedMesh *dm, int (*setDrawParams)(TFace *tf, int matnr)); - /* Draw single mapped vert as bgl point (no options) */ - void (*drawMappedVertEM)(DerivedMesh *dm, void *vert); - /* Draw mapped vertices as bgl points - * o Only if mapped EditVert->h==0 + * o Only if !setDrawOptions or setDrawOptions(userData, mapped-vert) returns true */ - void (*drawMappedVertsEM)(DerivedMesh *dm, int sel); + void (*drawMappedVertsEM)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, void *vert), void *userData); /* Draw single mapped edge as lines (no options) */ void (*drawMappedEdgeEM)(DerivedMesh *dm, void *edge); /* Draw mapped edges as lines - * o If useColor==0, don't set color - * o If useColor==1, set color based on mapped (EditEdge->f&SELECT) - * o If useColor==2, set color based on mapped (EditVert->f&SELECT) - * - Should interpolate as nicely as possible across edge. - * o If onlySeams, only draw if mapped (EditEdge->seam) - * o Only if mapped EditEdge->h==0 - */ - void (*drawMappedEdgesEM)(DerivedMesh *dm, int useColor, unsigned char *baseCol, unsigned char *selCol, int onlySeams); - - /* Draw all faces - * o If useColor, set color based on mapped (EditFace->f&SELECT) + * o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge) returns true */ - void (*drawFacesEM)(DerivedMesh *dm, int useColor, unsigned char *baseCol, unsigned char *selCol); + void (*drawMappedEdgesEM)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, void *edge), void *userData); - /* Draw mapped verts as bgl points - * o Call setColor(offset+index) for each vert, where index is the - * vert's index in the EditMesh. Return offset+count where count - * is the total number of mapped verts. - * o Only if mapped EditVert->h==0 + /* Draw mapped edges as lines with interpolation values + * o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge, mapped-v0, mapped-v1, t) returns true + * + * NOTE: This routine is optional! */ - int (*drawMappedVertsEMSelect)(DerivedMesh *dm, void (*setColor)(int index), int offset); + void (*drawMappedEdgesInterpEM)(DerivedMesh *dm, + int (*setDrawOptions)(void *userData, void *edge), + void (*setDrawInterpOptions)(void *userData, void *edge, float t), + void *userData); - /* Draw mapped edges as lines - * o Call setColor(offset+index) for each edge, where index is the - * edge's index in the EditMesh. Return offset+count where count - * is the total number of mapped edges. - * o Only if mapped EditEdge->h==0 - */ - int (*drawMappedEdgesEMSelect)(DerivedMesh *dm, void (*setColor)(int index), int offset); - - /* Draw mapped faces - * o Call setColor(offset+index) for each face, where index is the - * face's index in the EditMesh. Return offset+count where count - * is the total number of mapped faces. - * o Only if mapped EditFace->h==0 + /* Draw all faces + * o Only if !setDrawOptions or setDrawOptions(userData, mapped-face) returns true */ - int (*drawMappedFacesEMSelect)(DerivedMesh *dm, void (*setColor)(int index), int offset); + void (*drawMappedFacesEM)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, void *face), void *userData); void (*release)(DerivedMesh *dm); }; |