Open3D (C++ API)  0.18.0+fcf98ee
ViewControlWithEditing.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 
11 
12 namespace open3d {
13 namespace visualization {
14 
16 public:
17  enum EditingMode {
18  FreeMode = 0,
25  };
26 
27 public:
29 
30  void Reset() override;
31  void ChangeFieldOfView(double step) override;
32  void Scale(double scale) override;
33  void Rotate(double x, double y, double xo, double yo) override;
34  void Translate(double x, double y, double xo, double yo) override;
35 
37  std::string GetStatusString() const;
38 
40  void ToggleEditingX() {
41  if (editing_mode_ == EditingMode::OrthoPositiveX) {
42  SetEditingMode(EditingMode::OrthoNegativeX);
43  } else {
44  SetEditingMode(EditingMode::OrthoPositiveX);
45  }
46  }
47 
48  void ToggleEditingY() {
49  if (editing_mode_ == EditingMode::OrthoPositiveY) {
50  SetEditingMode(EditingMode::OrthoNegativeY);
51  } else {
52  SetEditingMode(EditingMode::OrthoPositiveY);
53  }
54  }
55 
56  void ToggleEditingZ() {
57  if (editing_mode_ == EditingMode::OrthoPositiveZ) {
58  SetEditingMode(EditingMode::OrthoNegativeZ);
59  } else {
60  SetEditingMode(EditingMode::OrthoPositiveZ);
61  }
62  }
63 
65  bool IsLocked() const { return is_view_locked_; }
66 
67 protected:
70  bool is_view_locked_ = false;
71 };
72 
73 } // namespace visualization
74 } // namespace open3d
View controller for visualizer.
Definition: ViewControl.h:23
Definition: ViewControlWithEditing.h:15
ViewParameters view_status_backup_
Definition: ViewControlWithEditing.h:69
void Rotate(double x, double y, double xo, double yo) override
Function to process rotation.
Definition: ViewControlWithEditing.cpp:71
std::string GetStatusString() const
Definition: ViewControlWithEditing.cpp:116
void ChangeFieldOfView(double step) override
Definition: ViewControlWithEditing.cpp:53
void Translate(double x, double y, double xo, double yo) override
Function to process translation.
Definition: ViewControlWithEditing.cpp:91
void SetEditingMode(EditingMode mode)
Definition: ViewControlWithEditing.cpp:103
EditingMode editing_mode_
Definition: ViewControlWithEditing.h:68
virtual ~ViewControlWithEditing()
Definition: ViewControlWithEditing.h:28
EditingMode
Definition: ViewControlWithEditing.h:17
@ OrthoPositiveX
Definition: ViewControlWithEditing.h:19
@ OrthoNegativeZ
Definition: ViewControlWithEditing.h:24
@ OrthoNegativeY
Definition: ViewControlWithEditing.h:22
@ FreeMode
Definition: ViewControlWithEditing.h:18
@ OrthoPositiveZ
Definition: ViewControlWithEditing.h:23
@ OrthoPositiveY
Definition: ViewControlWithEditing.h:21
@ OrthoNegativeX
Definition: ViewControlWithEditing.h:20
void ToggleEditingZ()
Definition: ViewControlWithEditing.h:56
void Reset() override
Definition: ViewControlWithEditing.cpp:13
EditingMode GetEditingMode() const
Definition: ViewControlWithEditing.h:39
bool IsLocked() const
Definition: ViewControlWithEditing.h:65
void ToggleEditingY()
Definition: ViewControlWithEditing.h:48
void Scale(double scale) override
Definition: ViewControlWithEditing.cpp:62
void ToggleEditingX()
Definition: ViewControlWithEditing.h:40
void ToggleLocking()
Definition: ViewControlWithEditing.h:64
bool is_view_locked_
Definition: ViewControlWithEditing.h:70
Definition: ViewParameters.h:18
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 int32_t int32_t k4a_color_control_mode_t default_mode mode
Definition: K4aPlugin.cpp:678
Definition: PinholeCameraIntrinsic.cpp:16