9 #if !defined(__Leap_h__) 18 #if defined(_MSC_VER) && (_MSC_VER < 1600) 19 typedef __int32 int32_t;
20 typedef __int64 int64_t;
21 typedef unsigned __int32 uint32_t;
22 typedef unsigned __int64 uint64_t;
28 #if defined(_MSC_VER) // Visual C++ 31 #elif LEAP_API_IMPLEMENTATION 32 #define LEAP_EXPORT __declspec(dllexport) 34 #define LEAP_EXPORT __declspec(dllimport) 36 #define LEAP_EXPORT_CLASS 37 #define LEAP_EXPORT_PLUGIN __declspec(dllexport) 39 #define LEAP_EXPORT __attribute__((visibility("default"))) 40 #define LEAP_EXPORT_CLASS __attribute__((visibility("default"))) 41 #define LEAP_EXPORT_PLUGIN __attribute__((visibility("default"))) 44 #define LEAP_EXPORT_CLASS 45 #define LEAP_EXPORT_PLUGIN 60 Interface(
class SharedObject*
object);
61 LEAP_EXPORT Interface& operator=(
const Interface& rhs);
63 template<
typename T> T*
get()
const {
return static_cast<T*
>(reference()); }
65 LEAP_EXPORT static void deleteCString(
const char* cstr);
71 class PointableImplementation;
72 class BoneImplementation;
73 class FingerImplementation;
74 class ToolImplementation;
75 class HandImplementation;
76 class GestureImplementation;
77 class ScreenImplementation;
78 class DeviceImplementation;
79 class ImageImplementation;
80 class InteractionBoxImplementation;
81 class BugReportImplementation;
82 class FrameImplementation;
83 class ControllerImplementation;
84 class MaskImplementation;
85 class TrackedQuadImplementation;
157 ZONENONE = ZONE_NONE,
158 ZONEHOVERING = ZONE_HOVERING,
159 ZONETOUCHING = ZONE_TOUCHING,
456 const char* cstr = toCString();
457 std::string str(cstr);
473 Arm(HandImplementation*);
620 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Arm&);
631 const char* cstr = toCString();
632 std::string str(cstr);
674 TYPE_INTERMEDIATE = 2,
679 Bone(BoneImplementation*);
849 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Bone&);
860 const char* cstr = toCString();
861 std::string str(cstr);
919 Finger(FingerImplementation*);
992 const char* cstr = toCString();
993 std::string str(cstr);
1022 Tool(ToolImplementation*);
1067 const char* cstr = toCString();
1068 std::string str(cstr);
1069 deleteCString(cstr);
1099 Hand(HandImplementation*);
1720 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Hand&);
1729 const char* cstr = toCString();
1730 std::string str(cstr);
1731 deleteCString(cstr);
1815 Gesture(GestureImplementation*);
1841 TYPE_SCREEN_TAP = 5,
1849 TYPEINVALID = TYPE_INVALID,
1850 TYPESWIPE = TYPE_SWIPE,
1851 TYPECIRCLE = TYPE_CIRCLE,
1852 TYPESCREENTAP = TYPE_SCREEN_TAP,
1853 TYPEKEYTAP = TYPE_KEY_TAP,
1884 STATEINVALID = STATE_INVALID,
1885 STATESTART = STATE_START,
1886 STATEUPDATE = STATE_UPDATE,
1887 STATESTOP = STATE_STOP,
2058 const char* cstr = toCString();
2059 std::string str(cstr);
2060 deleteCString(cstr);
2588 Screen(ScreenImplementation*);
2622 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Screen&);
2625 const char* cstr = toCString();
2626 std::string str(cstr);
2627 deleteCString(cstr);
2664 TYPE_PERIPHERAL = 1,
2678 Device(DeviceImplementation*);
2818 const char* cstr = serialNumberCString();
2819 std::string str(cstr);
2820 deleteCString(cstr);
2918 const char* cstr = toCString();
2919 std::string str(cstr);
2920 deleteCString(cstr);
2926 LEAP_EXPORT const char* serialNumberCString()
const;
2946 Image(ImageImplementation*);
3038 void data(
unsigned char* dst)
const {
3039 const unsigned char* src = data();
3040 memcpy(dst, src, width() * height() * bytesPerPixel() *
sizeof(
unsigned char));
3051 const float* src = distortion();
3052 memcpy(dst, src, distortionWidth() * distortionHeight() *
sizeof(
float));
3060 return (
void*) data();
3068 return (
void*) distortion();
3290 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Image&);
3299 const char* cstr = toCString();
3300 std::string str(cstr);
3301 deleteCString(cstr);
3331 Mask(MaskImplementation*);
3367 void data(
unsigned char* dst)
const {
3368 const unsigned char* src = data();
3369 memcpy(dst, src, width() * height() *
sizeof(
unsigned char));
3373 return (
void*) data();
3428 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Mask&);
3431 const char* cstr = toCString();
3432 std::string str(cstr);
3433 deleteCString(cstr);
3442 template<
typename L,
typename T>
4382 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const TrackedQuad&);
4385 const char* cstr = toCString();
4386 std::string str(cstr);
4387 deleteCString(cstr);
4601 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const InteractionBox&);
4610 const char* cstr = toCString();
4611 std::string str(cstr);
4612 deleteCString(cstr);
4637 Frame(FrameImplementation*);
4915 LEAP_EXPORT float translationProbability(
const Frame& sinceFrame)
const;
4961 LEAP_EXPORT float rotationAngle(
const Frame& sinceFrame)
const;
4986 LEAP_EXPORT float rotationAngle(
const Frame& sinceFrame,
const Vector& axis)
const;
5023 LEAP_EXPORT float rotationProbability(
const Frame& sinceFrame)
const;
5048 LEAP_EXPORT float scaleFactor(
const Frame& sinceFrame)
const;
5065 LEAP_EXPORT float scaleProbability(
const Frame& sinceFrame)
const;
5157 LEAP_EXPORT friend std::ostream& operator<<(std::ostream&,
const Frame&);
5181 const char* cstr = serializeCString(length);
5182 std::string str(cstr, length);
5183 deleteCString(cstr);
5215 deserializeCString(str.data(), str.length());
5224 const unsigned char* cstr =
reinterpret_cast<const unsigned char*
>(serializeCString(length));
5225 memcpy(ptr, cstr, length *
sizeof(
unsigned char));
5235 serializeCString(length);
5236 return static_cast<int>(length);
5244 deserializeCString(reinterpret_cast<const char*>(ptr), static_cast<size_t>(length));
5254 const char* cstr = toCString();
5255 std::string str(cstr);
5256 deleteCString(cstr);
5263 LEAP_EXPORT void deserializeCString(
const char* str,
size_t length);
5373 TYPEUNKNOWN = TYPE_UNKNOWN,
5374 TYPEBOOLEAN = TYPE_BOOLEAN,
5375 TYPEINT32 = TYPE_INT32,
5376 TYPEFLOAT = TYPE_FLOAT,
5377 TYPESTRING = TYPE_STRING,
5392 return typeCString(key.c_str());
5403 return getBoolCString(key.c_str());
5413 bool setBool(
const std::string& key,
bool value) {
5414 return setBoolCString(key.c_str(), value);
5425 return getInt32CString(key.c_str());
5436 return setInt32CString(key.c_str(), value);
5447 return getFloatCString(key.c_str());
5458 return setFloatCString(key.c_str(), value);
5469 const char* cstr = getStringCString(key.c_str());
5470 std::string str(cstr);
5471 deleteCString(cstr);
5482 bool setString(
const std::string& key,
const std::string& value) {
5483 return setStringCString(key.c_str(), value.c_str());
5505 LEAP_EXPORT bool getBoolCString(
const char* key)
const;
5506 LEAP_EXPORT bool setBoolCString(
const char* key,
bool value);
5507 LEAP_EXPORT int32_t getInt32CString(
const char* key)
const;
5508 LEAP_EXPORT bool setInt32CString(
const char* key, int32_t value);
5509 LEAP_EXPORT float getFloatCString(
const char* key)
const;
5510 LEAP_EXPORT bool setFloatCString(
const char* key,
float value);
5511 LEAP_EXPORT const char* getStringCString(
const char* key)
const;
5512 LEAP_EXPORT bool setStringCString(
const char* key,
const char* value);
5679 POLICY_BACKGROUND_FRAMES = (1 << 0),
5685 POLICY_IMAGES = (1 << 1),
5691 POLICY_OPTIMIZE_HMD = (1 << 2),
5695 POLICYDEFAULT = POLICY_DEFAULT,
5696 POLICYBACKGROUNDFRAMES = POLICY_BACKGROUND_FRAMES,
6112 #endif // __Leap_h__ void serialize(unsigned char *ptr) const
void * distortionPointer() const
virtual LEAP_EXPORT void onFrame(const Controller &)
std::string toString() const
bool setBool(const std::string &key, bool value)
ConstListIterator< GestureList, Gesture > const_iterator
std::string toString() const
const ConstListIterator< L, T > operator++(int)
std::string toString() const
ConstListIterator< HandList, Hand > const_iterator
bool getBool(const std::string &key) const
bool setInt32(const std::string &key, int32_t value)
class SharedObject * m_object
virtual LEAP_EXPORT void onFocusGained(const Controller &)
virtual LEAP_EXPORT ~Implementation()
TFSIMD_FORCE_INLINE bool operator==(const Matrix3x3 &m1, const Matrix3x3 &m2)
void data(unsigned char *dst) const
void deserialize(const std::string &str)
std::string getString(const std::string &key) const
bool operator==(const ConstListIterator< L, T > &rhs) const
std::string serialNumber() const
virtual LEAP_EXPORT void onServiceConnect(const Controller &)
std::string toString() const
const T operator*() const
ValueType type(const std::string &key) const
void * dataPointer() const
void deserialize(const unsigned char *ptr, int length)
std::string toString() const
std::string toString() const
virtual LEAP_EXPORT void onDeviceChange(const Controller &)
std::string toString() const
std::string toString() const
std::string toString() const
bool operator!=(const ConstListIterator< L, T > &rhs) const
ConstListIterator< DeviceList, Device > const_iterator
void data(unsigned char *dst) const
#define LEAP_EXPORT_CLASS
virtual LEAP_EXPORT void onDisconnect(const Controller &)
std::forward_iterator_tag iterator_category
std::string toString() const
virtual LEAP_EXPORT void onConnect(const Controller &)
std::vector< std::vector< lpf > > hands
TFSIMD_FORCE_INLINE bool operator!=(const Vector3 &other) const
virtual LEAP_EXPORT void onExit(const Controller &)
ConstListIterator< PointableList, Pointable > const_iterator
bool setFloat(const std::string &key, float value)
ConstListIterator< MaskList, Mask > const_iterator
std::string toString() const
TFSIMD_FORCE_INLINE Vector3 & normalize()
virtual LEAP_EXPORT ~Listener()
std::ptrdiff_t difference_type
bool setString(const std::string &key, const std::string &value)
virtual LEAP_EXPORT void onServiceDisconnect(const Controller &)
float getFloat(const std::string &key) const
virtual LEAP_EXPORT void onImages(const Controller &)
virtual LEAP_EXPORT void onInit(const Controller &)
std::string toString() const
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
int32_t getInt32(const std::string &key) const
void * dataPointer() const
ConstListIterator< ImageList, Image > const_iterator
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
const ConstListIterator< L, T > & operator++()
std::string serialize() const
ConstListIterator< FingerList, Finger > const_iterator
int serializeLength() const
std::string toString() const
ConstListIterator< ScreenList, Screen > const_iterator
virtual LEAP_EXPORT void onFocusLost(const Controller &)
void distortion(float *dst) const