void Chord::run(string file){ read(file); // Read Command from file // For each command, perform the repective function for(vector<Command>::iterator c = cmd.begin(); c != cmd.end(); c++){ if (c->command.compare("init") == 0) { init(c->peer); } if (c->command.compare("addpeer") == 0) { addPeer(c->peer); updateFinger(); } if (c->command.compare("insert") == 0) { insert(c->peer, c->message); } if (c->command.compare("print") == 0) { print(c->peer); } if (c->command.compare("delete") == 0) { Delete(c->peer, c->message); } if (c->command.compare("removepeer") == 0) { removePeer(c->peer); updateFinger(); } } }
void ManusOSVR::Tracker::updateHand(GLOVE_HAND hand, GLOVE_SKELETAL model) { int channelOffset = (hand == GLOVE_LEFT) ? 0 : ChannelsPerHand; int channel = ThumbMeta; OSVR_OrientationState os; Manus2OSVR(model.palm.orientation, os); osvrDeviceTrackerSendOrientation(mDeviceToken, mTrackerInterface, &os, Palm + channelOffset); updateFinger(hand, model.thumb, ThumbMeta + channelOffset); updateFinger(hand, model.index, IndexMeta + channelOffset); updateFinger(hand, model.middle, MiddleMeta + channelOffset); updateFinger(hand, model.ring, RingMeta + channelOffset); updateFinger(hand, model.pinky, PinkyMeta + channelOffset); }
void MultiTouchManager::handleFingerUp(const SDL_Event &event) { updateFinger(event, false); }
void MultiTouchManager::handleFingerDown(const SDL_Event &event) { updateFinger(event, true); const SDL_TouchFingerEvent &touch = event.tfinger; checkDevice(touch.touchId, touch.fingerId); }