[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10920] branches/ndof: first workable version on Os X

JLuc Peuriere jlp at nerim.net
Tue Jun 12 22:01:28 CEST 2007


Revision: 10920
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10920
Author:   lukep
Date:     2007-06-12 22:01:28 +0200 (Tue, 12 Jun 2007)

Log Message:
-----------
first workable version on Os X

work only in non camera mode in 3D view

need the external plug-in to be compiled separately

line 894 of ghostwinlay.c must be replaced with
values adapted at your system

see mailing list for features planned and how
to use

Modified Paths:
--------------
    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_EventNDOF.h
    branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp
    branches/ndof/intern/ghost/intern/GHOST_NDOFManager.h
    branches/ndof/intern/ghost/intern/GHOST_System.cpp
    branches/ndof/intern/ghost/intern/GHOST_System.h
    branches/ndof/intern/ghost/intern/GHOST_SystemCarbon.cpp
    branches/ndof/intern/ghost/intern/GHOST_SystemCarbon.h
    branches/ndof/source/blender/src/ghostwinlay.c
    branches/ndof/source/blender/src/space.c
    branches/ndof/source/blender/src/view.c

Modified: branches/ndof/intern/ghost/GHOST_C-api.h
===================================================================
--- branches/ndof/intern/ghost/GHOST_C-api.h	2007-06-12 15:23:40 UTC (rev 10919)
+++ branches/ndof/intern/ghost/GHOST_C-api.h	2007-06-12 20:01:28 UTC (rev 10920)
@@ -276,8 +276,11 @@
                            GHOST_WindowHandle windowhandle,
                           GHOST_NDOFLibraryInit_fp setNdofLibraryInit, 
                           GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
-                          GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen,
-                          GHOST_NDOFEventHandler_fp setNdofEventHandler);
+                          GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen
+                          );
+ 
+ // original patch only 
+ //                         GHOST_NDOFEventHandler_fp setNdofEventHandler);
 
 /***************************************************************************************
  ** Cursor management functionality

Modified: branches/ndof/intern/ghost/GHOST_ISystem.h
===================================================================
--- branches/ndof/intern/ghost/GHOST_ISystem.h	2007-06-12 15:23:40 UTC (rev 10919)
+++ branches/ndof/intern/ghost/GHOST_ISystem.h	2007-06-12 20:01:28 UTC (rev 10920)
@@ -305,8 +305,10 @@
    virtual void openNDOF(GHOST_IWindow*,
        GHOST_NDOFLibraryInit_fp setNdofLibraryInit, 
        GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
-       GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen,
-       GHOST_NDOFEventHandler_fp setNdofEventHandler) = 0;
+       GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen
+       // original patch only
+      // GHOST_NDOFEventHandler_fp setNdofEventHandler
+       ) = 0;
 
 
 	/***************************************************************************************

Modified: branches/ndof/intern/ghost/GHOST_Types.h
===================================================================
--- branches/ndof/intern/ghost/GHOST_Types.h	2007-06-12 15:23:40 UTC (rev 10919)
+++ branches/ndof/intern/ghost/GHOST_Types.h	2007-06-12 20:01:28 UTC (rev 10920)
@@ -338,19 +338,38 @@
 	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);
 
 /* original patch used floats, but the driver return ints and uns. We will calibrate in view, no sense on doing conversions twice */
+/* as all USB device controls are likely to use ints, this is also more future proof */
+//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 {
-   /** N-degree of freedom device data */
-   float tx, ty, tz;   /** -x left, +y up, +z forward */
-   float rx, ry, rz;
-   float dt;
+   /** N-degree of freedom device data v2*/
+   int changed;
+   GHOST_TUns64 client;
+   GHOST_TUns64 address;
+   GHOST_TInt16 tx, ty, tz;   /** -x left, +y up, +z forward */
+   GHOST_TInt16 rx, ry, rz;
+   GHOST_TInt16 buttons;
+   GHOST_TUns64 time;
+   GHOST_TUns64 delta;
 } GHOST_TEventNDOFData;
 
+typedef int     (*GHOST_NDOFLibraryInit_fp)();
+typedef void    (*GHOST_NDOFLibraryShutdown_fp)(void* deviceHandle);
+typedef void*   (*GHOST_NDOFDeviceOpen_fp)(void* platformData);
+
+// original patch windows callback. In mac os X version the callback is internal to the plug-in and post an event to main thead.
+// not necessary faster, but better integration with other events. 
+
+//typedef int     (*GHOST_NDOFEventHandler_fp)(float* result7, void* deviceHandle, unsigned int message, unsigned int* wParam, unsigned long* lParam);
+//typedef void     (*GHOST_NDOFCallBack_fp)(GHOST_TEventNDOFDataV2 *VolDatas);
+
 typedef struct {
 	/** The key code. */
 	GHOST_TKey		key;

Modified: branches/ndof/intern/ghost/intern/GHOST_C-api.cpp
===================================================================
--- branches/ndof/intern/ghost/intern/GHOST_C-api.cpp	2007-06-12 15:23:40 UTC (rev 10919)
+++ branches/ndof/intern/ghost/intern/GHOST_C-api.cpp	2007-06-12 20:01:28 UTC (rev 10920)
@@ -262,13 +262,16 @@
 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_NDOFDeviceOpen_fp setNdofDeviceOpen)
+  //original patch only
+  /*  GHOST_NDOFEventHandler_fp setNdofEventHandler)*/
 {
 	GHOST_ISystem* system = (GHOST_ISystem*) systemhandle;
 
     system->openNDOF((GHOST_IWindow*) windowhandle,
-        setNdofLibraryInit, setNdofLibraryShutdown, setNdofDeviceOpen, setNdofEventHandler);
+        setNdofLibraryInit, setNdofLibraryShutdown, setNdofDeviceOpen);
+//	original patch
+//        setNdofLibraryInit, setNdofLibraryShutdown, setNdofDeviceOpen, setNdofEventHandler);
 }
 
 

Modified: branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h
===================================================================
--- branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h	2007-06-12 15:23:40 UTC (rev 10919)
+++ branches/ndof/intern/ghost/intern/GHOST_EventNDOF.h	2007-06-12 20:01:28 UTC (rev 10920)
@@ -1,69 +1,57 @@
-/**
- * $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_
-
+/*
+ * ***** 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+ 
+
+#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_
+

Modified: branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp
===================================================================
--- branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp	2007-06-12 15:23:40 UTC (rev 10919)
+++ branches/ndof/intern/ghost/intern/GHOST_NDOFManager.cpp	2007-06-12 20:01:28 UTC (rev 10920)
@@ -1,21 +1,23 @@
-
-// 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.
-

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list