ENABLE_3DCONNEXION_DEVICES - 1st installment of support for 3Dconnexion devices

Implemented using hidapi library (https://github.com/libusb/hidapi) and https://github.com/koenieee/CrossplatformSpacemouseDriver/tree/master/SpaceMouseDriver as reference

Unsolved issues:

- When manipulating the SpaceNavigator wxWidgets generates a mouse wheel event that needs to be filtered out

- wxWidgets does not detect devices being connected/disconnected to the pc

- Current state forces a continuous rendering

- Current state misses dependence on camera zoom

- Non intuitive movement limits

- Translation and rotation speed factors are hardcoded

- Number of device buttons hardcoded
This commit is contained in:
Enrico Turri 2019-09-27 14:52:19 +02:00
parent c1e3be9b27
commit f958cfd2ff
14 changed files with 3805 additions and 1 deletions

View file

@ -24,6 +24,9 @@
#include "PrintHostDialogs.hpp"
#include "wxExtensions.hpp"
#include "GUI_ObjectList.hpp"
#if ENABLE_3DCONNEXION_DEVICES
#include "Mouse3DController.hpp"
#endif // ENABLE_3DCONNEXION_DEVICES
#include "I18N.hpp"
#include <fstream>
@ -108,6 +111,10 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
}
if(m_plater) m_plater->stop_jobs();
#if ENABLE_3DCONNEXION_DEVICES
if (m_plater != nullptr)
m_plater->get_mouse3d_controller().set_canvas(nullptr);
#endif // ENABLE_3DCONNEXION_DEVICES
// Weird things happen as the Paint messages are floating around the windows being destructed.
// Avoid the Paint messages by hiding the main window.