Open3D (C++ API)  0.17.0
NumberEdit.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 NumberEdit : public Widget {
19  using Super = Widget;
20 
21 public:
22  enum Type { INT, DOUBLE };
23  explicit NumberEdit(Type type);
24  ~NumberEdit();
25 
26  int GetIntValue() const;
27  double GetDoubleValue() const;
28  void SetValue(double val);
29 
30  double GetMinimumValue() const;
31  double GetMaximumValue() const;
32  void SetLimits(double min_value, double max_value);
33 
34  int GetDecimalPrecision();
35  void SetDecimalPrecision(int num_digits);
36 
37  void SetPreferredWidth(int width);
38 
39  void SetOnValueChanged(std::function<void(double)> on_changed);
40 
42  const Constraints& constraints) const override;
43  Widget::DrawResult Draw(const DrawContext& context) override;
44 
45 private:
46  struct Impl;
47  std::unique_ptr<Impl> impl_;
48 };
49 
50 } // namespace gui
51 } // namespace visualization
52 } // namespace open3d
ImGuiContext * context
Definition: Window.cpp:76
Definition: NumberEdit.h:18
double GetDoubleValue() const
Definition: NumberEdit.cpp:51
void SetValue(double val)
Definition: NumberEdit.cpp:53
void SetPreferredWidth(int width)
Definition: NumberEdit.cpp:82
void SetLimits(double min_value, double max_value)
Definition: NumberEdit.cpp:65
double GetMaximumValue() const
Definition: NumberEdit.cpp:63
void SetOnValueChanged(std::function< void(double)> on_changed)
Definition: NumberEdit.cpp:86
Widget::DrawResult Draw(const DrawContext &context) override
Definition: NumberEdit.cpp:117
Type
Definition: NumberEdit.h:22
@ DOUBLE
Definition: NumberEdit.h:22
@ INT
Definition: NumberEdit.h:22
int GetDecimalPrecision()
Definition: NumberEdit.cpp:76
NumberEdit(Type type)
Definition: NumberEdit.cpp:42
void SetDecimalPrecision(int num_digits)
Definition: NumberEdit.cpp:78
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: NumberEdit.cpp:90
~NumberEdit()
Definition: NumberEdit.cpp:47
int GetIntValue() const
Definition: NumberEdit.cpp:49
double GetMinimumValue() const
Definition: NumberEdit.cpp:61
Definition: Widget.h:49
Widget()
Definition: Widget.cpp:34
DrawResult
Definition: Widget.h:95
int width
Definition: FilePCD.cpp:52
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