#include <GestureProxy.h>
Inheritance diagram for gadget::GestureProxy:


Public Methods | |
| GestureProxy () | |
| Constructs the proxy to point to the given gesture device. More... | |
| virtual | ~GestureProxy () |
| int | getGesture () |
| Gets the current gesture. More... | |
| int | getGestureIndex (std::string name) |
| Returns the identifier of the string gesture. More... | |
| std::string | getGestureString (int gestureId=-1) |
| Gets a gesture name. More... | |
| vpr::Interval | getTimeStamp () const |
| Returns time of last update. More... | |
| Gesture * | getGesturePtr () |
| Returns a pointer to the device held by this proxy. More... | |
| bool | config (jccl::ConfigElementPtr element) |
| Configures the proxy. More... | |
| virtual Input * | getProxiedInputDevice () |
| Returns a pointer to the base class of the devices being proxied. More... | |
Static Public Methods | |
| std::string | getElementType () |
| Returns the string rep of the element type used to config this device. More... | |
A proxy is used by the user to actually acces the gesture data. The proxy allows the user to query the current gesture information. Clients call the get* routines to get the current gesture (id or string) Once the client has the current gesture, they should test it against the gestures they want to respond to.
Definition at line 63 of file GestureProxy.h.
|
|
Constructs the proxy to point to the given gesture device.
Definition at line 67 of file GestureProxy.h.
00068 { ;}
|
|
|
Definition at line 70 of file GestureProxy.h.
00071 {}
|
|
|
Gets the current gesture.
Definition at line 77 of file GestureProxy.h.
00078 {
00079 const int defaultGesture(-1);
00080
00081 if(isStupified())
00082 return defaultGesture;
00083 else
00084 return mTypedDevice->getGesture();
00085 }
|
|
|
Returns the identifier of the string gesture.
Definition at line 92 of file GestureProxy.h.
00093 {
00094 const int defaultGestureIndex(-1);
00095 if(isStupified())
00096 return defaultGestureIndex;
00097 else
00098 return mTypedDevice->getGestureIndex(name);
00099 }
|
|
|
Gets a gesture name.
Definition at line 106 of file GestureProxy.h.
00107 {
00108 if(isStupified())
00109 return std::string("");
00110 else
00111 return mTypedDevice->getGestureString(gestureId);
00112 }
|
|
|
Returns time of last update.
Implements gadget::Proxy. Definition at line 115 of file GestureProxy.h.
00116 {
00117 // XXX: Broken for now, this is a case similar to the EventWindow type in that
00118 // it does not point to one data element like digital, analog, and position.
00119 return vpr::Interval();
00120 }
|
|
|
Returns a pointer to the device held by this proxy.
Definition at line 123 of file GestureProxy.h.
00124 {
00125 if(isStupified())
00126 return NULL;
00127 else
00128 return mTypedDevice;
00129 }
|
|
|
Returns the string rep of the element type used to config this device. Used by the Input Manager to find elements that construct devices. Reimplemented from gadget::Proxy. Definition at line 42 of file GestureProxy.cpp. Referenced by config.
00043 {
00044 return "gesture_proxy";
00045 }
|
|
|
Configures the proxy.
Reimplemented from gadget::Proxy. Definition at line 47 of file GestureProxy.cpp. References gadgetDBG_INPUT_MGR, getElementType, gadget::TypedProxy< Gesture >::mDeviceName, and gadget::TypedProxy< Gesture >::refresh.
00048 {
00049 vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
00050 std::string("------------------ GESTURE PROXY config() -----------------\n"),
00051 std::string("\n"));
00052
00053 vprASSERT(element->getID() == getElementType());
00054
00055 if ( ! Proxy::config(element) )
00056 {
00057 return false;
00058 }
00059
00060 mDeviceName = element->getProperty<std::string>("device");
00061
00062 refresh();
00063
00064 return true;
00065 }
|
|
|
Returns a pointer to the base class of the devices being proxied.
Implements gadget::Proxy. Definition at line 135 of file GestureProxy.h.
00136 {
00137 if((NULL == mTypedDevice) || (isStupified)())
00138 return NULL;
00139
00140 Input* ret_val = dynamic_cast<Input*>(mTypedDevice);
00141 vprASSERT((ret_val != NULL) && "Cross-cast in GestureProxy failed");
00142 return ret_val;
00143 }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002