PointableList类(Leap:: PointableList)

PointableList类(Leap:: PointableList)

这个类代表了Pointable对象的列表。Pointable对象包括了可以指向的实体,比如手指和工具。通过调用Frame:: pointables()和Hand:: pointables()可以得到一个PointableList对象。
Leap::PointableList inFrame = frame.pointables();
Leap::PointableList onHand = hand.pointables();
PointableList & append(const PointableList & other): 表示把指定的一个PointableList的成员添加到这个PointableList对象中。参数other表示一个PointableList对象,其中包含Pointable对象,将要添加到这个PointableList对象末端。
PointableList & append(const FingerList & other): 表示把指定的一个FingerList的成员添加到这个PointableList对象中。参数other表示一个FingerList对象,其中包含Finger对象,将要添加到这个PointableList对象末端。
PointableList & append(const ToolList & other): 表示把指定的一个ToolList的成员添加到这个PointableList对象中。参数other表示一个ToolList对象,其中包含Tool对象,将要添加到这个PointableList对象末端。
const_iterator begin(): 表示C++的迭代器,设置在这个PointableList对象的开始。
用法:Leap::PointableList pointables = frame.pointables();
for (Leap::PointableList::const_iterator pl = pointables.begin(); pl != pointables.end(); pl++)
std::cout << *pl << std::endl;
int count(): 表示这个列表中有指向实体的数目。
用法:for (int p = 0; p < frame.pointables().count(); p++) {
std::cout << frame.pointables()[p] << std::endl;
}
const_iterator end(): 表示C++的迭代器,设置在这个PointableList对象的结束。
用法:Leap::PointableList pointables = frame.pointables();
for (Leap::PointableList::const_iterator pl = pointables.begin(); pl != pointables.end(); pl++)
std::cout << *pl << std::endl;
PointableList extended(): 表示一个新的列表,其中包含了当前列表中可以扩展的成员。这个包括所有的工具和isExtended()为真的手指。
Pointable frontmost(): 表示在Leap Motion参照系下这个列表中最靠前的成员(也就是z值最小)。
用法:Leap::Pointable furthestFront=frame. pointables().frontmost();
bool isEmpty(): 判断这个列表是否为空。如果没有成员,返回True。
Pointable leftmost(): 表示在Leap Motion参照系下这个列表中最靠左的成员(也就是x值最小)。
用法:Leap::Pointable leftmostInFrame=frame. pointables().leftmost();
Pointable operator[](int index): 表示对列表中一个成员位置的访问。返回的是指定索引下的Pointable对象。
用法:Leap::PointableList pointablesOfHand = hand.pointables();
for (int index = 0; index < pointablesOfHand.count(); index++) {
std::cout << pointablesOfHand[index] << std::endl;
}
PointableList(): 表示构造一个没有实体的空列表。
Pointable rightmost(): 表示在Leap Motion参照系下这个列表中最靠右的成员(也就是x值最大)。
用法:Leap::Pointable rightmostInFrame=frame. pointables().rightmost();

引自:https://developer.leapmotion.com/documentation/cpp/api/Leap.PointableList.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值