diff options
author | Martin Poirier <theeth@yahoo.com> | 2006-10-26 03:57:00 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2006-10-26 03:57:00 +0400 |
commit | f0dcd2db75b488be000a8be310e1c8a65e85227e (patch) | |
tree | 3b6d968aff79699a54b189412fd96e4679a02785 /source/blender/include/transform.h | |
parent | 2556254e925cb93a203a5801e36fd24d2e44c985 (diff) |
== Transform ==
Embryon functionnality for snapping.
- Only snaps to grid on translations (grab)
- Transform constraints are supported but header display is wrong.
- Can be turned on/off in the Object/Mesh header menu under Transform Properties (tentative spot, will have to integrate better and in other object type menus too)
- Can be turned on/off during transform with ` (Back Quote, also tentative)
This is, of course, very much Work in Progress.
This implements part of the structural ideas for the transform cleanup I've been juggling around with.
Diffstat (limited to 'source/blender/include/transform.h')
-rwxr-xr-x | source/blender/include/transform.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/source/blender/include/transform.h b/source/blender/include/transform.h index ec55b768381..d91fe81d991 100755 --- a/source/blender/include/transform.h +++ b/source/blender/include/transform.h @@ -59,6 +59,13 @@ typedef struct NumInput { Negative : number is negative */ +typedef struct TransSnap { + int status; + float snapPoint[3]; + void (*applySnap)(struct TransInfo *, float *); + void (*calcSnap)(struct TransInfo *, float *); +} TransSnap; + typedef struct TransCon { char text[50]; /* Description of the Constraint for header_print */ float mtx[3][3]; /* Matrix of the Constraint space */ @@ -147,6 +154,7 @@ typedef struct TransInfo { TransDataExtension *ext; /* transformed data extension (array) */ TransData2D *data2d; /* transformed data for 2d (array) */ TransCon con; /* transformed constraint */ + TransSnap tsnap; NumInput num; /* numerical input */ char redraw; /* redraw flag */ float propsize; /* proportional circle radius */ @@ -331,6 +339,23 @@ void postSelectConstraint(TransInfo *t); void setNearestAxis(TransInfo *t); +/*********************** Snapping ********************************/ + +typedef enum { + NO_GEARS = 0, + BIG_GEARS = 1, + SMALL_GEARS = 2 +} GearsType; + +void snapGrid(TransInfo *t, float *val); +void snapGridAction(TransInfo *t, float *val, GearsType action); + +void initSnapping(struct TransInfo *t); +void applySnapping(TransInfo *t, float *vec); +void resetSnapping(TransInfo *t); +int handleSnapping(TransInfo *t, int event); +void drawSnapping(TransInfo *t); + /*********************** Generics ********************************/ void initTrans(TransInfo *t); @@ -356,8 +381,6 @@ void calculateCenterCursor(TransInfo *t); void calculatePropRatio(TransInfo *t); -void snapGrid(TransInfo *t, float *val); - void getViewVector(float coord[3], float vec[3]); TransInfo * BIF_GetTransInfo(void); |