vrpn  07.33
Virtual Reality Peripheral Network
vrpn_sgibox.h
Go to the documentation of this file.
1 #ifndef VRPN_SGIBOX
2 #define VRPN_SGIBOX
3 
4 #ifdef sgi
5 
6 #include "vrpn_Analog.h"
7 #include "vrpn_Button.h"
8 // Do we really need this here as everything is already
9 // surrounded by #ifdef sgi...???
10 #ifndef _WIN32
11 #include <netinet/in.h>
12 #include <sys/ioctl.h>
13 #endif
14 #ifndef MICROSCAPE_H
15 #include <gl/gl.h>
16 #include <gl/device.h>
17 #endif
18 
19 /* Number of buttons and number of dials on sgi button/dial boxes */
20 #define NUM_BUTTONS (32)
21 #define NUM_DIALS (8)
22 #define NUMDEVS (NUM_BUTTONS+NUM_DIALS)
23 
24 class VRPN_API vrpn_SGIBox :public vrpn_Analog, public vrpn_Button_Filter {
25 public:
26  vrpn_SGIBox(char * name, vrpn_Connection * c);
27  void mainloop();
28  void reset();
29 
30 
31 protected:
32  void get_report();
33 
34 
35 private:
36  double resetval[vrpn_CHANNEL_MAX];
37  long MAX_TIME_INTERVAL;
38 
39  unsigned long btstat; /* status of of on/off buttons */
40  unsigned long bs1, bs2; /* status of all buttons */
41  unsigned long *bpA, *bpB, *bpT; /* ptrs to above */
42  Device devs[NUMDEVS]; /* device array */
43  short vals1[NUMDEVS],
44  vals2[NUMDEVS]; /* two values arrays */
45  int dial_changed[NUM_DIALS];
46  int mid_values[NUM_DIALS];
47  int winid;
48  int sid;// server id;
49 };
50 
51 #endif // sgi
52 
53 #endif // VRPN_SGIBOX
54 
vrpn_Analog
Definition: vrpn_Analog.h:28
vrpn_CHANNEL_MAX
#define vrpn_CHANNEL_MAX
Definition: vrpn_Analog.h:16
vrpn_Button.h
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition: vrpn_Connection.h:510
MAX_TIME_INTERVAL
#define MAX_TIME_INTERVAL
Definition: vrpn_3DMicroscribe.C:29
vrpn_Analog.h
VRPN_API
#define VRPN_API
Definition: vrpn_Configure.h:646
vrpn_Button_Filter
All button servers should derive from this class, which provides the ability to turn any of the butto...
Definition: vrpn_Button.h:65