diff --git a/src/ultraleap.cpp b/src/ultraleap.cpp index 6e004ff..ee47d98 100644 --- a/src/ultraleap.cpp +++ b/src/ultraleap.cpp @@ -495,7 +495,7 @@ void UltraleapHandTracking::serviceMessageLoop() { is_running = false; } -UltraleapTypes::TrackingMode UltraleapHandTracking::get_tracking_mode() { +UltraleapTypes::TrackingMode UltraleapHandTracking::get_tracking_mode() const { if (primary_device == NULL) { return UltraleapTypes::TrackingMode::Desktop; } @@ -556,11 +556,11 @@ void UltraleapHandTracking::set_policy(UltraleapTypes::PolicyFlag flag, bool val LeapSetPolicyFlags(connectionHandle, set_flags, clear_flags); } -bool UltraleapHandTracking::get_images_policy() { +bool UltraleapHandTracking::get_images_policy() const { return get_policy(UltraleapTypes::PolicyFlag::Images); } -bool UltraleapHandTracking::get_policy(UltraleapTypes::PolicyFlag flag) { +bool UltraleapHandTracking::get_policy(UltraleapTypes::PolicyFlag flag) const { return UltraleapTypes::read_policy_flag(policy_flags, flag); } @@ -819,11 +819,11 @@ void UltraleapHandTracking::set_primary_device(Ref device) { LeapSetPrimaryDevice(connectionHandle, device->device, false); } -Ref UltraleapHandTracking::get_primary_device() { +Ref UltraleapHandTracking::get_primary_device() const { return primary_device; } -Ref UltraleapHandTracking::get_last_frame() { +Ref UltraleapHandTracking::get_last_frame() const { if (primary_device == NULL) { return NULL; } @@ -831,7 +831,7 @@ Ref UltraleapHandTracking::get_last_frame() { return primary_device->get_last_frame(); } -Ref UltraleapHandTracking::get_left_image() { +Ref UltraleapHandTracking::get_left_image() const { if (primary_device == NULL) { return NULL; } @@ -839,7 +839,7 @@ Ref UltraleapHandTracking::get_left_image() { return primary_device->get_left_image(); } -Ref UltraleapHandTracking::get_right_image() { +Ref UltraleapHandTracking::get_right_image() const { if (primary_device == NULL) { return NULL; } diff --git a/src/ultraleap.h b/src/ultraleap.h index aec937c..931711b 100644 --- a/src/ultraleap.h +++ b/src/ultraleap.h @@ -35,11 +35,6 @@ public: UltraleapTypes::TrackingMode default_tracking_mode = UltraleapTypes::TrackingMode::Desktop; - bool interpolate = true; - - bool get_interpolate(); - void set_interpolate(bool value); - Ref devices; String service_ip = String("127.0.0.1"); @@ -48,30 +43,30 @@ public: bool autostart = true; bool enable_images = true; - UltraleapTypes::TrackingMode get_tracking_mode(); + UltraleapTypes::TrackingMode get_tracking_mode() const; void set_tracking_mode(UltraleapTypes::TrackingMode value); - Ref get_last_frame(); - Ref get_left_image(); - Ref get_right_image(); + Ref get_last_frame() const; + Ref get_left_image() const; + Ref get_right_image() const; - Array get_devices() { return devices->devices; } + Array get_devices() const { return devices->devices; } void set_devices(Array value) { devices->devices = value; } - String get_service_ip() { return service_ip; } + String get_service_ip() const { return service_ip; } void set_service_ip(String value) { service_ip = value; } - int get_service_port() { return service_port; } + int get_service_port() const { return service_port; } void set_service_port(int value) { service_port = value; } - bool get_autostart() { return autostart; } + bool get_autostart() const { return autostart; } void set_autostart(bool value) { autostart = value; } - bool get_enable_images() { return enable_images; } + bool get_enable_images() const { return enable_images; } void set_enable_images(bool value) { enable_images = value; } - bool is_connected() { return connected; } - bool is_started() { return started; } + bool is_connected() const { return connected; } + bool is_started() const { return started; } // Policy setters void set_images_policy(bool value); @@ -81,11 +76,11 @@ public: // Policy getters // Only reimplementing the things we know do something - bool get_images_policy(); + bool get_images_policy() const; // Set and get primary device void set_primary_device(Ref device); - Ref get_primary_device(); + Ref get_primary_device() const; void set_pause(bool value); @@ -122,7 +117,7 @@ private: void handle_device_status_change_event(const LEAP_DEVICE_STATUS_CHANGE_EVENT* event, uint32_t device_id); void set_policy(UltraleapTypes::PolicyFlag flag, bool value); - bool get_policy(UltraleapTypes::PolicyFlag flag); + bool get_policy(UltraleapTypes::PolicyFlag flag) const; String generate_connection_payload();