snark
Public Member Functions | Protected Member Functions | List of all members
view Class Reference

base class for 3d viewers with mouse navigation More...

#include <view.h>

Inherits QGLView.

Inherited by Viewer, and Viewer.

Public Member Functions

 view (const QColor4ub &background_color, double fov, bool z_up, bool orthographic=false)

Protected Member Functions

void draw_coordinates (QGLPainter *painter)
 draw a coordinate system centered on the scene rotation center
boost::optional< QVector3D > getPoint (const QPoint &point2d)
 get 3d world point from clicked position
void lookAtCenter ()
 setup the camera to look at the scene center
void mouseDoubleClickEvent (QMouseEvent *e)
 handle mouse double click: set rotation point
void mouseMoveEvent (QMouseEvent *e)
 handle mouse move: pan or rotate the view ( using sphere rotation )
void mousePressEvent (QMouseEvent *e)
 handle mouse press
void mouseReleaseEvent (QMouseEvent *e)
 handle mouse release
QVector3D unproject (float x, float y, float depth)
 return 3d point in world coordinate from pixel coordinates and depth
void updateView (const QVector3D &min, const QVector3D &max)
 update the scene radius and center to display the region between
void updateZFar ()
 update the position of the far plane so that the full scene is displayed
void wheelEvent (QWheelEvent *e)
 handle mouse wheel: zoom in the scene

Detailed Description

base class for 3d viewers with mouse navigation

Constructor & Destructor Documentation

view ( const QColor4ub &  background_color,
double  fov,
bool  z_up,
bool  orthographic = false 
)

constructor

Parameters
background_colorbackground color
fovcamera field of view in degrees
z_upif true, the z-axis is pointing up, if false it is pointing down
orthographicuse orthographic projection instead of perspective

Member Function Documentation

void updateView ( const QVector3D &  min,
const QVector3D &  max 
)
protected

update the scene radius and center to display the region between

Parameters
minand
max

References view::updateZFar().


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