Open3D (C++ API)
0.18.0+252c867
|
View controller for visualizer. More...
#include <ViewControl.h>
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 ¶meters) |
bool | ConvertFromPinholeCameraParameters (const camera::PinholeCameraParameters ¶meters, 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::AxisAlignedBoundingBox & | GetBoundingBox () 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_ |
View controller for visualizer.
|
inlinevirtual |
|
virtual |
|
virtual |
|
virtual |
Function to change field of view.
step | The step to change field of view. |
Reimplemented in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.
|
virtual |
bool open3d::visualization::ViewControl::ConvertFromPinholeCameraParameters | ( | const camera::PinholeCameraParameters & | parameters, |
bool | allow_arbitrary = false |
||
) |
Function to get view controller from pinhole camera parameters.
parameters | The pinhole camera parameter to convert from. |
allow_arbitrary | Allow an arbitrary pinhole camera parameters. This can be useful to render images or depthmaps without any restriction in window size, FOV and zoom. |
bool open3d::visualization::ViewControl::ConvertFromViewParameters | ( | const ViewParameters & | status | ) |
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 | The pinhole camera parameter to convert to. |
bool open3d::visualization::ViewControl::ConvertToViewParameters | ( | ViewParameters & | status | ) | const |
Function to get equivalent view parameters (support orthogonal)
|
inline |
|
inline |
|
inline |
|
inline |
Function to get field of view.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
ViewControl::ProjectionType open3d::visualization::ViewControl::GetProjectionType | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
|
inline |
|
virtual |
|
virtual |
x | is the distances the mouse cursor has moved. Coordinates are measured in screen coordinates relative to the top-left corner of the window client area. |
|
virtual |
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 in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.
|
virtual |
Function to process scaling
scale | is the scale ratio. |
Reimplemented in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.
|
inline |
Function to change the far z-plane of the visualizer to a constant value, i.e., independent of zoom and bounding box size.
z_far | The depth of the far z-plane of the visualizer. |
|
inline |
Function to change the near z-plane of the visualizer to a constant value, i.e., independent of zoom and bounding box size.
z_near | The depth of the near z-plane of the visualizer. |
void open3d::visualization::ViewControl::SetFront | ( | const Eigen::Vector3d & | front | ) |
void open3d::visualization::ViewControl::SetLookat | ( | const Eigen::Vector3d & | lookat | ) |
void open3d::visualization::ViewControl::SetProjectionParameters | ( | ) |
void open3d::visualization::ViewControl::SetUp | ( | const Eigen::Vector3d & | up | ) |
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.
void open3d::visualization::ViewControl::SetZoom | ( | const double | zoom | ) |
|
virtual |
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 in open3d::visualization::ViewControlWithEditing, and open3d::visualization::ViewControlWithCustomAnimation.
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.
x | The coordinate of the point in x-axis, in pixels |
y | The coordinate of the point in y-axis, in pixels |
|
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.
|
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.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |