Open3D (C++ API)  0.17.0
ModelInteractorLogic.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 <map>
11 
14 
15 namespace open3d {
16 namespace visualization {
17 namespace rendering {
18 
19 class Open3DScene;
20 
23 
24 public:
26  Camera* camera,
27  double min_far_plane);
28  virtual ~ModelInteractorLogic();
29 
30  void SetBoundingBox(
31  const geometry::AxisAlignedBoundingBox& bounds) override;
32 
33  void SetModel(GeometryHandle axes,
34  const std::vector<GeometryHandle>& objects);
35 
36  void Rotate(int dx, int dy) override;
37  void RotateZ(int dx, int dy) override;
38  void Dolly(float dy, DragType drag_type) override;
39  void Pan(int dx, int dy) override;
40 
41  void StartMouseDrag() override;
42  void UpdateMouseDragUI() override;
43  void EndMouseDrag() override;
44 
45 private:
46  Open3DScene* scene_;
47  bool is_axes_visible_;
48 
49  geometry::AxisAlignedBoundingBox bounds_at_mouse_down_;
50  std::map<std::string, Camera::Transform> transforms_at_mouse_down_;
51 
52  void UpdateBoundingBox(const Camera::Transform& t);
53 };
54 
55 } // namespace rendering
56 } // namespace visualization
57 } // namespace open3d
A bounding box that is aligned along the coordinate axes.
Definition: BoundingVolume.h:159
Eigen::Transform< float, 3, Eigen::Affine > Transform
Definition: Camera.h:25
DragType
Definition: MatrixInteractorLogic.h:56
Definition: ModelInteractorLogic.h:21
void UpdateMouseDragUI() override
Definition: ModelInteractorLogic.cpp:151
virtual ~ModelInteractorLogic()
Definition: ModelInteractorLogic.cpp:24
void EndMouseDrag() override
Definition: ModelInteractorLogic.cpp:153
ModelInteractorLogic(Open3DScene *scene, Camera *camera, double min_far_plane)
Definition: ModelInteractorLogic.cpp:19
void SetModel(GeometryHandle axes, const std::vector< GeometryHandle > &objects)
Definition: ModelInteractorLogic.cpp:35
void SetBoundingBox(const geometry::AxisAlignedBoundingBox &bounds) override
Definition: ModelInteractorLogic.cpp:26
void Pan(int dx, int dy) override
Definition: ModelInteractorLogic.cpp:102
void RotateZ(int dx, int dy) override
Rotates about the forward axis of the matrix.
Definition: ModelInteractorLogic.cpp:62
void Dolly(float dy, DragType drag_type) override
Definition: ModelInteractorLogic.cpp:78
void StartMouseDrag() override
Definition: ModelInteractorLogic.cpp:131
void Rotate(int dx, int dy) override
Definition: ModelInteractorLogic.cpp:38
Definition: RotationInteractorLogic.h:16
RotationInteractorLogic(Camera *camera, double min_far_plane)
Definition: RotationInteractorLogic.cpp:14
Definition: PinholeCameraIntrinsic.cpp:16
Definition: RendererHandle.h:90