ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::visualization::ViewControlWithCustomAnimation Class Reference

#include <ViewControlWithCustomAnimation.h>

Inheritance diagram for cloudViewer::visualization::ViewControlWithCustomAnimation:
Collaboration diagram for cloudViewer::visualization::ViewControlWithCustomAnimation:

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 &parameters)
 
bool ConvertFromPinholeCameraParameters (const camera::PinholeCameraParameters &parameters, 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 ccBBoxGetBoundingBox () 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
 

Detailed Description

Definition at line 17 of file ViewControlWithCustomAnimation.h.

Member Enumeration Documentation

◆ AnimationMode

Enumerator
FreeMode 
PreviewMode 
PlayMode 

Definition at line 19 of file ViewControlWithCustomAnimation.h.

Constructor & Destructor Documentation

◆ ~ViewControlWithCustomAnimation()

virtual cloudViewer::visualization::ViewControlWithCustomAnimation::~ViewControlWithCustomAnimation ( )
inlinevirtual

Definition at line 26 of file ViewControlWithCustomAnimation.h.

Member Function Documentation

◆ AddKeyFrame()

◆ AddSpinKeyFrames()

void cloudViewer::visualization::ViewControlWithCustomAnimation::AddSpinKeyFrames ( int  num_of_key_frames = 20)

◆ CaptureTrajectory()

bool cloudViewer::visualization::ViewControlWithCustomAnimation::CaptureTrajectory ( const std::string &  filename = "")

◆ ChangeFieldOfView()

◆ ChangeTrajectoryInterval()

void cloudViewer::visualization::ViewControlWithCustomAnimation::ChangeTrajectoryInterval ( int  change)
inline

◆ ClearAllKeyFrames()

void cloudViewer::visualization::ViewControlWithCustomAnimation::ClearAllKeyFrames ( )
inline

◆ CurrentFrame()

size_t cloudViewer::visualization::ViewControlWithCustomAnimation::CurrentFrame ( ) const
inlineprotected

Definition at line 73 of file ViewControlWithCustomAnimation.h.

References current_frame_.

Referenced by GetStatusString(), and SetViewControlFromTrajectory().

◆ CurrentKeyframe()

size_t cloudViewer::visualization::ViewControlWithCustomAnimation::CurrentKeyframe ( ) const
inlineprotected

◆ DeleteKeyFrame()

◆ GetStatusString()

◆ GetTrajectoryInterval()

int cloudViewer::visualization::ViewControlWithCustomAnimation::GetTrajectoryInterval ( ) const
inline

◆ GoToFirst()

void cloudViewer::visualization::ViewControlWithCustomAnimation::GoToFirst ( )

◆ GoToLast()

◆ IsPlaying()

bool cloudViewer::visualization::ViewControlWithCustomAnimation::IsPlaying ( )
inline

Definition at line 66 of file ViewControlWithCustomAnimation.h.

References animation_mode_.

Referenced by IsPlayingEnd().

◆ IsPlayingEnd()

bool cloudViewer::visualization::ViewControlWithCustomAnimation::IsPlayingEnd ( size_t  num)
inline

◆ IsPreviewing()

bool cloudViewer::visualization::ViewControlWithCustomAnimation::IsPreviewing ( )
inline

Definition at line 63 of file ViewControlWithCustomAnimation.h.

References animation_mode_.

◆ IsValidPinholeCameraTrajectory()

bool cloudViewer::visualization::ViewControlWithCustomAnimation::IsValidPinholeCameraTrajectory ( ) const

◆ LoadTrajectoryFromCameraTrajectory()

◆ LoadTrajectoryFromJsonFile()

bool cloudViewer::visualization::ViewControlWithCustomAnimation::LoadTrajectoryFromJsonFile ( const std::string &  filename)

◆ NumOfFrames()

size_t cloudViewer::visualization::ViewControlWithCustomAnimation::NumOfFrames ( ) const
inline

◆ NumOfKeyFrames()

size_t cloudViewer::visualization::ViewControlWithCustomAnimation::NumOfKeyFrames ( ) const
inline

◆ RegularizeFrameIndex()

double cloudViewer::visualization::ViewControlWithCustomAnimation::RegularizeFrameIndex ( double  current_frame,
size_t  num_of_frames,
bool  is_loop 
)
protected

Definition at line 286 of file ViewControlWithCustomAnimation.cpp.

Referenced by DeleteKeyFrame(), and Step().

◆ Reset()

void cloudViewer::visualization::ViewControlWithCustomAnimation::Reset ( )
overridevirtual

◆ Rotate()

void cloudViewer::visualization::ViewControlWithCustomAnimation::Rotate ( double  x,
double  y,
double  xo,
double  yo 
)
overridevirtual

Function to process rotation.

Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.

Parameters
xThe distance the mouse cursor has moved in x-axis.
yThe distance the mouse cursor has moved in y-axis.
xoOriginal point coordinate of the mouse in x-axis.
yoOriginal 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().

◆ Scale()

void cloudViewer::visualization::ViewControlWithCustomAnimation::Scale ( double  scale)
overridevirtual

Function to process scaling

Parameters
scaleis the scale ratio.

Reimplemented from cloudViewer::visualization::ViewControl.

Definition at line 45 of file ViewControlWithCustomAnimation.cpp.

References animation_mode_, and cloudViewer::visualization::ViewControl::Scale().

◆ SetAnimationMode()

◆ SetViewControlFromTrajectory()

◆ Step()

◆ ToggleTrajectoryLoop()

void cloudViewer::visualization::ViewControlWithCustomAnimation::ToggleTrajectoryLoop ( )
inline

◆ Translate()

void cloudViewer::visualization::ViewControlWithCustomAnimation::Translate ( double  x,
double  y,
double  xo,
double  yo 
)
overridevirtual

Function to process translation.

Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.

Parameters
xDistance the mouse cursor has moved in x-axis.
yDistance the mouse cursor has moved in y-axis.
xoOriginal point coordinate of the mouse in x-axis.
yoOriginal 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().

◆ UpdateKeyFrame()

void cloudViewer::visualization::ViewControlWithCustomAnimation::UpdateKeyFrame ( )

Member Data Documentation

◆ animation_mode_

◆ current_frame_

double cloudViewer::visualization::ViewControlWithCustomAnimation::current_frame_ = 0.0
protected

◆ current_keyframe_

double cloudViewer::visualization::ViewControlWithCustomAnimation::current_keyframe_ = 0.0
protected

◆ view_trajectory_


The documentation for this class was generated from the following files: