[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10807] branches/ndof: adding the initial patch updated to 2.44 in ndof branch

JLuc Peuriere jlp at nerim.net
Tue May 29 06:34:10 CEST 2007


Revision: 10807
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10807
Author:   lukep
Date:     2007-05-29 06:34:09 +0200 (Tue, 29 May 2007)

Log Message:
-----------
adding the initial  patch updated to 2.44 in ndof branch

notes : 
it compiles but is non functional
lacks the platform specific changes in ghost ( i cant test windows)
lacks the code for plug-in.

the platform specific code will be added when we sync with Ettore work
the plug-in itself cannot be added here 

Modified Paths:
--------------
    branches/ndof/config/darwin-config.py
    branches/ndof/intern/ghost/GHOST_C-api.h
    branches/ndof/intern/ghost/GHOST_ISystem.h
    branches/ndof/intern/ghost/GHOST_Types.h
    branches/ndof/intern/ghost/intern/GHOST_C-api.cpp
    branches/ndof/intern/ghost/intern/GHOST_System.cpp
    branches/ndof/intern/ghost/intern/GHOST_System.h
    branches/ndof/source/blender/include/BSE_view.h
    branches/ndof/source/blender/include/mydevice.h
    branches/ndof/source/blender/makesdna/DNA_userdef_types.h
    branches/ndof/source/blender/src/editscreen.c
    branches/ndof/source/blender/src/ghostwinlay.c
    branches/ndof/source/blender/src/space.c
    branches/ndof/source/blender/src/transform.c
    branches/ndof/source/blender/src/usiblender.c
    branches/ndof/source/blender/src/view.c
    branches/ndof/source/blender/src/winlay.h

Added Paths:
-----------
    branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h
    branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp
    branches/ndof/intern/ghost/intern/GHOST_NDOFManager.h

Modified: branches/ndof/config/darwin-config.py
===================================================================
--- branches/ndof/config/darwin-config.py	2007-05-29 04:16:02 UTC (rev 10806)
+++ branches/ndof/config/darwin-config.py	2007-05-29 04:34:09 UTC (rev 10807)
@@ -1,4 +1,4 @@
-LCGDIR = '#../lib/darwin-6.1-powerpc'
+LCGDIR = '#../../trunk/lib/darwin-6.1-powerpc'
 LIBDIR = '${LCGDIR}'
 
 # enable ffmpeg  support
@@ -15,16 +15,17 @@
 BF_VERSE_LIBS = "libverse"
 
 # python.org libs install in /library 
-BF_PYTHON_VERSION = '2.3'
+BF_PYTHON_VERSION = '2.5'
 if BF_PYTHON_VERSION=='2.3':
 	BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/'
 else:
-	BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
+	BF_PYTHON = '/Library/Frameworks/Python.framework'
 
-BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}'
-BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
+BF_PYTHON_INC = '${BF_PYTHON}/Headers'
+BF_PYTHON_BINARY = '${BF_PYTHON}/python'
 BF_PYTHON_LIB = ''
-BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
+BF_PYTHON_LIBPATH = '${BF_PYTHON}/Versions/${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
+#BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
 BF_PYTHON_LINKFLAGS = '-u __dummy -u _PyMac_Error -framework System -framework Python'
 
 WITH_BF_OPENAL = 'true'
@@ -32,7 +33,7 @@
 # for gcc 3.3
 #BF_OPENAL = LIBDIR + '/openal'
 # for gcc 3.4
-BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
+BF_OPENAL = '#../../trunk/lib/darwin-8.0.0-powerpc/openal'
 
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal'
@@ -86,7 +87,7 @@
 BF_FTGL_LIB = 'extern_ftgl'
 
 WITH_BF_GAMEENGINE='true'
-WITH_BF_PLAYER='true'
+WITH_BF_PLAYER='false'
 
 WITH_BF_ODE = 'false'
 BF_ODE = LIBDIR + '/ode'

