![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <MatrixInteractorLogic.h>


Public Types | |
| enum class | DragType { MOUSE , WHEEL , TWO_FINGER } |
Public Member Functions | |
| virtual | ~MatrixInteractorLogic () |
| void | SetViewSize (int width, int height) |
| int | GetViewWidth () const |
| int | GetViewHeight () const |
| const ccBBox & | GetBoundingBox () const |
| virtual void | SetBoundingBox (const ccBBox &bounds) |
| Eigen::Vector3f | GetCenterOfRotation () const |
| void | SetMouseDownInfo (const Camera::Transform &matrix, const Eigen::Vector3f ¢er_of_rotation) |
| const Camera::Transform & | GetMatrix () const |
| virtual void | Rotate (int dx, int dy) |
| virtual void | RotateWorld (int dx, int dy, const Eigen::Vector3f &x_axis, const Eigen::Vector3f &y_axis) |
| virtual void | RotateZ (int dx, int dy) |
| Rotates about the forward axis of the matrix. More... | |
| virtual void | RotateZWorld (int dx, int dy, const Eigen::Vector3f &forward) |
| virtual void | Dolly (float dy, DragType drag_type) |
| virtual void | Dolly (float z_dist, Camera::Transform matrix) |
Protected Member Functions | |
| void | SetMatrix (const Camera::Transform &matrix) |
| float | CalcRotateRadians (int dx, int dy) |
| float | CalcRotateZRadians (int dx, int dy) |
| float | CalcDollyDist (float dy, DragType drag_type, const Camera::Transform &matrix) |
Protected Attributes | |
| int | view_width_ = 1 |
| int | view_height_ = 1 |
| double | model_size_ = 20.0 |
| ccBBox | model_bounds_ |
| Eigen::Vector3f | center_of_rotation_ |
| Camera::Transform | matrix_at_mouse_down_ |
| Eigen::Vector3f | center_of_rotation_at_mouse_down_ |
Base class for rotating and dollying (translating along forward axis). Could be used for a camera, or also something else, like a the direction of a directional light.
Definition at line 21 of file MatrixInteractorLogic.h.
| Enumerator | |
|---|---|
| MOUSE | |
| WHEEL | |
| TWO_FINGER | |
Definition at line 57 of file MatrixInteractorLogic.h.
|
virtual |
Definition at line 14 of file MatrixInteractorLogic.cpp.
|
protected |
Definition at line 189 of file MatrixInteractorLogic.cpp.
References center_of_rotation_, dist(), length(), max(), model_size_, MOUSE, TWO_FINGER, and WHEEL.
Referenced by Dolly(), and cloudViewer::visualization::rendering::ModelInteractorLogic::Dolly().
|
protected |
Definition at line 128 of file MatrixInteractorLogic.cpp.
References M_PI, and view_height_.
Referenced by Rotate(), cloudViewer::visualization::rendering::ModelInteractorLogic::Rotate(), and RotateWorld().
|
protected |
Definition at line 157 of file MatrixInteractorLogic.cpp.
References M_PI, and view_height_.
Referenced by RotateZ(), cloudViewer::visualization::rendering::ModelInteractorLogic::RotateZ(), and RotateZWorld().
|
virtual |
Moves the matrix along the forward axis. (This is one type of zoom.)
Reimplemented in cloudViewer::visualization::rendering::CameraInteractorLogic, and cloudViewer::visualization::rendering::ModelInteractorLogic.
Definition at line 163 of file MatrixInteractorLogic.cpp.
References CalcDollyDist(), dist(), matrix_at_mouse_down_, and MOUSE.
Referenced by cloudViewer::visualization::rendering::CameraInteractorLogic::Dolly(), and cloudViewer::visualization::gui::RotationInteractor::Mouse().
|
virtual |
Reimplemented in cloudViewer::visualization::rendering::CameraInteractorLogic.
Definition at line 175 of file MatrixInteractorLogic.cpp.
| const ccBBox & cloudViewer::visualization::rendering::MatrixInteractorLogic::GetBoundingBox | ( | ) | const |
Definition at line 25 of file MatrixInteractorLogic.cpp.
References model_bounds_.
| Eigen::Vector3f cloudViewer::visualization::rendering::MatrixInteractorLogic::GetCenterOfRotation | ( | ) | const |
Definition at line 34 of file MatrixInteractorLogic.cpp.
References center_of_rotation_.
Referenced by cloudViewer::visualization::gui::RotationInteractor::GetCenterOfRotation().
| const Camera::Transform & cloudViewer::visualization::rendering::MatrixInteractorLogic::GetMatrix | ( | ) | const |
Definition at line 52 of file MatrixInteractorLogic.cpp.
Referenced by cloudViewer::visualization::rendering::CameraInteractorLogic::Dolly(), cloudViewer::visualization::rendering::LightDirectionInteractorLogic::GetCurrentDirection(), cloudViewer::visualization::rendering::IBLRotationInteractorLogic::GetCurrentRotation(), cloudViewer::visualization::rendering::CameraInteractorLogic::Pan(), cloudViewer::visualization::rendering::CameraInteractorLogic::Rotate(), cloudViewer::visualization::rendering::CameraInteractorLogic::RotateFly(), cloudViewer::visualization::rendering::CameraInteractorLogic::RotateZ(), cloudViewer::visualization::rendering::RotationInteractorLogic::StartMouseDrag(), and cloudViewer::visualization::rendering::LightDirectionInteractorLogic::UpdateMouseDragUI().
| int cloudViewer::visualization::rendering::MatrixInteractorLogic::GetViewHeight | ( | ) | const |
Definition at line 23 of file MatrixInteractorLogic.cpp.
References view_height_.
Referenced by cloudViewer::visualization::gui::PickPointsInteractor::DoPick().
| int cloudViewer::visualization::rendering::MatrixInteractorLogic::GetViewWidth | ( | ) | const |
Definition at line 21 of file MatrixInteractorLogic.cpp.
References view_width_.
Referenced by cloudViewer::visualization::gui::PickPointsInteractor::DoPick().
|
virtual |
Rotates about an axis defined by dx * matrixLeft, dy * matrixUp. dy is assumed to be in window-style coordinates, that is, going up produces a negative dy. The axis goes through the center of rotation.
Reimplemented in cloudViewer::visualization::rendering::ModelInteractorLogic, cloudViewer::visualization::rendering::LightDirectionInteractorLogic, cloudViewer::visualization::rendering::IBLRotationInteractorLogic, cloudViewer::visualization::rendering::CameraSphereInteractorLogic, and cloudViewer::visualization::rendering::CameraInteractorLogic.
Definition at line 56 of file MatrixInteractorLogic.cpp.
References CalcRotateRadians(), center_of_rotation_, dist(), and matrix_at_mouse_down_.
Referenced by cloudViewer::visualization::gui::RotationInteractor::Mouse(), cloudViewer::visualization::rendering::CameraInteractorLogic::Rotate(), and cloudViewer::visualization::rendering::CameraInteractorLogic::RotateFly().
|
virtual |
Same as Rotate() except that the dx-axis and the dy-axis are specified
Definition at line 101 of file MatrixInteractorLogic.cpp.
References CalcRotateRadians(), center_of_rotation_, dist(), and matrix_at_mouse_down_.
Referenced by cloudViewer::visualization::rendering::IBLRotationInteractorLogic::Rotate(), cloudViewer::visualization::rendering::LightDirectionInteractorLogic::Rotate(), and cloudViewer::visualization::rendering::IBLRotationInteractorLogic::RotateZ().
|
virtual |
Rotates about the forward axis of the matrix.
Reimplemented in cloudViewer::visualization::rendering::ModelInteractorLogic, cloudViewer::visualization::rendering::IBLRotationInteractorLogic, and cloudViewer::visualization::rendering::CameraInteractorLogic.
Definition at line 133 of file MatrixInteractorLogic.cpp.
References CalcRotateZRadians(), and matrix_at_mouse_down_.
Referenced by cloudViewer::visualization::gui::RotationInteractor::Mouse(), and cloudViewer::visualization::rendering::CameraInteractorLogic::RotateZ().
|
virtual |
Definition at line 144 of file MatrixInteractorLogic.cpp.
References CalcRotateZRadians(), center_of_rotation_, and matrix_at_mouse_down_.
|
virtual |
Reimplemented in cloudViewer::visualization::rendering::ModelInteractorLogic, and cloudViewer::visualization::rendering::CameraInteractorLogic.
Definition at line 29 of file MatrixInteractorLogic.cpp.
References ccBBox::GetMaxBound(), ccBBox::GetMinBound(), model_bounds_, and model_size_.
Referenced by cloudViewer::visualization::rendering::CameraInteractorLogic::SetBoundingBox(), and cloudViewer::visualization::rendering::ModelInteractorLogic::SetBoundingBox().
|
protected |
Definition at line 48 of file MatrixInteractorLogic.cpp.
Referenced by cloudViewer::visualization::rendering::RotationInteractorLogic::Pan(), and cloudViewer::visualization::rendering::CameraSphereInteractorLogic::Rotate().
| void cloudViewer::visualization::rendering::MatrixInteractorLogic::SetMouseDownInfo | ( | const Camera::Transform & | matrix, |
| const Eigen::Vector3f & | center_of_rotation | ||
| ) |
Definition at line 38 of file MatrixInteractorLogic.cpp.
References center_of_rotation_, center_of_rotation_at_mouse_down_, and matrix_at_mouse_down_.
Referenced by cloudViewer::visualization::rendering::CameraInteractorLogic::Dolly(), cloudViewer::visualization::rendering::CameraInteractorLogic::RotateFly(), cloudViewer::visualization::rendering::CameraInteractorLogic::SetBoundingBox(), cloudViewer::visualization::rendering::ModelInteractorLogic::SetBoundingBox(), cloudViewer::visualization::rendering::IBLRotationInteractorLogic::StartMouseDrag(), cloudViewer::visualization::rendering::LightDirectionInteractorLogic::StartMouseDrag(), cloudViewer::visualization::rendering::RotationInteractorLogic::StartMouseDrag(), cloudViewer::visualization::rendering::CameraInteractorLogic::StartMouseDrag(), and cloudViewer::visualization::rendering::ModelInteractorLogic::StartMouseDrag().
| void cloudViewer::visualization::rendering::MatrixInteractorLogic::SetViewSize | ( | int | width, |
| int | height | ||
| ) |
Definition at line 16 of file MatrixInteractorLogic.cpp.
References height, view_height_, view_width_, and width.
Referenced by cloudViewer::visualization::gui::PickInteractor::SetViewSize().
|
protected |
Definition at line 72 of file MatrixInteractorLogic.h.
Referenced by CalcDollyDist(), cloudViewer::visualization::rendering::CameraInteractorLogic::Dolly(), GetCenterOfRotation(), cloudViewer::visualization::rendering::RotationInteractorLogic::Pan(), cloudViewer::visualization::rendering::ModelInteractorLogic::Pan(), Rotate(), cloudViewer::visualization::rendering::CameraSphereInteractorLogic::Rotate(), cloudViewer::visualization::rendering::ModelInteractorLogic::Rotate(), RotateWorld(), cloudViewer::visualization::rendering::ModelInteractorLogic::RotateZ(), RotateZWorld(), cloudViewer::visualization::rendering::RotationInteractorLogic::SetCenterOfRotation(), SetMouseDownInfo(), cloudViewer::visualization::rendering::RotationInteractorLogic::StartMouseDrag(), cloudViewer::visualization::rendering::CameraInteractorLogic::StartMouseDrag(), cloudViewer::visualization::rendering::CameraSphereInteractorLogic::StartMouseDrag(), cloudViewer::visualization::rendering::ModelInteractorLogic::StartMouseDrag(), and cloudViewer::visualization::rendering::CameraInteractorLogic::Zoom().
|
protected |
Definition at line 75 of file MatrixInteractorLogic.h.
Referenced by cloudViewer::visualization::rendering::RotationInteractorLogic::CalcPanVectorWorld(), cloudViewer::visualization::rendering::RotationInteractorLogic::Pan(), cloudViewer::visualization::rendering::ModelInteractorLogic::Pan(), SetMouseDownInfo(), and cloudViewer::visualization::rendering::CameraInteractorLogic::Zoom().
|
protected |
Definition at line 74 of file MatrixInteractorLogic.h.
Referenced by Dolly(), cloudViewer::visualization::rendering::ModelInteractorLogic::Dolly(), cloudViewer::visualization::rendering::RotationInteractorLogic::Pan(), Rotate(), RotateWorld(), RotateZ(), RotateZWorld(), SetMouseDownInfo(), and cloudViewer::visualization::rendering::CameraInteractorLogic::Zoom().
|
protected |
|
protected |
Definition at line 70 of file MatrixInteractorLogic.h.
Referenced by CalcDollyDist(), SetBoundingBox(), and cloudViewer::visualization::rendering::LightDirectionInteractorLogic::StartMouseDrag().
|
protected |
Definition at line 69 of file MatrixInteractorLogic.h.
Referenced by cloudViewer::visualization::rendering::RotationInteractorLogic::CalcPanVectorWorld(), CalcRotateRadians(), CalcRotateZRadians(), GetViewHeight(), cloudViewer::visualization::rendering::CameraSphereInteractorLogic::Rotate(), SetViewSize(), and cloudViewer::visualization::rendering::CameraInteractorLogic::Zoom().
|
protected |
Definition at line 68 of file MatrixInteractorLogic.h.
Referenced by GetViewWidth(), cloudViewer::visualization::rendering::CameraSphereInteractorLogic::Rotate(), SetViewSize(), and cloudViewer::visualization::rendering::CameraInteractorLogic::Zoom().