您的位置:首页 > 其它

HandList类(Leap:: HandList)

2015-09-20 21:45 381 查看

HandList类(Leap:: HandList)

这个类代表了Hand对象的列表。通过调用Frame:: hands()可以得到一个HandList对象。

Leap:: HandList allHands = frame.hands();

HandList & append(const HandList & other): 表示把指定的一个HandList的成员添加到这个HandList对象中。参数other表示一个HandList对象,其中包含Hand对象,将要添加到这个HandList对象末端。

const_iterator begin(): 表示C++的迭代器,设置在这个HandList对象的开始。

用法:Leap:: HandList hands = frame.hands();

for (Leap:: HandList::const_iterator hl = hands.begin(); hl != hands.end(); hl++)

std::cout << *hl << std::endl;

int count(): 表示这个列表中手的数目。

const_iterator end(): 表示C++的迭代器,设置在这个HandList对象的结束。

用法:Leap:: HandList hands = frame.hands();

for (Leap:: HandList::const_iterator hl = hands.begin(); hl != hands.end(); hl++)

std::cout << *hl << std::endl;

Hand frontmost(): 表示在Leap Motion参照系下这个列表中最靠前的成员(也就是z值最小)。

用法:Leap::Hand FrontHand=frame. hands().frontmost();

HandList(): 表示构造一个没有实体的空列表。

bool isEmpty(): 判断这个列表是否为空。如果没有成员,返回True。

Hand leftmost(): 表示在Leap Motion参照系下这个列表中最靠左的成员(也就是x值最小)。

用法:Leap::Hand furthestleft=frame. hands().leftmost();

Hand operator[](int index): 表示对列表中一个成员位置的访问。返回的是指定索引下的Hand对象。

用法:Leap::Hand firstInList=frame.hands()[0];

Hand rightmost(): 表示在Leap Motion参照系下这个列表中最靠右的成员(也就是x值最大)。

用法:Leap::Hand furthestright=frame. hands().rightmost();

引自:https://developer.leapmotion.com/documentation/cpp/api/Leap.HandList.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: