[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39156] trunk/blender/source/blender/ editors/transform: removed old ndof transform code, to be replaced with modern stuff in 2.6

Mike Erwin significant.bit at gmail.com
Sun Aug 7 19:01:44 CEST 2011


Revision: 39156
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39156
Author:   merwin
Date:     2011-08-07 17:01:44 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
removed old ndof transform code, to be replaced with modern stuff in 2.6

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/CMakeLists.txt
    trunk/blender/source/blender/editors/transform/transform.c
    trunk/blender/source/blender/editors/transform/transform.h
    trunk/blender/source/blender/editors/transform/transform_generics.c
    trunk/blender/source/blender/editors/transform/transform_ops.c

Removed Paths:
-------------
    trunk/blender/source/blender/editors/transform/transform_ndofinput.c

Modified: trunk/blender/source/blender/editors/transform/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/editors/transform/CMakeLists.txt	2011-08-07 16:54:40 UTC (rev 39155)
+++ trunk/blender/source/blender/editors/transform/CMakeLists.txt	2011-08-07 17:01:44 UTC (rev 39156)
@@ -41,7 +41,6 @@
 	transform_generics.c
 	transform_input.c
 	transform_manipulator.c
-	transform_ndofinput.c
 	transform_ops.c
 	transform_orientations.c
 	transform_snap.c

Modified: trunk/blender/source/blender/editors/transform/transform.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.c	2011-08-07 16:54:40 UTC (rev 39155)
+++ trunk/blender/source/blender/editors/transform/transform.c	2011-08-07 17:01:44 UTC (rev 39156)
@@ -1006,11 +1006,6 @@
 			else view_editmove(event->type);
 			t->redraw= 1;
 			break;
-#if 0
-		case NDOF_MOTION:
-			// should have been caught by tranform_modal
-			return OPERATOR_PASS_THROUGH;
-#endif
 		default:
 			handled = 0;
 			break;

Modified: trunk/blender/source/blender/editors/transform/transform.h
===================================================================
--- trunk/blender/source/blender/editors/transform/transform.h	2011-08-07 16:54:40 UTC (rev 39155)
+++ trunk/blender/source/blender/editors/transform/transform.h	2011-08-07 17:01:44 UTC (rev 39156)
@@ -67,14 +67,6 @@
 struct ARegion;
 struct ReportList;
 
-typedef struct NDofInput {
-	int		flag;
-	int		axis;
-	float	fval[7];
-	float	factor[3];
-} NDofInput;
-
-
 /*
 	The ctrl value has different meaning:
 		0			: No value has been typed
@@ -273,7 +265,6 @@
 	TransCon    con;            /* transformed constraint               */
 	TransSnap	tsnap;
 	NumInput    num;            /* numerical input                      */
-	NDofInput   ndof;           /* ndof input                           */
 	MouseInput	mouse;			/* mouse input                          */
 	char        redraw;         /* redraw flag                          */
 	float		prop_size;		/* proportional circle radius           */
@@ -340,9 +331,6 @@
 
 /* ******************** Macros & Prototypes *********************** */
 
-/* NDOFINPUT FLAGS */
-#define NDOF_INIT			1
-
 /* transinfo->state */
 #define TRANS_STARTING  0
 #define TRANS_RUNNING	1
@@ -683,20 +671,6 @@
 
 void getViewVector(TransInfo *t, float coord[3], float vec[3]);
 
-/*********************** NDofInput ********************************/
-
-void initNDofInput(NDofInput *n);
-int hasNDofInput(NDofInput *n);
-void applyNDofInput(NDofInput *n, float *vec);
-int handleNDofInput(NDofInput *n, struct wmEvent *event);
-
-/* handleNDofInput return values */
-#define NDOF_REFRESH	1
-#define NDOF_NOMOVE		2
-#define NDOF_CONFIRM	3
-#define NDOF_CANCEL		4
-
-
 /*********************** Transform Orientations ******************************/
 
 void initTransformOrientation(struct bContext *C, TransInfo *t);

Modified: trunk/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_generics.c	2011-08-07 16:54:40 UTC (rev 39155)
+++ trunk/blender/source/blender/editors/transform/transform_generics.c	2011-08-07 17:01:44 UTC (rev 39156)
@@ -1165,7 +1165,6 @@
 	
 	setTransformViewMatrices(t);
 	initNumInput(&t->num);
