Open3D (C++ API)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
open3d::visualization::ViewControlWithCustomAnimation Class Reference

#include <ViewControlWithCustomAnimation.h>

Inheritance diagram for open3d::visualization::ViewControlWithCustomAnimation:
open3d::visualization::ViewControl

Public Types

enum  AnimationMode { FreeMode = 0, PreviewMode = 1, PlayMode = 2 }
 
- Public Types inherited from open3d::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 open3d::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 SetLookat (const Eigen::Vector3d &lookat)
 
void SetUp (const Eigen::Vector3d &up)
 
void SetFront (const Eigen::Vector3d &front)
 
void SetZoom (const double zoom)
 
bool ConvertToPinholeCameraParameters (camera::PinholeCameraParameters &parameters)
 
bool ConvertFromPinholeCameraParameters (const camera::PinholeCameraParameters &parameters)
 
ProjectionType GetProjectionType () const
 
void SetProjectionParameters ()
 
virtual void ChangeWindowSize (int width, int height)
 
virtual void Roll (double x)
 
const geometry::AxisAlignedBoundingBoxGetBoundingBox () const
 
void ResetBoundingBox ()
 
void FitInGeometry (const geometry::Geometry &geometry)
 
double GetFieldOfView () const
 Function to get field of view. More...
 
GLHelper::GLMatrix4f GetMVPMatrix () const
 
GLHelper::GLMatrix4f GetProjectionMatrix () const
 
GLHelper::GLMatrix4f GetViewMatrix () const
 
GLHelper::GLMatrix4f GetModelMatrix () const
 
GLHelper::GLVector3f GetEye () const
 
GLHelper::GLVector3f GetLookat () const
 
GLHelper::GLVector3f GetUp () const
 
GLHelper::GLVector3f GetFront () const
 
GLHelper::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 open3d::visualization::ViewControl
int window_width_ = 0
 
int window_height_ = 0
 
geometry::AxisAlignedBoundingBox 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
 
GLHelper::GLMatrix4f projection_matrix_
 
GLHelper::GLMatrix4f view_matrix_
 
GLHelper::GLMatrix4f model_matrix_
 
GLHelper::GLMatrix4f MVP_matrix_
 

Additional Inherited Members

- Static Public Attributes inherited from open3d::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
 

Member Enumeration Documentation

◆ AnimationMode

Enumerator
FreeMode 
PreviewMode 
PlayMode 

Constructor & Destructor Documentation

◆ ~ViewControlWithCustomAnimation()

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

Member Function Documentation

◆ AddKeyFrame()

void open3d::visualization::ViewControlWithCustomAnimation::AddKeyFrame ( )

◆ AddSpinKeyFrames()

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

◆ CaptureTrajectory()

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

◆ ChangeFieldOfView()

void open3d::visualization::ViewControlWithCustomAnimation::ChangeFieldOfView ( double  step)
overridevirtual

Function to change field of view.

Parameters
stepThe step to change field of view.

Reimplemented from open3d::visualization::ViewControl.

◆ ChangeTrajectoryInterval()

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

◆ ClearAllKeyFrames()

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

◆ CurrentFrame()

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

◆ CurrentKeyframe()

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

◆ DeleteKeyFrame()

void open3d::visualization::ViewControlWithCustomAnimation::DeleteKeyFrame ( )

◆ GetStatusString()

std::string open3d::visualization::ViewControlWithCustomAnimation::GetStatusString ( ) const

◆ GetTrajectoryInterval()

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

◆ GoToFirst()

void open3d::visualization::ViewControlWithCustomAnimation::GoToFirst ( )

◆ GoToLast()

void open3d::visualization::ViewControlWithCustomAnimation::GoToLast ( )

◆ IsPlaying()

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

◆ IsPlayingEnd()

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

◆ IsPreviewing()

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

◆ IsValidPinholeCameraTrajectory()

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

◆ LoadTrajectoryFromCameraTrajectory()

bool open3d::visualization::ViewControlWithCustomAnimation::LoadTrajectoryFromCameraTrajectory ( const camera::PinholeCameraTrajectory camera_trajectory)

◆ LoadTrajectoryFromJsonFile()

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

◆ NumOfFrames()

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

◆ NumOfKeyFrames()

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

◆ RegularizeFrameIndex()

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

◆ Reset()

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

◆ Rotate()

void open3d::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 open3d::visualization::ViewControl.

◆ Scale()

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

Function to process scaling

Parameters
scaleis the scale ratio.

Reimplemented from open3d::visualization::ViewControl.

◆ SetAnimationMode()

void open3d::visualization::ViewControlWithCustomAnimation::SetAnimationMode ( AnimationMode  mode)

◆ SetViewControlFromTrajectory()

void open3d::visualization::ViewControlWithCustomAnimation::SetViewControlFromTrajectory ( )
protected

◆ Step()

void open3d::visualization::ViewControlWithCustomAnimation::Step ( double  change)

◆ ToggleTrajectoryLoop()

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

◆ Translate()

void open3d::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 open3d::visualization::ViewControl.

◆ UpdateKeyFrame()

void open3d::visualization::ViewControlWithCustomAnimation::UpdateKeyFrame ( )

Field Documentation

◆ animation_mode_

AnimationMode open3d::visualization::ViewControlWithCustomAnimation::animation_mode_ = AnimationMode::FreeMode
protected

◆ current_frame_

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

◆ current_keyframe_

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

◆ view_trajectory_

ViewTrajectory open3d::visualization::ViewControlWithCustomAnimation::view_trajectory_
protected

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