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

View controller for visualizer. More...

#include <ViewControl.h>

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

Public Types

enum  ProjectionType { Perspective = 0 , Orthogonal = 1 }
 

Public Member Functions

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, bool allow_arbitrary=false)
 
ProjectionType GetProjectionType () const
 
void SetProjectionParameters ()
 
virtual void Reset ()
 
virtual void ChangeFieldOfView (double step)
 
virtual void ChangeWindowSize (int width, int height)
 
geometry::Ray3D UnprojectPoint (double x, double y) const
 
virtual void Scale (double scale)
 
virtual void Rotate (double x, double y, double xo=0.0, double yo=0.0)
 Function to process rotation. More...
 
virtual void Translate (double x, double y, double xo=0.0, double yo=0.0)
 Function to process translation. More...
 
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 geometry::AxisAlignedBoundingBoxGetBoundingBox () const
 
void ResetBoundingBox ()
 
void FitInGeometry (const geometry::Geometry &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 ()
 

Static Public Attributes

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
 

Protected Attributes

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
 
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_
 

Detailed Description

View controller for visualizer.

Member Enumeration Documentation

◆ ProjectionType

Enumerator
Perspective 
Orthogonal 

Constructor & Destructor Documentation

◆ ~ViewControl()

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

Member Function Documentation

◆ CameraLocalRotate()

void open3d::visualization::ViewControl::CameraLocalRotate ( double  x,
double  y,
double  xo = 0.0,
double  yo = 0.0 
)
virtual

◆ CameraLocalTranslate()

void open3d::visualization::ViewControl::CameraLocalTranslate ( double  forward,
double  right,
double  up 
)
virtual

◆ ChangeFieldOfView()

void open3d::visualization::ViewControl::ChangeFieldOfView ( double  step)
virtual

Function to change field of view.

Parameters
stepThe step to change field of view.

Reimplemented in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.

◆ ChangeWindowSize()

void open3d::visualization::ViewControl::ChangeWindowSize ( int  width,
int  height 
)
virtual

◆ ConvertFromPinholeCameraParameters()

bool open3d::visualization::ViewControl::ConvertFromPinholeCameraParameters ( const camera::PinholeCameraParameters parameters,
bool  allow_arbitrary = false 
)

Function to get view controller from pinhole camera parameters.

Parameters
parametersThe pinhole camera parameter to convert from.
allow_arbitraryAllow an arbitrary pinhole camera parameters. This can be useful to render images or depthmaps without any restriction in window size, FOV and zoom.

◆ ConvertFromViewParameters()

bool open3d::visualization::ViewControl::ConvertFromViewParameters ( const ViewParameters status)

◆ ConvertToPinholeCameraParameters()

bool open3d::visualization::ViewControl::ConvertToPinholeCameraParameters ( camera::PinholeCameraParameters parameters)

Function to get equivalent pinhole camera parameters (does not support orthogonal since it is not a real camera view).

Parameters
parametersThe pinhole camera parameter to convert to.

◆ ConvertToViewParameters()

bool open3d::visualization::ViewControl::ConvertToViewParameters ( ViewParameters status) const

Function to get equivalent view parameters (support orthogonal)

◆ FitInGeometry()

void open3d::visualization::ViewControl::FitInGeometry ( const geometry::Geometry geometry)
inline

◆ GetBoundingBox()

const geometry::AxisAlignedBoundingBox& open3d::visualization::ViewControl::GetBoundingBox ( ) const
inline

◆ GetEye()

gl_util::GLVector3f open3d::visualization::ViewControl::GetEye ( ) const
inline

◆ GetFieldOfView()

double open3d::visualization::ViewControl::GetFieldOfView ( ) const
inline

Function to get field of view.

◆ GetFront()

gl_util::GLVector3f open3d::visualization::ViewControl::GetFront ( ) const
inline

◆ GetLookat()

gl_util::GLVector3f open3d::visualization::ViewControl::GetLookat ( ) const
inline

◆ GetModelMatrix()

gl_util::GLMatrix4f open3d::visualization::ViewControl::GetModelMatrix ( ) const
inline

◆ GetMVPMatrix()

gl_util::GLMatrix4f open3d::visualization::ViewControl::GetMVPMatrix ( ) const
inline

◆ GetProjectionMatrix()

gl_util::GLMatrix4f open3d::visualization::ViewControl::GetProjectionMatrix ( ) const
inline

◆ GetProjectionType()

ViewControl::ProjectionType open3d::visualization::ViewControl::GetProjectionType ( ) const

◆ GetRight()

gl_util::GLVector3f open3d::visualization::ViewControl::GetRight ( ) const
inline

◆ GetUp()

gl_util::GLVector3f open3d::visualization::ViewControl::GetUp ( ) const
inline

◆ GetViewMatrix()

gl_util::GLMatrix4f open3d::visualization::ViewControl::GetViewMatrix ( ) const
inline

◆ GetWindowHeight()

int open3d::visualization::ViewControl::GetWindowHeight ( ) const
inline

◆ GetWindowWidth()

int open3d::visualization::ViewControl::GetWindowWidth ( ) const
inline

◆ GetZFar()

double open3d::visualization::ViewControl::GetZFar ( ) const
inline

◆ GetZNear()

double open3d::visualization::ViewControl::GetZNear ( ) const
inline

◆ Reset()

void open3d::visualization::ViewControl::Reset ( )
virtual

◆ ResetBoundingBox()

void open3d::visualization::ViewControl::ResetBoundingBox ( )
inline

◆ ResetCameraLocalRotate()

void open3d::visualization::ViewControl::ResetCameraLocalRotate ( )
virtual

◆ Roll()

void open3d::visualization::ViewControl::Roll ( double  x)
virtual
Parameters
xis the distances the mouse cursor has moved. Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.

◆ Rotate()

void open3d::visualization::ViewControl::Rotate ( double  x,
double  y,
double  xo = 0.0,
double  yo = 0.0 
)
virtual

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 in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.

◆ Scale()

void open3d::visualization::ViewControl::Scale ( double  scale)
virtual

Function to process scaling

Parameters
scaleis the scale ratio.

Reimplemented in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.

◆ SetConstantZFar()

void open3d::visualization::ViewControl::SetConstantZFar ( double  z_far)
inline

Function to change the far z-plane of the visualizer to a constant value, i.e., independent of zoom and bounding box size.

Parameters
z_farThe depth of the far z-plane of the visualizer.

◆ SetConstantZNear()

void open3d::visualization::ViewControl::SetConstantZNear ( double  z_near)
inline

Function to change the near z-plane of the visualizer to a constant value, i.e., independent of zoom and bounding box size.

Parameters
z_nearThe depth of the near z-plane of the visualizer.

◆ SetFront()

void open3d::visualization::ViewControl::SetFront ( const Eigen::Vector3d &  front)

◆ SetLookat()

void open3d::visualization::ViewControl::SetLookat ( const Eigen::Vector3d &  lookat)

◆ SetProjectionParameters()

void open3d::visualization::ViewControl::SetProjectionParameters ( )

◆ SetUp()

void open3d::visualization::ViewControl::SetUp ( const Eigen::Vector3d &  up)

◆ SetViewMatrices()

void open3d::visualization::ViewControl::SetViewMatrices ( const Eigen::Matrix4d &  model_matrix = Eigen::Matrix4d::Identity())

Function to set view points This function obtains OpenGL context and calls OpenGL functions to set the view point.

◆ SetZoom()

void open3d::visualization::ViewControl::SetZoom ( const double  zoom)

◆ Translate()

void open3d::visualization::ViewControl::Translate ( double  x,
double  y,
double  xo = 0.0,
double  yo = 0.0 
)
virtual

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 in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.

◆ UnprojectPoint()

geometry::Ray3D open3d::visualization::ViewControl::UnprojectPoint ( double  x,
double  y 
) const

Function to unproject a point on the window and obtain a ray from the camera to that point in 3D.

Parameters
xThe coordinate of the point in x-axis, in pixels
yThe coordinate of the point in y-axis, in pixels

◆ UnsetConstantZFar()

void open3d::visualization::ViewControl::UnsetConstantZFar ( )
inline

Function to remove a previously set constant z far value, i.e., far z-plane of the visualizer is dynamically set dependent on zoom and bounding box size.

◆ UnsetConstantZNear()

void open3d::visualization::ViewControl::UnsetConstantZNear ( )
inline

Function to remove a previously set constant z near value, i.e., near z-plane of the visualizer is dynamically set dependent on zoom and bounding box size.

Field Documentation

◆ aspect_

double open3d::visualization::ViewControl::aspect_
protected

◆ bounding_box_

geometry::AxisAlignedBoundingBox open3d::visualization::ViewControl::bounding_box_
protected

◆ constant_z_far_

double open3d::visualization::ViewControl::constant_z_far_ = -1
protected

◆ constant_z_near_

double open3d::visualization::ViewControl::constant_z_near_ = -1
protected

◆ distance_

double open3d::visualization::ViewControl::distance_
protected

◆ eye_

Eigen::Vector3d open3d::visualization::ViewControl::eye_
protected

◆ field_of_view_

double open3d::visualization::ViewControl::field_of_view_
protected

◆ FIELD_OF_VIEW_DEFAULT

const double open3d::visualization::ViewControl::FIELD_OF_VIEW_DEFAULT = 60.0
static

◆ FIELD_OF_VIEW_MAX

const double open3d::visualization::ViewControl::FIELD_OF_VIEW_MAX = 90.0
static

◆ FIELD_OF_VIEW_MIN

const double open3d::visualization::ViewControl::FIELD_OF_VIEW_MIN = 5.0
static

◆ FIELD_OF_VIEW_STEP

const double open3d::visualization::ViewControl::FIELD_OF_VIEW_STEP = 5.0
static

◆ front_

Eigen::Vector3d open3d::visualization::ViewControl::front_
protected

◆ local_rotate_right_accum_

double open3d::visualization::ViewControl::local_rotate_right_accum_
protected

◆ local_rotate_up_accum_

double open3d::visualization::ViewControl::local_rotate_up_accum_
protected

◆ lookat_

Eigen::Vector3d open3d::visualization::ViewControl::lookat_
protected

◆ model_matrix_

gl_util::GLMatrix4f open3d::visualization::ViewControl::model_matrix_
protected

◆ MVP_matrix_

gl_util::GLMatrix4f open3d::visualization::ViewControl::MVP_matrix_
protected

◆ projection_matrix_

gl_util::GLMatrix4f open3d::visualization::ViewControl::projection_matrix_
protected

◆ right_

Eigen::Vector3d open3d::visualization::ViewControl::right_
protected

◆ ROTATION_RADIAN_PER_PIXEL

const double open3d::visualization::ViewControl::ROTATION_RADIAN_PER_PIXEL = 0.003
static

◆ start_local_rotate_eye_

Eigen::Vector3d open3d::visualization::ViewControl::start_local_rotate_eye_
protected

◆ start_local_rotate_front_

Eigen::Vector3d open3d::visualization::ViewControl::start_local_rotate_front_
protected

◆ start_local_rotate_lookat_

Eigen::Vector3d open3d::visualization::ViewControl::start_local_rotate_lookat_
protected

◆ start_local_rotate_right_

Eigen::Vector3d open3d::visualization::ViewControl::start_local_rotate_right_
protected

◆ start_local_rotate_up_

Eigen::Vector3d open3d::visualization::ViewControl::start_local_rotate_up_
protected

◆ up_

Eigen::Vector3d open3d::visualization::ViewControl::up_
protected

◆ view_matrix_

gl_util::GLMatrix4f open3d::visualization::ViewControl::view_matrix_
protected

◆ view_ratio_

double open3d::visualization::ViewControl::view_ratio_
protected

◆ window_height_

int open3d::visualization::ViewControl::window_height_ = 0
protected

◆ window_width_

int open3d::visualization::ViewControl::window_width_ = 0
protected

◆ z_far_

double open3d::visualization::ViewControl::z_far_
protected

◆ z_near_

double open3d::visualization::ViewControl::z_near_
protected

◆ zoom_

double open3d::visualization::ViewControl::zoom_
protected

◆ ZOOM_DEFAULT

const double open3d::visualization::ViewControl::ZOOM_DEFAULT = 0.7
static

◆ ZOOM_MAX

const double open3d::visualization::ViewControl::ZOOM_MAX = 2.0
static

◆ ZOOM_MIN

const double open3d::visualization::ViewControl::ZOOM_MIN = 0.02
static

◆ ZOOM_STEP

const double open3d::visualization::ViewControl::ZOOM_STEP = 0.02
static

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