-	initNDofInput(&t->ndof);
 	
 	return 1;
 }

Deleted: trunk/blender/source/blender/editors/transform/transform_ndofinput.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_ndofinput.c	2011-08-07 16:54:40 UTC (rev 39155)
+++ trunk/blender/source/blender/editors/transform/transform_ndofinput.c	2011-08-07 17:01:44 UTC (rev 39156)
@@ -1,162 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Martin Poirier
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/editors/transform/transform_ndofinput.c
- *  \ingroup edtransform
- */
-
- 
- #include <math.h>			/* fabs */
-#include <stdio.h>			/* for sprintf		*/
-
-#include "BLI_utildefines.h"
-
-#include "BKE_global.h"		/* for G			*/
-	/* ABS */
-
-#include "WM_types.h"
-
-#include "transform.h"
-
-#if 0
-static int updateNDofMotion(NDofInput *n); // return 0 when motion is null
-#endif
-static void resetNDofInput(NDofInput *n);
-
-void initNDofInput(NDofInput *n)
-{
-	int i;
-
-	n->flag = 0;
-	n->axis = 0;
-	
-	resetNDofInput(n);
-	
-	for(i = 0; i < 3; i++)
-	{
-		n->factor[i] = 1.0f;
-	}
-}
-
-static void resetNDofInput(NDofInput *n)
-{	
-	int i;
-	for(i = 0; i < 6; i++)
-	{
-		n->fval[i] = 0.0f;
-	}
-}
-
- 
-int handleNDofInput(NDofInput *UNUSED(n), wmEvent *UNUSED(event))
-{
-	int retval = 0;
-	// TRANSFORM_FIX_ME
-#if 0
-	switch(event)
-	{
-		case NDOFMOTION:
-			if (updateNDofMotion(n) == 0)
-			{
-				retval = NDOF_NOMOVE;
-			}
-			else
-			{
-				retval = NDOF_REFRESH;
-			}
-			break;
-		case NDOFBUTTON:
-			if (val == 1) 
-			{
-				retval = NDOF_CONFIRM;
-			}
-			else if (val == 2) 
-			{
-				retval = NDOF_CANCEL;
-				resetNDofInput(n);
-				n->flag &= ~NDOF_INIT;
-			}
-			break;
-	}
-#endif 	
-	return retval;
-}
-
-int hasNDofInput(NDofInput *n)
-{
-	return (n->flag & NDOF_INIT) == NDOF_INIT;
-}
-
-void applyNDofInput(NDofInput *n, float *vec)
-{
-	if (hasNDofInput(n))
-	{
-		int i, j;
-		
-		for (i = 0, j = 0; i < 6; i++)
-		{
-			if (n->axis & (1 << i))
-			{
-				vec[j] = n->fval[i] * n->factor[j];
-				j++;
-			}
-		}
-	}
-}
-
-// TRANSFORM_FIX_ME
-#if 0
-
-static int updateNDofMotion(NDofInput *n)
-{
-	float fval[7];
-	int i;
-	int retval = 0;
-
-	getndof(fval);
-
-	if (G.vd->ndoffilter)
-		filterNDOFvalues(fval);
-
-	for(i = 0; i < 6; i++)
-	{
-		if (!retval && fval[i] != 0.0f)
-		{
-			retval = 1;
-		}
-		
-		n->fval[i] += fval[i] / 1024.0f;
-	}
-	
-	n->flag |= NDOF_INIT;
-	
-	return retval;
-}
-#endif
-
-
-
-

Modified: trunk/blender/source/blender/editors/transform/transform_ops.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_ops.c	2011-08-07 16:54:40 UTC (rev 39155)
+++ trunk/blender/source/blender/editors/transform/transform_ops.c	2011-08-07 17:01:44 UTC (rev 39156)
@@ -360,17 +360,14 @@
 
 	TransInfo *t = op->customdata;
 
-	#if 0
+#if 0
 	// stable 2D mouse coords map to different 3D coords while the 3D mouse is active
 	// in other words, 2D deltas are no longer good enough!
 	// disable until individual 'transformers' behave better
 
 	if (event->type == NDOF_MOTION)
-	{
-		/* puts("transform_modal: passing through NDOF_MOTION"); */
 		return OPERATOR_PASS_THROUGH;
-	}
-	#endif
+#endif
 
 	/* XXX insert keys are called here, and require context */
 	t->context= C;




More information about the Bf-blender-cvs mailing list