本文整理汇总了C++中HandList::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ HandList::isEmpty方法的具体用法?C++ HandList::isEmpty怎么用?C++ HandList::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandList
的用法示例。
在下文中一共展示了HandList::isEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandLogic
void QTVS_Leap::HandLogic()
{
//TODO: Fix this
if (hands.count() == 1)
{
int iHandToFingerShift = hand.isLeft() ? 5 : 0;
for (int iFingerCounter = iHandToFingerShift;
iFingerCounter <= iHandToFingerShift + 4;
iFingerCounter ++)
QCoreApplication::postEvent(fingerTraces.at(iFingerCounter), new QHideEvent());
iHandToFingerShift = hand.isLeft() ? 0 : 5;
if(ui.checkBox_ShowFingers->isChecked())
{
for (int iFingerCounter = iHandToFingerShift;
iFingerCounter <= iHandToFingerShift + 4;
iFingerCounter ++)
QCoreApplication::postEvent(fingerTraces.at(iFingerCounter), new QShowEvent());
}
}
else if (hands.isEmpty())
{
foreach (FingerTraceWindow * fTrace, fingerTraces)
QCoreApplication::postEvent(fTrace, new QHideEvent());
// QCoreApplication::postEvent(thumbTrace, new QHideEvent());
// QCoreApplication::postEvent(indexTrace, new QHideEvent());
// QCoreApplication::postEvent(middleTrace, new QHideEvent());
// QCoreApplication::postEvent(ringTrace, new QHideEvent());
// QCoreApplication::postEvent(pinkieTrace, new QHideEvent());
}
else
{
if(ui.checkBox_ShowFingers->isChecked())
{
foreach (FingerTraceWindow * fTrace, fingerTraces)
QCoreApplication::postEvent(fTrace, new QShowEvent());
}
// QCoreApplication::postEvent(thumbTrace, new QShowEvent());
// QCoreApplication::postEvent(indexTrace, new QShowEvent());
// QCoreApplication::postEvent(middleTrace, new QShowEvent());
// QCoreApplication::postEvent(ringTrace, new QShowEvent());
// QCoreApplication::postEvent(pinkieTrace, new QShowEvent());
}
for (HandList::const_iterator hl = hands.begin(); hl != hands.end(); ++hl) {
// Get the first hand
hand = *hl;
//TODO: Perhaps move this to gestures?
if (ui.checkBox_Crunch->isChecked())
{
if (hands.count() == 2)
{
// we check if one hand's dragging and the other's closed
if (hand.isLeft())
{
// if this hand is left, and the other hand (right) is dragging something..
if (debugWindowDrag_Right.left != -1)
{
debugDisplayString = QString::number(hand.grabStrength());
//pretty much closed
if (hand.grabStrength() >= 0.7)
{
SendMessage(debugWindowHWND_Right, WM_SYSCOMMAND, SC_CLOSE, 0);
// DestroyWindow();
}
}
}
else
{
// if this hand is left, and the other hand (right) is dragging something..
if (debugWindowDrag_Left.left != -1)
{
//pretty much closed
if (hand.grabStrength() >= 0.7)
{
// DestroyWindow(debugWindowHWND_Left);
SendMessage(debugWindowHWND_Left, WM_SYSCOMMAND, SC_CLOSE, 0);
}
}
}
}
}
// std::string handType = hand.isLeft() ? "Left hand" : "Right hand";
// std::cout << std::string(2, ' ') << handType << ", id: " << hand.id()
// << ", palm position: " << hand.palmPosition() << std::endl;
// Get the hand's normal vector and direction
const Vector normal = hand.palmNormal();
const Vector direction = hand.direction();
// Calculate the hand's pitch, roll, and yaw angles
// debugDisplayString = QString(", palm position: " + QString(hand.palmPosition().toString().data() ));
// debugDisplayString = QString::number(hand.palmPosition().x); //20
// debugDisplayString.append("\n");
//.........这里部分代码省略.........