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


Public Types | |
| enum | finger { LTHUMB = 0, LINDEX = 1, LMIDDLE = 2, LRING = 3, LPINKY = 4, RTHUMB = 6, RINDEX = 7, RMIDDLE = 8, RRING = 9, RPINKY = 10 } |
| Gets the digital data for the given "finger". More... | |
Public Methods | |
| SimDigitalGlove () | |
| Default Constructor. More... | |
| virtual | ~SimDigitalGlove () |
| Destructor. More... | |
| virtual bool | config (jccl::ConfigElementPtr element) |
| Configures this device. More... | |
| virtual bool | startSampling () |
| virtual bool | stopSampling () |
| virtual bool | sample () |
| virtual void | updateData () |
| Updates the state of the digital data vector. More... | |
| void | operator delete (void *p) |
| Invokes the global scope delete operator. More... | |
Static Public Methods | |
| std::string | getElementType () |
Protected Methods | |
| virtual void | destroy () |
| Deletes this object. More... | |
It allows any number of simulated digital devices to be created.
When the key configured is held down, the digital device is on. When the key is released, the device is no longer set.
This class should not be used directly by the user.
Definition at line 59 of file SimDigitalGlove.h.
|
|
Gets the digital data for the given "finger". Returns digital 0 or 1, if "finger" makes sense. Returns -1 if function fails or if devNum is out of range. Use one of these indices to get the glove's digital data. EX: int result = mGlove.getDigitalData( SimDigitalGlove::LTHUMB );
Definition at line 85 of file SimDigitalGlove.h.
|
|
|
Default Constructor.
Definition at line 43 of file SimDigitalGlove.cpp.
00044 {
00045 //vprDEBUG(vprDBG_ALL, vprDBG_VERB_LVL)<<"*** SimDigitalGlove::SimDigitalGlove()\n"<< vprDEBUG_FLUSH;
00046 }
|
|
|
Destructor.
Definition at line 49 of file SimDigitalGlove.cpp.
00050 {
00051 // vprDEBUG(vprDBG_ALL, vprDBG_VERB_LVL)<<"*** SimDigitalGlove::~SimDigitalGlove()\n"<< vprDEBUG_FLUSH;
00052 }
|
|
|
Configures this device.
Reimplemented from gadget::Glove. Definition at line 59 of file SimDigitalGlove.cpp.
00060 {
00061 //vprDEBUG(vprDBG_ALL, vprDBG_VERB_LVL)<<"*** SimDigitalGlove::config\n"<< vprDEBUG_FLUSH;
00062 if (! (Input::config(element) && Digital::config(element) &&
00063 SimInput::config(element) && Glove::config(element)) )
00064 {
00065 return false;
00066 }
00067
00068 //mCurGesture = 0; // We are in no gesture yet
00069
00070 std::vector<jccl::ConfigElementPtr> key_list;
00071 int key_count = element->getNum("key_pair");
00072 for ( int i = 0; i < key_count; ++i )
00073 {
00074 key_list.push_back(element->getProperty<jccl::ConfigElementPtr>("key_pair", i));
00075 }
00076 mSimKeys = readKeyList( key_list );
00077
00078 return true;
00079 }
|
|
|
Definition at line 91 of file SimDigitalGlove.h.
00091 {return true;}
|
|
|
Definition at line 92 of file SimDigitalGlove.h.
00092 {return true;}
|
|
|
Definition at line 93 of file SimDigitalGlove.h.
00093 {return true;}
|
|
|
Updates the state of the digital data vector.
Definition at line 87 of file SimDigitalGlove.cpp. References gadget::Glove::addGloveSample, gadget::Glove::getGloveDataFromDigitalData, and gadget::Glove::swapGloveBuffers.
00088 {
00089 std::vector<DigitalData> digitalSample(10);
00090
00091 // -- Update digital data --- //
00092 for (unsigned int i = 0; i < mSimKeys.size(); i++)
00093 {
00094 if (checkKeyPair( mSimKeys[i] )) // If keys pressed
00095 digitalSample[i] = 1;
00096 else
00097 digitalSample[i] = 0;
00098 }
00099
00100 addDigitalSample(digitalSample);
00101 swapDigitalBuffers();
00102
00103 std::vector<GloveData> gloveSample=getGloveDataFromDigitalData(digitalSample);
00104 addGloveSample(gloveSample);
00105 swapGloveBuffers();
00106
00107 return;
00108 }
|
|
|
Definition at line 54 of file SimDigitalGlove.cpp.
00055 {
00056 return "simulated_digital_glove";
00057 }
|
|
|
Invokes the global scope delete operator. This is required for proper releasing of memory in DLLs on Win32. Definition at line 104 of file SimDigitalGlove.h.
00105 {
00106 ::operator delete(p);
00107 }
|
|
|
Deletes this object. This is an implementation of the pure virtual gadget::Input::destroy() method. Definition at line 114 of file SimDigitalGlove.h.
00115 {
00116 delete this;
00117 }
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002