您的位置:首页 > 其它

FingerList类(Leap:: FingerList)

2015-09-25 09:04 393 查看

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  leap-motion