Space Navigator messaging loop blocks application

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
LKKOE
Posts: 3
Joined: Wed Mar 05, 2014 8:45 am

Space Navigator messaging loop blocks application

Post by LKKOE »

Hello Everyone,

i have a problem implementing the Spacemouse Navigator in a third party application. The Spacemouse should be used to control the position of light sources. Therefore I try to adapt a plugin for this software.
To implement the mouse in this plugin, i used the code in the documentation for win32. I created a window which receives data from the Spacemouse, initialized the mouse and started a messaging loop. The loop works but unfortunatly it seems to block my application, meaning, usually i can modify the position of the light sources in the code, but when the loop is on, this does not work anymore. Only after I close the "spacemouse" window, the received translation/rotation of the mouse is applied to the light source.
I wouldnt mind working without the window, for example, with HDI, but as i understood, this means the driver and its adjustments are not taken into account, which is less convenient for the user.
Does anyone have an idea, how to solve the problem?
I am developing a plugin .dll in c++ for Space Navigator using the latest version of the 3dxware SDK. The main apllication uses QT as GUI library.


Thanks everyone in advance, Kai
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space Navigator messaging loop blocks application

Post by jwick »

That sounds like a good use of a 3D mouse. You have to take into account the direction the user is looking to get the light sources to move consistently.

You may want to run that message loop in another thread. It sounds like you are blocking your main thread. Some applications do not allow plugins to run in the background. They are designed to halt the main thread, perform some task, then return. The main thread waits until the task is completed. That would be more challenging.

There are also ways of breaking into the QT message loop, so you can grab the events as they are sent to the application's window. This would be more likely to function all the time. You may have problems if the application doesn't like you moving the light sources behinds its back.

3DxWare 10 supports many different APIs.

What is the main program?
LKKOE
Posts: 3
Joined: Wed Mar 05, 2014 8:45 am

Re: Space Navigator messaging loop blocks application

Post by LKKOE »

Sorry for the late response, i didnt turn on notifications.

The main program is RTT DeltaGen 12.0. We use their official SDK. I dont know if you are familiar with DeltaGen. It is mainly used for automotive visualization. The 3dConnexion actually works already in the programm to control geometry and other objects but unfortunatly not light sources. I will try to put the message loop into a different thread. Never did that before, so it might take some time to figure out. I hope DeltaGen allows me to.

A way to use the QT message loop would be great, but is in this case the driver included? Do you have some sample code for using a QT message loop? I wouldnt know where to start.

Thanks for your help...
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space Navigator messaging loop blocks application

Post by jwick »

This topic refers to Qt.
Post Reply