diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-10-23 03:22:05 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-10-23 03:22:05 +0400 |
commit | 8f788c64db587e74079d812dbcea40c2bd4b91ff (patch) | |
tree | c767e8318a9e7aded16be6cab2042f3ea11e7912 /source/blender/editors/transform/transform.h | |
parent | 36bb566d4e6e06e08d782d610d60d755cbda2396 (diff) |
merge with trunk/2.5 at r23876
[[Split portion of a mixed commit.]]
Diffstat (limited to 'source/blender/editors/transform/transform.h')
-rw-r--r-- | source/blender/editors/transform/transform.h | 79 |
1 files changed, 55 insertions, 24 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index e5bd405c0cd..fc31fad622a 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -32,10 +32,13 @@ #include "ED_transform.h" +#include "BLI_editVert.h" + /* ************************** Types ***************************** */ struct TransInfo; struct TransData; +struct TransformOrientation; struct TransSnap; struct NumInput; struct Object; @@ -52,6 +55,7 @@ struct bContext; struct wmEvent; struct wmTimer; struct ARegion; +struct ReportList; typedef struct NDofInput { int flag; @@ -83,6 +87,7 @@ typedef struct TransSnap { short modeTarget; short mode; short align; + short project; short status; float snapPoint[3]; /* snapping from this point */ float snapTarget[3]; /* to this point */ @@ -118,20 +123,9 @@ typedef struct TransCon { /* Apply function pointer for rotation transformation */ } TransCon; -typedef struct TransDataIpokey { - int flag; /* which keys */ - float *locx, *locy, *locz; /* channel pointers */ - float *rotx, *roty, *rotz; - float *quatx, *quaty, *quatz, *quatw; - float *sizex, *sizey, *sizez; - float oldloc[9]; /* storage old values */ - float oldrot[9]; - float oldsize[9]; - float oldquat[12]; -} TransDataIpokey; - typedef struct TransDataExtension { float drot[3]; /* Initial object drot */ + float dquat[4]; /* Initial object dquat */ float dsize[3]; /* Initial object dsize */ float *rot; /* Rotation of the data to transform (Faculative) */ float irot[3]; /* Initial rotation */ @@ -179,6 +173,31 @@ typedef struct TransDataNla { int handle; /* handle-index: 0 for dummy entry, -1 for start, 1 for end, 2 for both ends */ } TransDataNla; +struct LinkNode; +struct EditEdge; +struct EditVert; +struct GHash; +typedef struct TransDataSlideUv { + float origuv[2]; + float *uv_up, *uv_down; + //float *fuv[4]; + struct LinkNode *fuv_list; +} TransDataSlideUv; + +typedef struct TransDataSlideVert { + struct EditEdge *up, *down; + struct EditVert origvert; +} TransDataSlideVert; + +typedef struct SlideData { + TransDataSlideUv *slideuv, *suv_last; + int totuv, uvlay_tot; + struct GHash *vhash, **uvhash; + struct EditVert *nearest; + struct LinkNode *edgelist, *vertlist; + short start[2], end[2]; +} SlideData; + typedef struct TransData { float dist; /* Distance needed to affect element (for Proportionnal Editing) */ float rdist; /* Distance to the nearest element (for Proportionnal Editing) */ @@ -194,12 +213,11 @@ typedef struct TransData { struct Object *ob; struct bConstraint *con; /* for objects/bones, the first constraint in its constraint stack */ TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */ - TransDataIpokey *tdi; /* for objects, ipo keys. per transdata a malloc */ TransDataCurveHandleFlags *hdata; /* for curves, stores handle flags for modification/cancel */ void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */ - short flag; /* Various flags */ + int flag; /* Various flags */ short protectflag; /* If set, copy of Object or PoseChannel protection */ - int rotOrder; /* rotation order (for eulers), as defined in BLI_arithb.h */ + int rotOrder; /* rotation mode, as defined in eRotationModes (DNA_action_types.h) */ } TransData; typedef struct MouseInput { @@ -210,6 +228,7 @@ typedef struct MouseInput { short precision_mval[2]; /* mouse position when precision key was pressed */ int center[2]; float factor; + void *data; /* additional data, if needed by the particular function */ } MouseInput; typedef struct TransInfo { @@ -263,12 +282,15 @@ typedef struct TransInfo { struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */ void *customData; /* Per Transform custom data */ + void (*customFree)(struct TransInfo *); /* if a special free function is needed */ /*************** NEW STUFF *********************/ short current_orientation; short prop_mode; + + short mirror; float values[4]; float auto_values[4]; @@ -378,6 +400,7 @@ typedef struct TransInfo { #define TD_NO_LOC (1 << 13) /* when this is set, don't apply translation changes to this element */ #define TD_NOTIMESNAP (1 << 14) /* for Graph Editor autosnap, indicates that point should not undergo autosnapping */ #define TD_INTVALUES (1 << 15) /* for Graph Editor - curves that can only have int-values need their keyframes tagged with this */ +#define TD_MIRROR_EDGE (1 << 16) /* For editmode mirror, clamp to x = 0 */ /* transsnap->status */ #define SNAP_ON 1 @@ -466,6 +489,9 @@ int BoneEnvelope(TransInfo *t, short mval[2]); void initBoneRoll(TransInfo *t); int BoneRoll(TransInfo *t, short mval[2]); +void initEdgeSlide(TransInfo *t); +int EdgeSlide(TransInfo *t, short mval[2]); + void initTimeTranslate(TransInfo *t); int TimeTranslate(TransInfo *t, short mval[2]); @@ -486,7 +512,7 @@ int Align(TransInfo *t, short mval[2]); void drawPropCircle(const struct bContext *C, TransInfo *t); -void transform_modal_keymap(struct wmWindowManager *wm); +void transform_modal_keymap(struct wmKeyConfig *keyconf); /*********************** transform_conversions.c ********** */ @@ -526,7 +552,7 @@ void drawConstraint(const struct bContext *C, TransInfo *t); void getConstraintMatrix(TransInfo *t); void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]); void setLocalConstraint(TransInfo *t, int mode, const char text[]); -void setUserConstraint(TransInfo *t, int mode, const char text[]); +void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]); void constraintNumInput(TransInfo *t, float vec[3]); @@ -556,6 +582,7 @@ void snapGrid(TransInfo *t, float *val); void snapGridAction(TransInfo *t, float *val, GearsType action); void initSnapping(struct TransInfo *t, struct wmOperator *op); +void applyProject(TransInfo *t); void applySnapping(TransInfo *t, float *vec); void resetSnapping(TransInfo *t); int handleSnapping(TransInfo *t, struct wmEvent *event); @@ -575,7 +602,8 @@ typedef enum { INPUT_HORIZONTAL_RATIO, INPUT_HORIZONTAL_ABSOLUTE, INPUT_VERTICAL_RATIO, - INPUT_VERTICAL_ABSOLUTE + INPUT_VERTICAL_ABSOLUTE, + INPUT_CUSTOM_RATIO } MouseInputMode; void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], short mval[2]); @@ -583,6 +611,8 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode); int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event); void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, short mval[2], float output[3]); +void setCustomPoints(TransInfo *t, MouseInput *mi, short start[2], short end[2]); + /*********************** Generics ********************************/ int initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, struct wmEvent *event); @@ -640,18 +670,17 @@ int handleNDofInput(NDofInput *n, struct wmEvent *event); void initTransformOrientation(struct bContext *C, TransInfo *t); -int manageObjectSpace(struct bContext *C, int confirm, int set); -int manageMeshSpace(struct bContext *C, int confirm, int set); -int manageBoneSpace(struct bContext *C, int confirm, int set); +struct TransformOrientation *createObjectSpace(struct bContext *C, struct ReportList *reports, char *name, int overwrite); +struct TransformOrientation *createMeshSpace(struct bContext *C, struct ReportList *reports, char *name, int overwrite); +struct TransformOrientation *createBoneSpace(struct bContext *C, struct ReportList *reports, char *name, int overwrite); /* Those two fill in mat and return non-zero on success */ int createSpaceNormal(float mat[3][3], float normal[3]); int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]); -int addMatrixSpace(struct bContext *C, float mat[3][3], char name[]); +struct TransformOrientation *addMatrixSpace(struct bContext *C, float mat[3][3], char name[], int overwrite); int addObjectSpace(struct bContext *C, struct Object *ob); -void applyTransformOrientation(const struct bContext *C, TransInfo *t); - +void applyTransformOrientation(const struct bContext *C, float mat[3][3], char *name); #define ORIENTATION_NONE 0 #define ORIENTATION_NORMAL 1 @@ -663,6 +692,8 @@ int getTransformOrientation(const struct bContext *C, float normal[3], float pla int createSpaceNormal(float mat[3][3], float normal[3]); int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]); +void freeSlideVerts(TransInfo *t); + #endif |