vrpn 07.35
Virtual Reality Peripheral Network
 
Loading...
Searching...
No Matches
vrpn_3DMicroscribe.h
Go to the documentation of this file.
1#ifndef VRPN_3DMICROSCRIBE_H
2#define VRPN_3DMICROSCRIBE_H
3
4#include "vrpn_Button.h" // for vrpn_Button_Filter
5#include "vrpn_Configure.h" // for VRPN_API
6#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc
7#include "vrpn_Shared.h" // for timeval
8#include "vrpn_Tracker.h" // for vrpn_Tracker
9#include "vrpn_Types.h" // for vrpn_uint32
10
12 ,public vrpn_Button_Filter
13{
14 public:
15 // Offset is in meters. Scale is an abomination and should not be
16 // used. All tracker reports should be in meters in VRPN.
17 vrpn_3DMicroscribe (const char * name, vrpn_Connection * c,
18 const char * Port, long int BaudRate,
19 float OffsetX = 0.0f, float OffsetY = 0.0f, float OffsetZ = 0.0f,
20 float Scale=1.0f);
21
23
25 virtual void mainloop ();
26
27 virtual int reset(void);
28
29 protected:
30 float m_OffSet[3];
31 float m_Scale;
33 long int m_BaudRate;
34
35
37 unsigned char buf[512];
38 int bufpos;
39 struct timeval timestamp;
40
41 void ConvertOriToQuat(float ori[3]); //< directly put the values in the quat for message sending
42 virtual void clear_values(void);
43
46 virtual int get_report(void);
47
49 virtual void report_changes (vrpn_uint32 class_of_service
51
53 virtual void report (vrpn_uint32 class_of_service
55
56 // NOTE: class_of_service is only applied to vrpn_Tracker
57 // values, not vrpn_Button, which are always vrpn_RELIABLE
58};
59
60#endif
virtual void clear_values(void)
Set all buttons, analogs and encoders back to 0.
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report whether or not changed
int _numbuttons
How many buttons to open.
int m_PortNumber
port number
unsigned char buf[512]
Buffer of characters in report,.
long int m_BaudRate
baud rate
int bufpos
Current char pos in buffer.
void ConvertOriToQuat(float ori[3])
virtual int get_report(void)
Try to read reports from the device. Returns 1 if a complete report received, 0 otherwise....
struct timeval timestamp
Time of the last report from the device.
vrpn_3DMicroscribe(const char *name, vrpn_Connection *c, const char *Port, long int BaudRate, float OffsetX=0.0f, float OffsetY=0.0f, float OffsetZ=0.0f, float Scale=1.0f)
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
virtual void report_changes(void)
vrpn_Button_Filter(const char *, vrpn_Connection *c=NULL)
Generic connection class not specific to the transport mechanism.
vrpn_Tracker(const char *name, vrpn_Connection *c=NULL, const char *tracker_cfg_file_name=NULL)
#define VRPN_API
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY