Open3D (C++ API)  0.17.0
Slider.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <functional>
11 
13 
14 namespace open3d {
15 namespace visualization {
16 namespace gui {
17 
18 class Slider : public Widget {
19 public:
20  enum Type { INT, DOUBLE };
23  explicit Slider(Type type);
24  ~Slider();
25 
27  int GetIntValue() const;
29  double GetDoubleValue() const;
32  void SetValue(double val);
33 
34  double GetMinimumValue() const;
35  double GetMaximumValue() const;
38  void SetLimits(double min_value, double max_value);
39 
41  const Constraints& constraints) const override;
42 
43  DrawResult Draw(const DrawContext& context) override;
44 
46  void SetOnValueChanged(std::function<void(double)> on_value_changed);
47 
48 private:
49  struct Impl;
50  std::unique_ptr<Impl> impl_;
51 };
52 
53 } // namespace gui
54 } // namespace visualization
55 } // namespace open3d
ImGuiContext * context
Definition: Window.cpp:76
const Theme * theme
Definition: Window.cpp:74
Definition: Slider.h:18
DrawResult Draw(const DrawContext &context) override
Definition: Slider.cpp:82
void SetValue(double val)
Definition: Slider.cpp:48
Type
Definition: Slider.h:20
@ INT
Definition: Slider.h:20
@ DOUBLE
Definition: Slider.h:20
void SetLimits(double min_value, double max_value)
Definition: Slider.cpp:60
double GetDoubleValue() const
Returns the value of the control as a double.
Definition: Slider.cpp:46
void SetOnValueChanged(std::function< void(double)> on_value_changed)
Sets a function to call when the value changes because of user action.
Definition: Slider.cpp:70
int GetIntValue() const
Returns the value of the control as an integer.
Definition: Slider.cpp:44
double GetMaximumValue() const
Definition: Slider.cpp:58
~Slider()
Definition: Slider.cpp:42
Slider(Type type)
Definition: Slider.cpp:37
Size CalcPreferredSize(const LayoutContext &theme, const Constraints &constraints) const override
Definition: Slider.cpp:74
double GetMinimumValue() const
Definition: Slider.cpp:56
Definition: Widget.h:49
DrawResult
Definition: Widget.h:95
char type
Definition: FilePCD.cpp:41
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle image_handle timestamp_usec white_balance image_handle k4a_device_configuration_t config device_handle char size_t serial_number_size bool int32_t int32_t max_value
Definition: K4aPlugin.cpp:649
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c k4a_image_t image_handle uint8_t image_handle image_handle image_handle image_handle image_handle timestamp_usec white_balance image_handle k4a_device_configuration_t config device_handle char size_t serial_number_size bool int32_t min_value
Definition: K4aPlugin.cpp:647
Definition: PinholeCameraIntrinsic.cpp:16