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


Public Types | |
| enum | AnimationMode { FreeMode = 0 , PreviewMode = 1 , PlayMode = 2 } |
Public Types inherited from cloudViewer::visualization::ViewControl | |
| enum | ProjectionType { Perspective = 0 , Orthogonal = 1 } |
Public Member Functions | |
| virtual | ~ViewControlWithCustomAnimation () |
| void | Reset () override |
| void | ChangeFieldOfView (double step) override |
| void | Scale (double scale) override |
| void | Rotate (double x, double y, double xo, double yo) override |
| Function to process rotation. More... | |
| void | Translate (double x, double y, double xo, double yo) override |
| Function to process translation. More... | |
| void | SetAnimationMode (AnimationMode mode) |
| void | AddKeyFrame () |
| void | UpdateKeyFrame () |
| void | DeleteKeyFrame () |
| void | AddSpinKeyFrames (int num_of_key_frames=20) |
| void | ClearAllKeyFrames () |
| size_t | NumOfKeyFrames () const |
| size_t | NumOfFrames () const |
| void | ToggleTrajectoryLoop () |
| void | ChangeTrajectoryInterval (int change) |
| int | GetTrajectoryInterval () const |
| std::string | GetStatusString () const |
| void | Step (double change) |
| void | GoToFirst () |
| void | GoToLast () |
| bool | CaptureTrajectory (const std::string &filename="") |
| bool | LoadTrajectoryFromJsonFile (const std::string &filename) |
| bool | LoadTrajectoryFromCameraTrajectory (const camera::PinholeCameraTrajectory &camera_trajectory) |
| bool | IsPreviewing () |
| bool | IsPlaying () |
| bool | IsPlayingEnd (size_t num) |
| bool | IsValidPinholeCameraTrajectory () const |
Public Member Functions inherited from cloudViewer::visualization::ViewControl | |
| virtual | ~ViewControl () |
| void | SetViewMatrices (const Eigen::Matrix4d &model_matrix=Eigen::Matrix4d::Identity()) |
| bool | ConvertToViewParameters (ViewParameters &status) const |
| Function to get equivalent view parameters (support orthogonal) More... | |
| bool | ConvertFromViewParameters (const ViewParameters &status) |
| void | SetZoom (const double zoom) |
| void | SetUp (const Eigen::Vector3d &up) |
| void | SetFront (const Eigen::Vector3d &front) |
| void | SetLookat (const Eigen::Vector3d &lookat) |
| bool | ConvertToPinholeCameraParameters (camera::PinholeCameraParameters ¶meters) |
| bool | ConvertFromPinholeCameraParameters (const camera::PinholeCameraParameters ¶meters, bool allow_arbitrary=false) |
| ProjectionType | GetProjectionType () const |
| void | SetProjectionParameters () |
| virtual void | ChangeWindowSize (int width, int height) |
| virtual void | CameraLocalTranslate (double forward, double right, double up) |
| virtual void | CameraLocalRotate (double x, double y, double xo=0.0, double yo=0.0) |
| virtual void | ResetCameraLocalRotate () |
| virtual void | Roll (double x) |
| const ccBBox & | GetBoundingBox () const |
| void | ResetBoundingBox () |
| void | FitInGeometry (const ccHObject &geometry) |
| double | GetFieldOfView () const |
| Function to get field of view. More... | |
| gl_util::GLMatrix4f | GetMVPMatrix () const |
| gl_util::GLMatrix4f | GetProjectionMatrix () const |
| gl_util::GLMatrix4f | GetViewMatrix () const |
| gl_util::GLMatrix4f | GetModelMatrix () const |
| gl_util::GLVector3f | GetEye () const |
| gl_util::GLVector3f | GetLookat () const |
| gl_util::GLVector3f | GetUp () const |
| gl_util::GLVector3f | GetFront () const |
| gl_util::GLVector3f | GetRight () const |
| int | GetWindowWidth () const |
| int | GetWindowHeight () const |
| double | GetZNear () const |
| double | GetZFar () const |
| void | SetConstantZNear (double z_near) |
| void | SetConstantZFar (double z_far) |
| void | UnsetConstantZNear () |
| void | UnsetConstantZFar () |
Protected Member Functions | |
| size_t | CurrentFrame () const |
| size_t | CurrentKeyframe () const |
| double | RegularizeFrameIndex (double current_frame, size_t num_of_frames, bool is_loop) |
| void | SetViewControlFromTrajectory () |
Protected Attributes | |
| AnimationMode | animation_mode_ = AnimationMode::FreeMode |
| ViewTrajectory | view_trajectory_ |
| double | current_frame_ = 0.0 |
| double | current_keyframe_ = 0.0 |
Protected Attributes inherited from cloudViewer::visualization::ViewControl | |
| int | window_width_ = 0 |
| int | window_height_ = 0 |
| ccBBox | bounding_box_ |
| Eigen::Vector3d | eye_ |
| Eigen::Vector3d | lookat_ |
| Eigen::Vector3d | up_ |
| Eigen::Vector3d | front_ |
| Eigen::Vector3d | right_ |
| double | distance_ |
| double | field_of_view_ |
| double | zoom_ |
| double | view_ratio_ |
| double | aspect_ |
| double | z_near_ |
| double | z_far_ |
| double | constant_z_near_ = -1 |
| double | constant_z_far_ = -1 |
| gl_util::GLMatrix4f | projection_matrix_ |
| gl_util::GLMatrix4f | view_matrix_ |
| gl_util::GLMatrix4f | model_matrix_ |
| gl_util::GLMatrix4f | MVP_matrix_ |
| Eigen::Vector3d | start_local_rotate_up_ |
| Eigen::Vector3d | start_local_rotate_right_ |
| Eigen::Vector3d | start_local_rotate_front_ |
| Eigen::Vector3d | start_local_rotate_eye_ |
| Eigen::Vector3d | start_local_rotate_lookat_ |
| double | local_rotate_up_accum_ |
| double | local_rotate_right_accum_ |
Additional Inherited Members | |
Static Public Attributes inherited from cloudViewer::visualization::ViewControl | |
| static const double | FIELD_OF_VIEW_MAX = 90.0 |
| static const double | FIELD_OF_VIEW_MIN = 5.0 |
| static const double | FIELD_OF_VIEW_DEFAULT = 60.0 |
| static const double | FIELD_OF_VIEW_STEP = 5.0 |
| static const double | ZOOM_DEFAULT = 0.7 |
| static const double | ZOOM_MIN = 0.02 |
| static const double | ZOOM_MAX = 2.0 |
| static const double | ZOOM_STEP = 0.02 |
| static const double | ROTATION_RADIAN_PER_PIXEL = 0.003 |
Definition at line 17 of file ViewControlWithCustomAnimation.h.
| Enumerator | |
|---|---|
| FreeMode | |
| PreviewMode | |
| PlayMode | |
Definition at line 19 of file ViewControlWithCustomAnimation.h.
|
inlinevirtual |
Definition at line 26 of file ViewControlWithCustomAnimation.h.
| void cloudViewer::visualization::ViewControlWithCustomAnimation::AddKeyFrame | ( | ) |
Definition at line 87 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, cloudViewer::visualization::ViewControl::ConvertToViewParameters(), current_keyframe_, CurrentKeyframe(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
Referenced by AddSpinKeyFrames().
| void cloudViewer::visualization::ViewControlWithCustomAnimation::AddSpinKeyFrames | ( | int | num_of_key_frames = 20 | ) |
Definition at line 125 of file ViewControlWithCustomAnimation.cpp.
References AddKeyFrame(), animation_mode_, M_PI, cloudViewer::visualization::ViewControl::Rotate(), and cloudViewer::visualization::ViewControl::ROTATION_RADIAN_PER_PIXEL.
| bool cloudViewer::visualization::ViewControlWithCustomAnimation::CaptureTrajectory | ( | const std::string & | filename = "" | ) |
Definition at line 215 of file ViewControlWithCustomAnimation.cpp.
References filename, cloudViewer::utility::GetCurrentTimeStamp(), LogDebug, cloudViewer::visualization::ViewTrajectory::view_status_, view_trajectory_, and cloudViewer::io::WriteIJsonConvertible().
|
overridevirtual |
Function to change field of view.
| step | The step to change field of view. |
Reimplemented from cloudViewer::visualization::ViewControl.
Definition at line 23 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, cloudViewer::visualization::ViewControl::ChangeFieldOfView(), cloudViewer::visualization::ViewControl::field_of_view_, cloudViewer::visualization::ViewControl::GetProjectionType(), cloudViewer::visualization::gl_util::Perspective(), cloudViewer::visualization::ViewControl::SetProjectionParameters(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
inline |
Definition at line 49 of file ViewControlWithCustomAnimation.h.
References animation_mode_, cloudViewer::visualization::ViewTrajectory::ChangeInterval(), and view_trajectory_.
|
inline |
Definition at line 39 of file ViewControlWithCustomAnimation.h.
References cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
inlineprotected |
Definition at line 73 of file ViewControlWithCustomAnimation.h.
References current_frame_.
Referenced by GetStatusString(), and SetViewControlFromTrajectory().
|
inlineprotected |
Definition at line 74 of file ViewControlWithCustomAnimation.h.
References current_keyframe_.
Referenced by AddKeyFrame(), DeleteKeyFrame(), GetStatusString(), SetViewControlFromTrajectory(), and UpdateKeyFrame().
| void cloudViewer::visualization::ViewControlWithCustomAnimation::DeleteKeyFrame | ( | ) |
Definition at line 112 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, current_keyframe_, CurrentKeyframe(), cloudViewer::visualization::ViewTrajectory::is_loop_, RegularizeFrameIndex(), SetViewControlFromTrajectory(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
| std::string cloudViewer::visualization::ViewControlWithCustomAnimation::GetStatusString | ( | ) | const |
Definition at line 136 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, CurrentFrame(), CurrentKeyframe(), format, cloudViewer::visualization::ViewTrajectory::is_loop_, cloudViewer::visualization::ViewTrajectory::NumOfFrames(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
inline |
Definition at line 54 of file ViewControlWithCustomAnimation.h.
References cloudViewer::visualization::ViewTrajectory::interval_, and view_trajectory_.
| void cloudViewer::visualization::ViewControlWithCustomAnimation::GoToFirst | ( | ) |
Definition at line 191 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, current_frame_, current_keyframe_, SetViewControlFromTrajectory(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
Referenced by SetAnimationMode().
| void cloudViewer::visualization::ViewControlWithCustomAnimation::GoToLast | ( | ) |
Definition at line 203 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, current_frame_, current_keyframe_, cloudViewer::visualization::ViewTrajectory::NumOfFrames(), SetViewControlFromTrajectory(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
inline |
Definition at line 66 of file ViewControlWithCustomAnimation.h.
References animation_mode_.
Referenced by IsPlayingEnd().
|
inline |
Definition at line 67 of file ViewControlWithCustomAnimation.h.
References IsPlaying(), cloudViewer::visualization::ViewTrajectory::NumOfFrames(), and view_trajectory_.
|
inline |
Definition at line 63 of file ViewControlWithCustomAnimation.h.
References animation_mode_.
| bool cloudViewer::visualization::ViewControlWithCustomAnimation::IsValidPinholeCameraTrajectory | ( | ) | const |
Definition at line 270 of file ViewControlWithCustomAnimation.cpp.
References cloudViewer::visualization::ViewControl::FIELD_OF_VIEW_MIN, cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
| bool cloudViewer::visualization::ViewControlWithCustomAnimation::LoadTrajectoryFromCameraTrajectory | ( | const camera::PinholeCameraTrajectory & | camera_trajectory | ) |
Definition at line 242 of file ViewControlWithCustomAnimation.cpp.
References cloudViewer::visualization::ViewControl::ConvertFromPinholeCameraParameters(), cloudViewer::visualization::ViewControl::ConvertToViewParameters(), current_frame_, current_keyframe_, cloudViewer::visualization::ViewTrajectory::interval_, cloudViewer::visualization::ViewTrajectory::INTERVAL_MIN, cloudViewer::visualization::ViewTrajectory::is_loop_, cloudViewer::camera::PinholeCameraTrajectory::parameters_, cloudViewer::visualization::ViewTrajectory::Reset(), SetViewControlFromTrajectory(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
| bool cloudViewer::visualization::ViewControlWithCustomAnimation::LoadTrajectoryFromJsonFile | ( | const std::string & | filename | ) |
Definition at line 230 of file ViewControlWithCustomAnimation.cpp.
References current_frame_, current_keyframe_, filename, cloudViewer::io::ReadIJsonConvertible(), cloudViewer::visualization::ViewTrajectory::Reset(), SetViewControlFromTrajectory(), and view_trajectory_.
|
inline |
Definition at line 43 of file ViewControlWithCustomAnimation.h.
References cloudViewer::visualization::ViewTrajectory::NumOfFrames(), and view_trajectory_.
|
inline |
Definition at line 40 of file ViewControlWithCustomAnimation.h.
References cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
protected |
Definition at line 286 of file ViewControlWithCustomAnimation.cpp.
Referenced by DeleteKeyFrame(), and Step().
|
overridevirtual |
Reimplemented from cloudViewer::visualization::ViewControl.
Definition at line 17 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, and cloudViewer::visualization::ViewControl::Reset().
|
overridevirtual |
Function to process rotation.
Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.
| x | The distance the mouse cursor has moved in x-axis. |
| y | The distance the mouse cursor has moved in y-axis. |
| xo | Original point coordinate of the mouse in x-axis. |
| yo | Original point coordinate of the mouse in y-axis. |
Reimplemented from cloudViewer::visualization::ViewControl.
Definition at line 51 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, and cloudViewer::visualization::ViewControl::Rotate().
|
overridevirtual |
Function to process scaling
| scale | is the scale ratio. |
Reimplemented from cloudViewer::visualization::ViewControl.
Definition at line 45 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, and cloudViewer::visualization::ViewControl::Scale().
| void cloudViewer::visualization::ViewControlWithCustomAnimation::SetAnimationMode | ( | AnimationMode | mode | ) |
Definition at line 69 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, cloudViewer::visualization::ViewTrajectory::ComputeInterpolationCoefficients(), GoToFirst(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
protected |
Definition at line 310 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, cloudViewer::visualization::ViewControl::ConvertFromViewParameters(), CurrentFrame(), CurrentKeyframe(), cloudViewer::visualization::ViewTrajectory::GetInterpolatedFrame(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
Referenced by DeleteKeyFrame(), GoToFirst(), GoToLast(), LoadTrajectoryFromCameraTrajectory(), LoadTrajectoryFromJsonFile(), and Step().
| void cloudViewer::visualization::ViewControlWithCustomAnimation::Step | ( | double | change | ) |
Definition at line 173 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, current_frame_, current_keyframe_, cloudViewer::visualization::ViewTrajectory::is_loop_, cloudViewer::visualization::ViewTrajectory::NumOfFrames(), RegularizeFrameIndex(), SetViewControlFromTrajectory(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
inline |
Definition at line 44 of file ViewControlWithCustomAnimation.h.
References animation_mode_, cloudViewer::visualization::ViewTrajectory::is_loop_, and view_trajectory_.
|
overridevirtual |
Function to process translation.
Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.
| x | Distance the mouse cursor has moved in x-axis. |
| y | Distance the mouse cursor has moved in y-axis. |
| xo | Original point coordinate of the mouse in x-axis. |
| yo | Original point coordinate of the mouse in y-axis. |
Reimplemented from cloudViewer::visualization::ViewControl.
Definition at line 60 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, and cloudViewer::visualization::ViewControl::Translate().
| void cloudViewer::visualization::ViewControlWithCustomAnimation::UpdateKeyFrame | ( | ) |
Definition at line 104 of file ViewControlWithCustomAnimation.cpp.
References animation_mode_, cloudViewer::visualization::ViewControl::ConvertToViewParameters(), CurrentKeyframe(), cloudViewer::visualization::ViewTrajectory::view_status_, and view_trajectory_.
|
protected |
Definition at line 81 of file ViewControlWithCustomAnimation.h.
Referenced by AddKeyFrame(), AddSpinKeyFrames(), ChangeFieldOfView(), ChangeTrajectoryInterval(), DeleteKeyFrame(), GetStatusString(), GoToFirst(), GoToLast(), IsPlaying(), IsPreviewing(), Reset(), Rotate(), Scale(), SetAnimationMode(), SetViewControlFromTrajectory(), Step(), ToggleTrajectoryLoop(), Translate(), and UpdateKeyFrame().
|
protected |
Definition at line 83 of file ViewControlWithCustomAnimation.h.
Referenced by CurrentFrame(), GoToFirst(), GoToLast(), LoadTrajectoryFromCameraTrajectory(), LoadTrajectoryFromJsonFile(), and Step().
|
protected |
Definition at line 84 of file ViewControlWithCustomAnimation.h.
Referenced by AddKeyFrame(), CurrentKeyframe(), DeleteKeyFrame(), GoToFirst(), GoToLast(), LoadTrajectoryFromCameraTrajectory(), LoadTrajectoryFromJsonFile(), and Step().
|
protected |
Definition at line 82 of file ViewControlWithCustomAnimation.h.
Referenced by AddKeyFrame(), CaptureTrajectory(), ChangeFieldOfView(), ChangeTrajectoryInterval(), ClearAllKeyFrames(), DeleteKeyFrame(), GetStatusString(), GetTrajectoryInterval(), GoToFirst(), GoToLast(), IsPlayingEnd(), IsValidPinholeCameraTrajectory(), LoadTrajectoryFromCameraTrajectory(), LoadTrajectoryFromJsonFile(), NumOfFrames(), NumOfKeyFrames(), SetAnimationMode(), SetViewControlFromTrajectory(), Step(), ToggleTrajectoryLoop(), and UpdateKeyFrame().