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
相关文章推荐
- Finger类(Leap::Finger)
- Hand类(Leap::Hand)
- Arm类(Leap::Arm)
- PointableList类(Leap:: PointableList)
- Device类(Leap:: Device)和 DeviceList类(Leap:: DeviceList)
- Tool类(Leap::Tool)和ToolList类(Leap::ToolList)
- Bone类(Leap::Bone)
- KeyTapGesture类(Leap:: KeyTapGesture)
- Matrix结构体(Leap::Matrix)
- 服务器防护知识点汇总
- 小解const与指针
- Android实战简易教程<二>(Spinner下拉级联效果)
- test
- 第4周项目1-建立单链表
- Maven 项目中配置tomcat
- 一个程序员的自我修养
- *LeetCode-Gray Code
- OBPS开发平台——导入功能整体过程
- 专访支付宝首席架构师程立
- 解析Java的JVM以及类与对象的概念