Modified: branches/ndof/intern/ghost/GHOST_C-api.h
===================================================================
--- branches/ndof/intern/ghost/GHOST_C-api.h	2007-05-29 04:16:02 UTC (rev 10806)
+++ branches/ndof/intern/ghost/GHOST_C-api.h	2007-05-29 04:34:09 UTC (rev 10807)
@@ -265,6 +265,19 @@
 											  GHOST_EventConsumerHandle consumerhandle);
 	
 
+/***************************************************************************************
+ ** N-degree of freedom device management functionality
+ ***************************************************************************************/
+ 
+/**
+* Open N-degree of freedom devices
+ */
+extern void GHOST_OpenNDOF(GHOST_SystemHandle systemhandle, 
+                           GHOST_WindowHandle windowhandle,
+                          GHOST_NDOFLibraryInit_fp setNdofLibraryInit, 
+                          GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
+                          GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen,
+                          GHOST_NDOFEventHandler_fp setNdofEventHandler);
 
 /***************************************************************************************
  ** Cursor management functionality

Modified: branches/ndof/intern/ghost/GHOST_ISystem.h
===================================================================
--- branches/ndof/intern/ghost/GHOST_ISystem.h	2007-05-29 04:16:02 UTC (rev 10806)
+++ branches/ndof/intern/ghost/GHOST_ISystem.h	2007-05-29 04:34:09 UTC (rev 10807)
@@ -295,6 +295,20 @@
 	 */
 	virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer* consumer) = 0;
 	
+	 /***************************************************************************************
+	 ** N-degree of freedom device management functionality
+	 ***************************************************************************************/
+
+   /**
+    * Starts the N-degree of freedom device manager
+    */
+   virtual void openNDOF(GHOST_IWindow*,
+       GHOST_NDOFLibraryInit_fp setNdofLibraryInit, 
+       GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
+       GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen,
+       GHOST_NDOFEventHandler_fp setNdofEventHandler) = 0;
+
+
 	/***************************************************************************************
 	 ** Cursor management functionality
 	 ***************************************************************************************/

Modified: branches/ndof/intern/ghost/GHOST_Types.h
===================================================================
--- branches/ndof/intern/ghost/GHOST_Types.h	2007-05-29 04:16:02 UTC (rev 10806)
+++ branches/ndof/intern/ghost/GHOST_Types.h	2007-05-29 04:34:09 UTC (rev 10807)
@@ -133,6 +133,8 @@
 	GHOST_kEventButtonUp,		/// Mouse button event
 	GHOST_kEventWheel,			/// Mouse wheel event
 
+	GHOST_kEventNDOFMotion, /// N degree of freedom device motion event
+
 	GHOST_kEventKeyDown,
 	GHOST_kEventKeyUp,
 //	GHOST_kEventKeyAuto,
@@ -336,7 +338,19 @@
 	GHOST_TInt32 z;	
 } GHOST_TEventWheelData;
 
+typedef int     (*GHOST_NDOFLibraryInit_fp)();
+typedef void    (*GHOST_NDOFLibraryShutdown_fp)(void* deviceHandle);
+typedef void*   (*GHOST_NDOFDeviceOpen_fp)(void* platformData);
+typedef int     (*GHOST_NDOFEventHandler_fp)(float* result7, void* deviceHandle, unsigned int message, unsigned int* wParam, unsigned long* lParam);
+
 typedef struct {
+   /** N-degree of freedom device data */
+   float tx, ty, tz;   /** -x left, +y up, +z forward */
+   float rx, ry, rz;
+   float dt;
+} GHOST_TEventNDOFData;
+
+typedef struct {
 	/** The key code. */
 	GHOST_TKey		key;
 	/** The ascii code for the key event ('\0' if none). */

Modified: branches/ndof/intern/ghost/intern/GHOST_C-api.cpp
===================================================================
--- branches/ndof/intern/ghost/intern/GHOST_C-api.cpp	2007-05-29 04:16:02 UTC (rev 10806)
+++ branches/ndof/intern/ghost/intern/GHOST_C-api.cpp	2007-05-29 04:34:09 UTC (rev 10807)
@@ -259,8 +259,20 @@
 	return system->addEventConsumer((GHOST_CallbackEventConsumer*)consumerhandle);
 }
 
