gadget::GloveProxy Class Reference

Glove proxy class. More...

#include <gadget/Type/GloveProxy.h>

Inheritance diagram for gadget::GloveProxy:

Inheritance graph
[legend]
Collaboration diagram for gadget::GloveProxy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GloveProxy ()
 Constructs the proxy to point to the given glove device and sub-unit number.
virtual ~GloveProxy ()
gmtl::Vec3f getTipVector (GloveData::GloveComponent component)
gmtl::Matrix44f getTipTransform (GloveData::GloveComponent component)
gmtl::Matrix44f getJointTransform (GloveData::GloveComponent component, GloveData::GloveJoint joint)
GloveData getData ()
vpr::Interval getTimeStamp () const
 Returns time of last update.
GlovegetGlovePtr ()
 Returns a pointer to the device held by this proxy.
int getUnit ()
 Returns the subUnit number that this proxy points to.
bool isVisible ()
bool config (jccl::ConfigElementPtr element)
 Configures the proxy.
virtual InputgetProxiedInputDevice ()
 Returns a pointer to the base class of the devices being proxied.

Static Public Member Functions

static std::string getElementType ()
 Returns the string rep of the element type used to config this device.

Detailed Description

Glove proxy class.

Definition at line 55 of file GloveProxy.h.


Constructor & Destructor Documentation

gadget::GloveProxy::GloveProxy (  )  [inline]

Constructs the proxy to point to the given glove device and sub-unit number.

Definition at line 62 of file GloveProxy.h.

00063    {
00064       mUnitNum = -1;
00065       mVisible = true;
00066    }

virtual gadget::GloveProxy::~GloveProxy (  )  [inline, virtual]

Definition at line 68 of file GloveProxy.h.

00069    {}


Member Function Documentation

gmtl::Vec3f gadget::GloveProxy::getTipVector ( GloveData::GloveComponent  component  )  [inline]

Definition at line 71 of file GloveProxy.h.

00072    {
00073       if(isStupefied())
00074          return gmtl::Vec3f(0,0,0);
00075       else
00076          return mTypedDevice->getTipVector(component,mUnitNum);
00077    }

gmtl::Matrix44f gadget::GloveProxy::getTipTransform ( GloveData::GloveComponent  component  )  [inline]

Definition at line 79 of file GloveProxy.h.

00080    {
00081       if(isStupefied())
00082          return gmtl::Matrix44f();
00083       else
00084          return mTypedDevice->getTipTransform(component,mUnitNum);
00085    }

gmtl::Matrix44f gadget::GloveProxy::getJointTransform ( GloveData::GloveComponent  component,
GloveData::GloveJoint  joint 
) [inline]

Definition at line 87 of file GloveProxy.h.

00089    {
00090       if(isStupefied())
00091          return gmtl::Matrix44f();
00092       else
00093          return mTypedDevice->getJointTransform(component, joint, mUnitNum);
00094    }

GloveData gadget::GloveProxy::getData (  )  [inline]

Definition at line 96 of file GloveProxy.h.

00097    {
00098       if(isStupefied())
00099          return GloveData();
00100       else
00101          return mTypedDevice->getGloveData(mUnitNum);
00102    }

vpr::Interval gadget::GloveProxy::getTimeStamp (  )  const [inline, virtual]

Returns time of last update.

Implements gadget::Proxy.

Definition at line 105 of file GloveProxy.h.

00106    {
00107       // XXX: Broken for now, this is a case similar to the KeyboardMouse type in that
00108       //      it does not point to one data element like digital, analog, and position.
00109       return vpr::Interval();
00110    }

Glove* gadget::GloveProxy::getGlovePtr (  )  [inline]

Returns a pointer to the device held by this proxy.

Definition at line 113 of file GloveProxy.h.

00114    {
00115       if(isStupefied())
00116          return NULL;
00117       else
00118          return mTypedDevice;
00119    }

int gadget::GloveProxy::getUnit (  )  [inline]

Returns the subUnit number that this proxy points to.

Definition at line 122 of file GloveProxy.h.

00123    {
00124       return mUnitNum;
00125    }

bool gadget::GloveProxy::isVisible (  )  [inline]

Definition at line 127 of file GloveProxy.h.

00128    {
00129       return mVisible;
00130    }

std::string gadget::GloveProxy::getElementType (  )  [static]

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 GloveProxy.cpp.

Referenced by gadget::ProxyDepChecker::canHandle(), and config().

00043 {
00044    return "glove_proxy";
00045 }

bool gadget::GloveProxy::config ( jccl::ConfigElementPtr  element  )  [virtual]

Configures the proxy.

Postcondition:
Proxy is configured (it is not registered yet though).
Returns:
success.

Reimplemented from gadget::Proxy.

Definition at line 47 of file GloveProxy.cpp.

References gadget::Proxy::config(), gadgetDBG_INPUT_MGR(), getElementType(), gadget::TypedProxy< DEV_TYPE >::mDeviceName, and gadget::TypedProxy< DEV_TYPE >::refresh().

00048 {
00049 vpr::DebugOutputGuard dbg_output(gadgetDBG_INPUT_MGR, vprDBG_STATE_LVL,
00050       std::string("------------------ Glove PROXY config() -----------------\n"),
00051       std::string("\n"));
00052    vprASSERT(element->getID() == getElementType());
00053 
00054    if ( ! Proxy::config(element) )
00055    {
00056       return false;
00057    }
00058 
00059    mUnitNum = element->getProperty<int>("unit");
00060    mDeviceName = element->getProperty<std::string>("device");
00061 
00062    refresh();
00063 
00064    return true;
00065 }

virtual Input* gadget::GloveProxy::getProxiedInputDevice (  )  [inline, virtual]

Returns a pointer to the base class of the devices being proxied.

Returns:
NULL if no device is proxied.

Implements gadget::Proxy.

Definition at line 136 of file GloveProxy.h.

00137    {
00138       if((NULL == mTypedDevice) || (isStupefied()))
00139          return NULL;
00140 
00141       Input* ret_val = dynamic_cast<Input*>(mTypedDevice);
00142       vprASSERT((ret_val != NULL) && "Cross-cast in GloveProxy failed");
00143       return ret_val;
00144    }


The documentation for this class was generated from the following files:
Generated on Thu Jan 4 10:44:59 2007 for Gadgeteer by  doxygen 1.5.1