Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2005-08-09 12:12:36 +0400
committerDaniel Dunbar <daniel@zuster.org>2005-08-09 12:12:36 +0400
commitc192b80b179ee32c0d39417e0737ac5d409b0db9 (patch)
treef833d5df1ec5b007849661573de4a1da4d8c38f4 /source/blender/blenkernel/BKE_DerivedMesh.h
parent932e958816c8d64214cd08232dac65ace55df3d9 (diff)
Big commit, had to rework lots of selection stuff so that things
worked properly with modifiers. Needs more testing I am sure. No, honestly, I wasn't just cleaning for the hell of it, it was *necessary* (I would never do such a thing). Selection should work completely with cage options of modifiers now. - added DerivedMesh foreach functions to iterate over mapped verts/edges/face centers. These replaced some of the drawing functions and are more general anyway. Special edge drawing functions remain for performance reasons. - removed EditFace xs, ys fields - added general functions to iterate over screen coordinates of mesh/curve/lattice objects - removed all calc_*verts* functions that were used for storing screen coordinates in objects. they were recalc'd on the fly for most situations anyway, so now we just always do that. calc_*verts_ext was one of those calls that did dirty things deep down in the callstack (changing curarea and poking at matrices) - rewrote all vertex level selection routines (circle, lasso, bbox) and closest vertex routines (rightmouse select) to use the new system. This cleaned up the selection code a lot and the structure of selection is much easier to see now. This is good for future work on allowing modifiers to completely override the selection system. It also points out some discrepancies in the way selection is handled that might be nice to resolve (mesh vertex selection has fancy stuff to try to help with selecting overlapping, but it only works w/o bbuf select, and curves/lattices don't have at all). - had to remove ton's code to move Manipulator to cage location, this is not reliable (can come up with a different method if requested) - as it happens BezTriple.s and BPoint.s are basically available to be removed, just need to rewrite editipo code that still does background calc of screen coordinates - MVert.{xs,ys} are still around because they are abused in some places for other info (not sure if this is safe actually, since they are short's and the mvert limit went up). And did I mention this commit is comes out to -305 lines? Well it does.
Diffstat (limited to 'source/blender/blenkernel/BKE_DerivedMesh.h')
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 1158f89dde0..f4302d12bf6 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -63,7 +63,24 @@ struct DerivedMesh {
/* Also called in Editmode */
int (*getNumFaces)(DerivedMesh *dm);
- void (*getMappedVertCoEM)(DerivedMesh *dm, void *vert, float co_r[3]);
+ /* Iterate over each mapped vertex in the derived mesh, calling the
+ * given function with the original vert and the mapped vert's new
+ * coordinate and normal. For historical reasons the normal can be
+ * passed as a float or short array, only one should be non-NULL.
+ */
+ void (*foreachMappedVertEM)(DerivedMesh *dm, void (*func)(void *userData, struct EditVert *vert, float *co, float *no_f, short *no_s), void *userData);
+
+ /* Iterate over each mapped vertex in the derived mesh, calling the
+ * given function with the original vert and the mapped edge's new
+ * coordinates.
+ */
+ void (*foreachMappedEdgeEM)(DerivedMesh *dm, void (*func)(void *userData, struct EditEdge *edge, float *v0co, float *v1co), void *userData);
+
+ /* Iterate over each mapped face in the derived mesh, calling the
+ * given function with the original face and the mapped face's (or
+ * faces') center and normal.
+ */
+ void (*foreachMappedFaceCenterEM)(DerivedMesh *dm, void (*func)(void *userData, struct EditFace *face, float *cent, float *no), void *userData);
/* Convert to new DispListMesh, should be free'd by caller.
*
@@ -144,11 +161,6 @@ struct DerivedMesh {
*/
void (*drawFacesTex)(DerivedMesh *dm, int (*setDrawParams)(TFace *tf, int matnr));
- /* Draw mapped vertices as bgl points
- * o Only if !setDrawOptions or setDrawOptions(userData, mapped-vert) returns true
- */
- void (*drawMappedVertsEM)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, struct EditVert *eve), void *userData);
-
/* Draw mapped edges as lines
* o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge) returns true
*/
@@ -169,21 +181,6 @@ struct DerivedMesh {
*/
void (*drawMappedFacesEM)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, struct EditFace *efa), void *userData);
- /* Draw vert normals
- * o Only if !setDrawOptions or setDrawOptions(userData, mapped-vert) returns true
- */
- void (*drawMappedVertNormalsEM)(DerivedMesh *dm, float length, int (*setDrawOptions)(void *userData, struct EditVert *eve), void *userData);
-
- /* Draw face normals
- * o Only if !setDrawOptions or setDrawOptions(userData, mapped-face) returns true
- */
- void (*drawMappedFaceNormalsEM)(DerivedMesh *dm, float length, int (*setDrawOptions)(void *userData, struct EditFace *efa), void *userData);
-
- /* Draw face centers as bgl points
- * o Only if !setDrawOptions or setDrawOptions(userData, mapped-face) returns true
- */
- void (*drawMappedFaceCentersEM)(DerivedMesh *dm, int (*setDrawOptions)(void *userData, struct EditFace *efa), void *userData);
-
void (*release)(DerivedMesh *dm);
};