axisProjection can take care of zero-length vector so we don't need to check anymore...
authorMartin Poirier <theeth@yahoo.com>
Fri, 25 Mar 2005 03:28:08 +0000 (03:28 +0000)
committerMartin Poirier <theeth@yahoo.com>
Fri, 25 Mar 2005 03:28:08 +0000 (03:28 +0000)
Also removed all NEWTRANSFORM defines, using the new code all the time now.

source/blender/include/BIF_transform.h
source/blender/src/drawview.c
source/blender/src/editmesh_tools.c
source/blender/src/editview.c
source/blender/src/space.c
source/blender/src/transform_constraints.c

index 7f11bb218f36878ffa170f2c0110cc0a130bbdc6..6f1c0506e8e017a6d26c51d32ac693caa3e73807 100755 (executable)
@@ -33,8 +33,6 @@
 #ifndef BIF_TRANSFORM_H
 #define BIF_TRANSFORM_H
 
-#define NEWTRANSFORM   1
-
 /* ******************** Macros & Prototypes *********************** */
 
 /* MODE AND NUMINPUT FLAGS */
index 9bfab7af5fe8108bb12386853d9dd0183aba0b25..8bfbc1806256d90d18b59ed24020769fdb33f4cd 100644 (file)
@@ -1922,10 +1922,8 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
 
        if(G.moving) {
                constline_callback();
-#ifdef NEWTRANSFORM
                BIF_drawConstraint();
                if(G.obedit) BIF_drawPropCircle();      // only editmode has proportional edit
-#endif
        }
 
        /* duplis, draw as last to make sure the displists are ok */
index db3ef9e43f944f171675e2bd3fe2496d612a1e2b..422480b4de6efba3b15a018f117c4ec305960bdc 100644 (file)
@@ -559,7 +559,6 @@ void extrude_mesh(void)
                EM_fgon_flags();
                countall(); 
                
-#ifdef NEWTRANSFORM
                /* individual faces? */
                if(nr==2) {
                        Transform(TFM_SHRINKFATTEN);
@@ -572,9 +571,6 @@ void extrude_mesh(void)
                        }
                        Transform(TFM_TRANSLATION);
                }
-#else
-               transform('g');
-#endif
        }
 
 }
index 3fa2540ce0194d3843ed020b159a919658098fa8..2e5208c8ce312826add4306517df972312f42133 100644 (file)
@@ -708,13 +708,9 @@ int gesture(void)
                                else if(curarea->spacetype==SPACE_IMAGE) transform_tface_uv(i);
                                else if(curarea->spacetype==SPACE_OOPS) transform_oops('g');
                                else {
-#ifdef NEWTRANSFORM
                                        if(i=='g') Transform(TFM_TRANSLATION);
                                        else if(i=='r') Transform(TFM_ROTATION);
                                        else Transform(TFM_RESIZE);
-#else
-                                       transform(i);
-#endif
                                }
                        }
                }
index 6e65d9918f1dcd81c5e0a4af79f34faaa9cd1443..6d963870669cd0d9d646ffbddd7d8c6ef040361d 100644 (file)
@@ -1220,11 +1220,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                                clear_object('g');
                                        }
                                } else if((G.qual==0)) {
-#ifdef NEWTRANSFORM
                                        Transform(TFM_TRANSLATION);
-#else
-                                       transform('g');
-#endif
                                }
                                break;
                        case HKEY:
@@ -1426,11 +1422,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                ob= OBACT;
                                if (G.qual==LR_SHIFTKEY) {
                                        extern int prop_mode;
-#ifdef NEWTRANSFORM
                                        prop_mode = (prop_mode+1)%5;
-#else
-                                       prop_mode= !prop_mode;
-#endif
                                        allqueue(REDRAWHEADERS, 0);
                                }
                                else if((G.qual==0)) {
@@ -1486,50 +1478,28 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                                        loopoperations(LOOP_CUT);
                                        }
                                        else if((G.qual==0)) {
-#ifdef NEWTRANSFORM
                                                Transform(TFM_ROTATION);
-#else
-                                               transform('r');
-#endif
                                        }
                                }
                                else if((G.qual==0)) {
-#ifdef NEWTRANSFORM
                                        Transform(TFM_ROTATION);
-#else
-                                       transform('r');
-#endif
                                }
                                break;
                        case SKEY:
                                if(G.obedit) {
                                        if(G.qual==LR_ALTKEY)
-#ifdef NEWTRANSFORM
                                                Transform(TFM_SHRINKFATTEN);
-#else
-                                               transform('N'); /* scale along normal */
-#endif
                                        else if(G.qual==LR_CTRLKEY)
-#ifdef NEWTRANSFORM
                                                Transform(TFM_SHEAR);
                                        else if(G.qual==(LR_CTRLKEY|LR_ALTKEY))
                                                Transform(TFM_SHEAR);
-#else
-                                               transform('S');
-#endif
                                        else if(G.qual==LR_SHIFTKEY)
                                                snapmenu();
                                        else if(G.qual==0) {
-#ifdef NEWTRANSFORM
                                                Transform(TFM_RESIZE);
-#else
-                                               transform('s');
-#endif
                                        }
                                        else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)){
-#ifdef NEWTRANSFORM
                                                Transform(TFM_TOSPHERE);
-#endif
                                        }
                                        
                                }
