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

#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

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)
 
bool ConvertToPinholeCameraParameters (camera::PinholeCameraParameters &parameters)
 
bool ConvertFromPinholeCameraParameters (const camera::PinholeCameraParameters &parameters)
 
ProjectionType GetProjectionType () const
 
void SetProjectionParameters ()
 
virtual void Reset ()
 
virtual void ChangeFieldOfView (double step)
 
virtual void ChangeWindowSize (int width, int height)
 
virtual void Scale (double scale)
 
virtual void Rotate (double x, double y, double xo=0.0, double yo=0.0)
 
virtual void Translate (double x, double y, double xo=0.0, double yo=0.0)
 
virtual void Roll (double x)
 
const BoundingBoxGetBoundingBox () const
 
void ResetBoundingBox ()
 
void FitInGeometry (const geometry::Geometry &geometry)
 
double GetFieldOfView () const
 
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
 

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
 
BoundingBox 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_
 
GLHelper::GLMatrix4f projection_matrix_
 
GLHelper::GLMatrix4f view_matrix_
 
GLHelper::GLMatrix4f model_matrix_
 
GLHelper::GLMatrix4f MVP_matrix_
 

Member Enumeration Documentation

◆ ProjectionType

Enumerator
Perspective 
Orthogonal 

Member Function Documentation

◆ ChangeFieldOfView()

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

◆ ChangeWindowSize()

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

◆ ConvertFromPinholeCameraParameters()

bool open3d::visualization::ViewControl::ConvertFromPinholeCameraParameters ( const camera::PinholeCameraParameters parameters)

◆ 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)

◆ 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 BoundingBox& open3d::visualization::ViewControl::GetBoundingBox ( ) const
inline

◆ GetEye()

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

◆ GetFieldOfView()

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

◆ GetFront()

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

◆ GetLookat()

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

◆ GetModelMatrix()

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

◆ GetMVPMatrix()

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

◆ GetProjectionMatrix()

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

◆ GetProjectionType()

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

◆ GetRight()

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

◆ GetUp()

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

◆ GetViewMatrix()

GLHelper::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

◆ 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
Parameters
xand
yare the distances the mouse cursor has moved.
xoand
yoare the original point coordinate the mouse cursor started to move from. Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.

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

◆ Scale()

void open3d::visualization::ViewControl::Scale ( double  scale)
virtual
Parameters
scaleis the relative distance mouse has scrolled.

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

◆ SetProjectionParameters()

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

◆ 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.

◆ Translate()

void open3d::visualization::ViewControl::Translate ( double  x,
double  y,
double  xo = 0.0,
double  yo = 0.0 
)
virtual
Parameters
xand
yare the distances the mouse cursor has moved.
xoand
yoare the original point coordinate the mouse cursor started to move from. Coordinates are measured in screen coordinates relative to the top-left corner of the window client area.

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

Field Documentation

◆ aspect_

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

◆ bounding_box_

BoundingBox open3d::visualization::ViewControl::bounding_box_
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

◆ lookat_

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

◆ model_matrix_

GLHelper::GLMatrix4f open3d::visualization::ViewControl::model_matrix_
protected

◆ MVP_matrix_

GLHelper::GLMatrix4f open3d::visualization::ViewControl::MVP_matrix_
protected

◆ projection_matrix_

GLHelper::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

◆ up_

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

◆ view_matrix_

GLHelper::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: