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:
authorMartin Poirier <theeth@yahoo.com>2006-10-26 03:57:00 +0400
committerMartin Poirier <theeth@yahoo.com>2006-10-26 03:57:00 +0400
commitf0dcd2db75b488be000a8be310e1c8a65e85227e (patch)
tree3b6d968aff79699a54b189412fd96e4679a02785 /source/blender/include/transform.h
parent2556254e925cb93a203a5801e36fd24d2e44c985 (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-xsource/blender/include/transform.h27
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);