+void GHOST_OpenNDOF(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle,
+   GHOST_NDOFLibraryInit_fp setNdofLibraryInit, 
+    GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
+    GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen,
+    GHOST_NDOFEventHandler_fp setNdofEventHandler)
+{
+	GHOST_ISystem* system = (GHOST_ISystem*) systemhandle;
 
+    system->openNDOF((GHOST_IWindow*) windowhandle,
+        setNdofLibraryInit, setNdofLibraryShutdown, setNdofDeviceOpen, setNdofEventHandler);
+}
 
+
+
 GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle)
 {
 	GHOST_IWindow* window = (GHOST_IWindow*) windowhandle;

Added: branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h
===================================================================
--- branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h	                        (rev 0)
+++ branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h	2007-05-29 04:34:09 UTC (rev 10807)
@@ -0,0 +1,69 @@
+/**
+ * $Id: GHOST_EventNdof.h,v 1.6 2002/12/28 22:26:45 maarten Exp $
+ * ***** BEGIN GPL/BL DUAL 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License.  See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+/**
+ * @file	GHOST_EventNdof.h
+ * Declaration of GHOST_EventNdof class.
+ */
+
+#ifndef _GHOST_EVENT_NDOF_H_
+#define _GHOST_EVENT_NDOF_H_
+
+#include "GHOST_Event.h"
+
+/**
+ * N-degree of freedom device event.
+ */
+class GHOST_EventNDOF : public GHOST_Event
+{
+public:
+	/**
+	 * Constructor.
+	 * @param msec		The time this event was generated.
+	 * @param type		The type of this event.
+	 * @param x			The x-coordinate of the location the cursor was at at the time of the event.
+	 * @param y			The y-coordinate of the location the cursor was at at the time of the event.
+	 */
+	GHOST_EventNDOF(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, 
+        GHOST_TEventNDOFData data)
+		: GHOST_Event(msec, type, window)
+	{
+		m_ndofEventData = data;
+		m_data = &m_ndofEventData;
+	}
+
+protected:
+	/** translation & rotation from the device. */
+	GHOST_TEventNDOFData m_ndofEventData;
+};
+
+
+#endif // _GHOST_EVENT_NDOF_H_
+

Added: branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp
===================================================================
--- branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp	                        (rev 0)
+++ branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp	2007-05-29 04:34:09 UTC (rev 10807)
@@ -0,0 +1,107 @@
+
+// Insert Blender compatible license here :-)
+
+// note: an implementation is currently only provided for Windows, but designed to be easy to move to Linux, etc.
+
+/**
+
+    To use this implemenation, you must specify the #define WITH_SPACEBALL for the ghost library.
+    Only this cpp file is affected by the macro, the header file and everything else are independent
+    of the spaceball libraries.
+
+    The 3dXWare SDK is available from the tab on the left side of -
+    http://www.3dconnexion.com/support/4a.php
+
+    The SDK is necessary to build this file with WITH_SPACEBALL defined.
+
+    For this stuff to work, siappdll.dll and spwini.dll must be in the executable path of blender
+
+ */
+
+
+#include "GHOST_NDOFManager.h"
+//#include "GHOST_WindowWin32.h"
+
+
+
+
+
+namespace
+{
+    GHOST_NDOFLibraryInit_fp ndofLibraryInit = 0;
+    GHOST_NDOFLibraryShutdown_fp ndofLibraryShutdown = 0;
+    GHOST_NDOFDeviceOpen_fp ndofDeviceOpen = 0;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list