FingerList类(Leap:: FingerList)

FingerList类(Leap:: FingerList)

这个类代表了Finger对象的列表。通过调用Frame:: fingers()可以得到一个FingerList对象。
Leap::FingerList allFingers = frame.fingers();
FingerList & append(const FingerList & other): 表示把指定的一个FingerList的成员添加到这个FingerList对象中。参数other表示一个FingerList对象,其中包含Finger对象,将要添加到这个FingerList对象末端。
const_iterator begin(): 表示C++的迭代器,设置在这个FingerList对象的开始。
用法:Leap::FingerList allTheFingers = frame.fingers();
for (Leap:: FingerList::const_iterator fl = allTheFingers.begin(); fl != allTheFingers.
end(); fl++)
std::cout << *fl << std::endl;
int count(): 表示这个列表中手指的数目。
const_iterator end(): 表示C++的迭代器,设置在这个FingerList对象的结束。
用法:Leap::FingerList allTheFingers = frame.fingers();
for (Leap:: FingerList::const_iterator fl = allTheFingers.begin(); fl != allTheFingers.
end(); fl++)
std::cout << *fl<< std::endl;
FingerList extended(): 表示一个新的列表,其中包含了当前列表中可以扩展的手指的成员。
FingerList(): 表示构造一个没有实体的空列表。
FingerList fingerType(Finger::Type type): 通过修改现存列表返回一个列表,其中包含当前列表中所给定的手指类型代表的手指。
用法:Leap::FingerList indexFingerList = hand.fingers().fingerType(Leap::Finger::TYPE_
INDEX);
Leap::Finger indexFinger = indexFingerList[0]; //since there is only one per hand
Finger frontmost(): 表示在Leap Motion参照系下这个列表中最靠前的成员(也就是z值最小)。
用法:Leap::Finger mostForwardFinger=frame..fingers().frontmost();
bool isEmpty(): 判断这个列表是否为空。如果没有成员,返回True。
Finger leftmost(): 表示在Leap Motion参照系下这个列表中最靠左的成员(也就是x值最小)。
用法:Leap::Finger fingerWithSmallestX=frame. fingers().leftmost();
Finger operator[](int index): 表示对列表中一个成员位置的访问。返回的是指定索引下的Finger对象。
用法:Leap::Finger firstFingerInList=frame.fingers()[0];
Finger rightmost(): 表示在Leap Motion参照系下这个列表中最靠右的成员(也就是x值最大)。
用法:Leap::Finger fingerWithLargestX =frame. fingers().rightmost();

译自:https://developer.leapmotion.com/documentation/cpp/api/Leap.FingerList.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值