本文整理汇总了C++中Gesture::getGestureType方法的典型用法代码示例。如果您正苦于以下问题:C++ Gesture::getGestureType方法的具体用法?C++ Gesture::getGestureType怎么用?C++ Gesture::getGestureType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gesture
的用法示例。
在下文中一共展示了Gesture::getGestureType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GESTURE
//old gesture config
void KinectARTTransfUnit::GESTURE(const GestureEvent * event){
Gesture recGesture = event->getPayload();
std::cout << "gesture arrived with id: " << recGesture << std::endl;
if(recGesture.getGestureType() == Gesture::Wave){
std::cout << "wave !!" << std::endl;
m_dev = (m_dev+1)%3;
}
else if(recGesture.getGestureType() == Gesture::Click){
std::cout << "click !!" << std::endl;
if(m_dev == 2){
DigitalChangedEvent * dig_event = new DigitalChangedEvent();
if(clicked)
dig_event->setPayload(0);
else
dig_event->setPayload(1);
clicked = !clicked;
map<string, IEventSink *>::iterator iter = this->registeredEventSinkMap->find("Menu_OUT");
if (iter != this->registeredEventSinkMap->end()) {
(*iter).second->push(dig_event);
} else {
TFERROR("not found");
}
}
}
else if(recGesture.getGestureType() == Gesture::Grab){
std::cout << "grab it !!" << std::endl;
DigitalChangedEvent * dig_event = new DigitalChangedEvent();
dig_event->setPayload(1);
map<string, IEventSink *>::iterator iter;
if(m_dev == 0){
iter = this->registeredEventSinkMap->find("Draw_OUT");
if (iter != this->registeredEventSinkMap->end()) {
(*iter).second->push(dig_event);
} else {
TFERROR("not found");
}
}
else if (m_dev == 1){
iter = this->registeredEventSinkMap->find("Grab_OUT");
if (iter != this->registeredEventSinkMap->end()) {
(*iter).second->push(dig_event);
} else {
TFERROR("not found");
}
}
else{
AnalogChangedEvent * ana_event = new AnalogChangedEvent();
ana_event->setPayload(1.0f);
map<string, IEventSink *>::iterator iter = this->registeredEventSinkMap->find("DrawStroke_OUT");
if (iter != this->registeredEventSinkMap->end()) {
(*iter).second->push(ana_event);
} else {
TFERROR("not found");
}
}
}
else if(recGesture.getGestureType() == Gesture::NoMoreGrab){
std::cout << "no more grab !!" << std::endl;
DigitalChangedEvent * dig_event = new DigitalChangedEvent();
dig_event->setPayload(0);
map<string, IEventSink *>::iterator iter;
if(m_dev == 0){
iter = this->registeredEventSinkMap->find("Draw_OUT");
if (iter != this->registeredEventSinkMap->end()) {
(*iter).second->push(dig_event);
} else {
TFERROR("not found");
}
}
else if (m_dev == 1){
iter = this->registeredEventSinkMap->find("Grab_OUT");
if (iter != this->registeredEventSinkMap->end()) {
(*iter).second->push(dig_event);
} else {
TFERROR("not found");
}
}
else{
AnalogChangedEvent * ana_event = new AnalogChangedEvent();
ana_event->setPayload(0.0f);
//.........这里部分代码省略.........