vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
VRPN3DMouse.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#include <
vrecko/IOPins.h
>
14
#include <
vrecko/Device.h
>
15
#include <
vrecko/EventDispatcher.h
>
16
18
#include <vrpn_Analog.h>
//for 6DOF analog sensor
19
#include <vrpn_Button.h>
//For buttons on the 3D mouse
20
21
namespace
vreckoDP_base {
22
23
const
std::string
virtualKey
[] =
24
{
25
"Menu"
,
"Fit"
,
"Top"
,
"Left"
,
"Right"
,
"Front"
,
"Bottom"
,
26
"Back"
,
"CW"
,
"CCW"
,
"ISO1"
,
"ISO2"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
27
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"Esc"
,
"Alt"
,
"Shift"
,
"Ctrl"
,
"Rotate"
,
28
"Panzoom"
,
"Dominant"
,
"Plus"
,
"Minus"
29
};
30
31
enum
virtualKeyCode
32
{
33
V3DK_MENU
=0,
V3DK_FIT
,
34
V3DK_TOP
,
V3DK_LEFT
,
V3DK_RIGHT
,
V3DK_FRONT
,
V3DK_BOTTOM
,
V3DK_BACK
,
35
V3DK_CW
,
V3DK_CCW
,
36
V3DK_ISO1
,
V3DK_ISO2
,
37
V3DK_1
,
V3DK_2
,
V3DK_3
,
V3DK_4
,
V3DK_5
,
V3DK_6
,
V3DK_7
,
V3DK_8
,
V3DK_9
,
V3DK_10
,
38
V3DK_ESC
,
V3DK_ALT
,
V3DK_SHIFT
,
V3DK_CTRL
,
39
V3DK_ROTATE
,
V3DK_PANZOOM
,
V3DK_DOMINANT
,
40
V3DK_PLUS
,
V3DK_MINUS
41
};
42
43
class
DP_EXPORT
VRPN3DMouse
:
public
vrecko::Device
44
{
45
public
:
46
VRPN3DMouse
();
48
virtual
int
openDevice(
void
);
49
int
closeDevice(
void
);
50
void
processEvent(
const
std::string &input_name,
void
*value);
51
void
update(
void
);
52
bool
loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode
*pParametersNode);
53
55
void
VRPN3DMouse::sendAnalogEvent(osg::Vec3 *p, osg::Vec3 *o);
56
void
VRPN3DMouse::sendButtonEvent(u_int key, u_int state);
57
58
protected
:
59
vrecko::EventDispatcher
*
pEventDispatcher
;
60
vrpn_Analog_Remote*
ana
;
61
vrpn_Button_Remote*
but
;
62
HANDLE
vrpnServerHandle
;
63
osg::Vec3
_originPos
, _curMove;
64
osg::Quat
_originRot
, _curRotate;
65
float
_speedFactor
;
66
float
_rotateRatio
;
67
68
bool
_speedControl
;
69
bool
_axisControl
;
70
bool
_rotateControl
;
71
73
static
void
VRPN_CALLBACK handle_analog(
void
*userdata, vrpn_ANALOGCB b);
74
static
void
VRPN_CALLBACK handle_button(
void
*userdata, vrpn_BUTTONCB b);
75
76
DECLARE_OUTPUT
(Button,
vrecko::MessageString
);
77
DECLARE_OUTPUT
(Position,
vrecko::MessageVec3
);
78
DECLARE_OUTPUT
(Move,
vrecko::MessageVec3
);
79
DECLARE_OUTPUT
(Rotation,
vrecko::MessageQuat
);
80
DECLARE_OUTPUT
(Orientation,
vrecko::MessageQuat
);
81
};
82
}
83
include
vreckoDP
base
VRPN3DMouse.h
Generated on Tue Feb 19 2013 10:23:45 for vrecko by
1.8.3.1