vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
L3DMouse.h
Go to the documentation of this file.
1 /***************************************************************************
2  l3dmouse.h - description
3  -------------------
4  begin : Mon Jun 3 2002
5  copyright : (C) 2002 by Jan Flasar
6  email : flasar@fi.muni.cz
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef L3DMOUSE_H
19 #define L3DMOUSE_H
20 
21 #include "LHeadTracker.h"
22 
23 namespace vreckoDP_base {
24 
25 class DP_EXPORT L3DMouse : public LHeadTracker {
26  public:
27  L3DMouse();
28  L3DMouse(const char *port);
29  ~L3DMouse();
30 
31  virtual int openDevice(void);
32  int closeDevice(void);
33 
34  void update(void);
35 
36  bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
37  XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *saveXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
38 
39  bool getLButton(void) { return left_button;};
40  bool getMButton(void) { return middle_button;};
41  bool getRButton(void) { return right_button;};
42  bool getSButton(void) { return suspend_button;};
43 
44  protected:
45  bool left_button, middle_button, right_button, suspend_button, mouse_stand_button;
46 
47  int scanDevice(void);
48  int getRecData(long int *x, long int *y, long int *z, long int *pi, long int *ya, long int *ro, char *packet);
49 
50  char button[5];
51 
52  DECLARE_OUTPUT(Button_Left, vrecko::MessageBool);
53  DECLARE_OUTPUT(Button_Middle, vrecko::MessageBool);
54  DECLARE_OUTPUT(Button_Right, vrecko::MessageBool);
55  DECLARE_OUTPUT(Button_Suspend, vrecko::MessageBool);
56  DECLARE_OUTPUT(Button_Mouse_stand, vrecko::MessageBool);
57 };
58 
59 }
60 
61 #endif