@@ -1542,18 +1512,12 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        snapmenu();
                                }
                                else if((G.qual==0)) {
-#ifdef NEWTRANSFORM
                                        Transform(TFM_RESIZE);
-#else
-                                       transform('s');
-#endif
                                }
-#ifdef NEWTRANSFORM
                                else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY))
                                        Transform(TFM_TOSPHERE);
                                else if(G.qual==(LR_CTRLKEY|LR_ALTKEY))
                                        Transform(TFM_SHEAR);
-#endif
                                break;
                        case TKEY:
                                if(G.obedit){
@@ -1568,11 +1532,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                                        clear_tilt();
                                                }
                                                else if (G.qual==0) {
-#ifdef NEWTRANSFORM
                                                        Transform(TFM_TILT);
-#else
-                                                       transform('t');
-#endif
                                                }
                                        }
                                }
@@ -1638,11 +1598,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                break;
                        case WKEY:
                                if((G.qual==LR_SHIFTKEY)) {
-#ifdef NEWTRANSFORM
                                        Transform(TFM_WARP);
-#else
-                                       transform('w');
-#endif
                                }
                                else if(G.qual==LR_ALTKEY) {
                                        /* if(G.obedit && G.obedit->type==OB_MESH) write_videoscape(); */
index 97f8b86adb0458f60804e0b3bd89b792f7f34d86..dc99d6209a55d3b3fc4ea13fa40ef70b6cb9a29b 100755 (executable)
@@ -255,26 +255,25 @@ static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], flo
        VECCOPY(out, in);
        if (!td && t->con.mode & CON_APPLY) {
                Mat3MulVecfl(t->con.pmtx, out);
-               if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
-                       if (getConstraintSpaceDimension(t) == 2) {
+               if (getConstraintSpaceDimension(t) == 2) {
+                       if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
                                planeProjection(t, in, out);
                        }
-                       else if (getConstraintSpaceDimension(t) == 1) {
-                               float c[3];
+               }
+               else if (getConstraintSpaceDimension(t) == 1) {
+                       float c[3];
 
-                               if (t->con.mode & CON_AXIS0) {
-                                       VECCOPY(c, t->con.mtx[0]);
-                               }
-                               else if (t->con.mode & CON_AXIS1) {
-                                       VECCOPY(c, t->con.mtx[1]);
-                               }
-                               else if (t->con.mode & CON_AXIS2) {
-                                       VECCOPY(c, t->con.mtx[2]);
-                               }
-                               axisProjection(t, c, in, out);
+                       if (t->con.mode & CON_AXIS0) {
+                               VECCOPY(c, t->con.mtx[0]);
+                       }
+                       else if (t->con.mode & CON_AXIS1) {
+                               VECCOPY(c, t->con.mtx[1]);
+                       }
+                       else if (t->con.mode & CON_AXIS2) {
+                               VECCOPY(c, t->con.mtx[2]);
                        }
+                       axisProjection(t, c, in, out);
                }
-
                postConstraintChecks(t, out, pvec);
        }
 }
@@ -296,26 +295,25 @@ static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], f
        if (t->con.mode & CON_APPLY) {
                if (!td) {
                        Mat3MulVecfl(t->con.pmtx, out);
-                       if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
-                               if (getConstraintSpaceDimension(t) == 2) {
+                       if (getConstraintSpaceDimension(t) == 2) {
+                               if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) {
                                        planeProjection(t, in, out);
                                }
-                               else if (getConstraintSpaceDimension(t) == 1) {
-                                       float c[3];
-
-                                       if (t->con.mode & CON_AXIS0) {
-                                               VECCOPY(c, t->con.mtx[0]);
-                                       }
-                                       else if (t->con.mode & CON_AXIS1) {
-                                               VECCOPY(c, t->con.mtx[1]);
-                                       }
-                                       else if (t->con.mode & CON_AXIS2) {
-                                               VECCOPY(c, t->con.mtx[2]);
-                                       }
-                                       axisProjection(t, c, in, out);
-                               }
                        }
+                       else if (getConstraintSpaceDimension(t) == 1) {
+                               float c[3];
 
+                               if (t->con.mode & CON_AXIS0) {
+                                       VECCOPY(c, t->con.mtx[0]);
+                               }
+                               else if (t->con.mode & CON_AXIS1) {
+                                       VECCOPY(c, t->con.mtx[1]);
+                               }
+                               else if (t->con.mode & CON_AXIS2) {
+                                       VECCOPY(c, t->con.mtx[2]);
+                               }
+                               axisProjection(t, c, in, out);
+                       }
                        postConstraintChecks(t, out, pvec);
                        VECCOPY(out, pvec);
                }