Blender V4.3
GHOST_NDOFManager.cc File Reference
#include "GHOST_NDOFManager.hh"
#include "GHOST_Debug.hh"
#include "GHOST_EventKey.hh"
#include "GHOST_EventNDOF.hh"
#include "GHOST_Types.h"
#include "GHOST_WindowManager.hh"
#include "GHOST_utildefines.hh"
#include "CLG_log.h"
#include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <cstring>
#include <map>

Go to the source code of this file.

Macros

#define HOME(foo)   (ndof->foo == 0.0f)
 
#define HOME(foo)   (fabsf(ndof->foo) < threshold)
 

Variables

NDOF Button Maps
static const GHOST_NDOF_ButtonT ndof_HID_map_Shared3Dx []
 
static const GHOST_NDOF_ButtonT ndof_HID_map_SpaceExplorer []
 
static const GHOST_NDOF_ButtonT ndof_HID_map_SpacePilot []
 
static const GHOST_NDOF_ButtonT ndof_HID_map_Generic []
 
NDOF Manager Class
static const int genericButtonCount = ARRAY_SIZE(ndof_HID_map_Generic)
 
NDOF Device Setup
static CLG_LogRef LOG_NDOF_DEVICE = {"ghost.ndof.device"}
 

NDOF Enum Strings

3Dconnexion keyboards and keypads use specific keys that have no standard equivalent. These could be supported as generic "custom" keys, see !124155 review for details.

#define MAP_ENTRY(button)
 
static const char * ndof_progress_string []
 
static const std::map< GHOST_NDOF_ButtonT, const char * > ndof_button_names
 
static const char * ndof_device_names []
 

NDOF Motion

#define LOG   (&LOG_NDOF_DEVICE)
 
#define LOG   (&LOG_NDOF_BUTTONS)
 
#define LOG   (&LOG_NDOF_MOTION)
 
static CLG_LogRef LOG_NDOF_MOTION = {"ghost.ndof.motion"}
 
static bool atHomePosition (const GHOST_TEventNDOFMotionData *ndof)
 
static bool nearHomePosition (const GHOST_TEventNDOFMotionData *ndof, float threshold)
 

NDOF Buttons

static CLG_LogRef LOG_NDOF_BUTTONS = {"ghost.ndof.buttons"}
 
static GHOST_TKey ghost_map_keyboard_from_ndof_buttom (const GHOST_NDOF_ButtonT button)
 

Macro Definition Documentation

◆ HOME [1/2]

#define HOME ( foo)    (ndof->foo == 0.0f)

Referenced by atHomePosition(), and nearHomePosition().

◆ HOME [2/2]

#define HOME ( foo)    (fabsf(ndof->foo) < threshold)

◆ LOG [1/3]

#define LOG   (&LOG_NDOF_DEVICE)

Definition at line 239 of file GHOST_NDOFManager.cc.

◆ LOG [2/3]

#define LOG   (&LOG_NDOF_BUTTONS)

Definition at line 239 of file GHOST_NDOFManager.cc.

◆ LOG [3/3]

#define LOG   (&LOG_NDOF_MOTION)

Definition at line 239 of file GHOST_NDOFManager.cc.

◆ MAP_ENTRY

#define MAP_ENTRY ( button)
Value:
{ \
GHOST_##button, #button \
}

Definition at line 43 of file GHOST_NDOFManager.cc.

Function Documentation

◆ atHomePosition()

static bool atHomePosition ( const GHOST_TEventNDOFMotionData * ndof)
static

Definition at line 645 of file GHOST_NDOFManager.cc.

References HOME.

Referenced by nearHomePosition().

◆ ghost_map_keyboard_from_ndof_buttom()

◆ nearHomePosition()

static bool nearHomePosition ( const GHOST_TEventNDOFMotionData * ndof,
float threshold )
static

Definition at line 652 of file GHOST_NDOFManager.cc.

References atHomePosition(), and HOME.

Referenced by GHOST_NDOFManager::sendMotionEvent().

Variable Documentation

◆ genericButtonCount

const int genericButtonCount = ARRAY_SIZE(ndof_HID_map_Generic)
static

Definition at line 209 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManager::setDevice().

◆ LOG_NDOF_BUTTONS

CLG_LogRef LOG_NDOF_BUTTONS = {"ghost.ndof.buttons"}
static

Definition at line 401 of file GHOST_NDOFManager.cc.

◆ LOG_NDOF_DEVICE

CLG_LogRef LOG_NDOF_DEVICE = {"ghost.ndof.device"}
static

Definition at line 238 of file GHOST_NDOFManager.cc.

◆ LOG_NDOF_MOTION

CLG_LogRef LOG_NDOF_MOTION = {"ghost.ndof.motion"}
static

Definition at line 630 of file GHOST_NDOFManager.cc.

◆ ndof_button_names

const std::map<GHOST_NDOF_ButtonT, const char *> ndof_button_names
static

Definition at line 47 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManager::updateButton().

◆ ndof_device_names

const char* ndof_device_names[]
static
Initial value:
= {
"UnknownDevice",
"SpaceNavigator",
"SpaceExplorer",
"SpacePilotPro",
"SpaceMousePro",
"SpaceMouseWireless",
"SpaceMouseProWireless",
"SpaceMouseEnterprise",
"SpacePilot",
"Spaceball5000",
"SpaceTraveler",
"Keyboard Pro",
"Numpad Pro",
}

Definition at line 118 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManager::setDevice().

◆ ndof_HID_map_Generic

const GHOST_NDOF_ButtonT ndof_HID_map_Generic[]
static
Initial value:

Definition at line 192 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManager::setDevice().

◆ ndof_HID_map_Shared3Dx

const GHOST_NDOF_ButtonT ndof_HID_map_Shared3Dx[]
static
Initial value:
= {
}
@ GHOST_NDOF_BUTTON_FRONT
@ GHOST_NDOF_BUTTON_CTRL
@ GHOST_NDOF_BUTTON_FIT
@ GHOST_NDOF_BUTTON_DOMINANT
@ GHOST_NDOF_BUTTON_RIGHT
@ GHOST_NDOF_BUTTON_MINUS
@ GHOST_NDOF_BUTTON_ISO1
@ GHOST_NDOF_BUTTON_PANZOOM
@ GHOST_NDOF_BUTTON_MENU
@ GHOST_NDOF_BUTTON_ROLL_CW
@ GHOST_NDOF_BUTTON_ROLL_CCW
@ GHOST_NDOF_BUTTON_BACK
@ GHOST_NDOF_BUTTON_ISO2
@ GHOST_NDOF_BUTTON_TOP
@ GHOST_NDOF_BUTTON_PLUS
@ GHOST_NDOF_BUTTON_10
@ GHOST_NDOF_BUTTON_ALT
@ GHOST_NDOF_BUTTON_ESC
@ GHOST_NDOF_BUTTON_BOTTOM
@ GHOST_NDOF_BUTTON_ROTATE
@ GHOST_NDOF_BUTTON_SHIFT
@ GHOST_NDOF_BUTTON_LEFT

Shared by the some 3Dconnexion hardware SpacePilotPro uses all of these SpaceMouse Pro and SpaceNavigator use only some, based on button mask.

Definition at line 145 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManager::setDevice().

◆ ndof_HID_map_SpaceExplorer

◆ ndof_HID_map_SpacePilot

◆ ndof_progress_string

const char* ndof_progress_string[]
static
Initial value:
= {
"not started",
"starting",
"in progress",
"finishing",
"finished",
}

Definition at line 34 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManager::sendMotionEvent().