Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

gadget::GloveProxy Class Reference

Glove proxy class. More...

#include <GloveProxy.h>

Inheritance diagram for gadget::GloveProxy:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 GloveProxy ()
 Constructs the proxy to point to the given glove device and sub-unit number. More...

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. More...

GlovegetGlovePtr ()
 Returns a pointer to the device held by this proxy. More...

int getUnit ()
 Returns the subUnit number that this proxy points to. More...

bool isVisible ()
bool config (jccl::ConfigElementPtr element)
 Configures the proxy. More...

virtual InputgetProxiedInputDevice ()
 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...


Detailed Description

Glove proxy class.

Definition at line 54 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 61 of file GloveProxy.h.

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

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

Definition at line 67 of file GloveProxy.h.

00068    {}


Member Function Documentation

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

Definition at line 70 of file GloveProxy.h.

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

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

Definition at line 78 of file GloveProxy.h.

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

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

Definition at line 86 of file GloveProxy.h.

00087    {
00088       if(isStupified())
00089          return gmtl::Matrix44f();
00090       else
00091          return mTypedDevice->getJointTransform(component, joint, mUnitNum);
00092    }

GloveData gadget::GloveProxy::getData   [inline]
 

Definition at line 94 of file GloveProxy.h.

00095    {
00096       if(isStupified())
00097          return GloveData();
00098       else
00099          return mTypedDevice->getGloveData(mUnitNum);
00100    }

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

Returns time of last update.

Implements gadget::Proxy.

Definition at line 103 of file GloveProxy.h.

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

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

Returns a pointer to the device held by this proxy.

Definition at line 111 of file GloveProxy.h.

00112    {
00113       if(isStupified())
00114          return NULL;
00115       else
00116          return mTypedDevice;
00117    }

int gadget::GloveProxy::getUnit   [inline]
 

Returns the subUnit number that this proxy points to.

Definition at line 120 of file GloveProxy.h.

00121    {
00122       return mUnitNum;
00123    }

bool gadget::GloveProxy::isVisible   [inline]
 

Definition at line 125 of file GloveProxy.h.

00126    {
00127       return mVisible;
00128    }

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 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 gadgetDBG_INPUT_MGR, getElementType, gadget::TypedProxy< Glove >::mDeviceName, and gadget::TypedProxy< Glove >::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 134 of file GloveProxy.h.

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


The documentation for this class was generated from the following files:
Generated on Sun May 2 14:27:00 2004 for Gadgeteer by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002