3D Forest
Software for analysis of Lidar data from forest environment.
ViewerCamera Class Reference

#include <ViewerCamera.hpp>

Public Member Functions

 ViewerCamera ()
 
 ~ViewerCamera ()
 
void setViewport (int x, int y, int width, int height)
 
int width () const
 
int height () const
 
void updateProjection ()
 
void setPerspective ()
 
void setOrthographic ()
 
void setPerspective (float fovy, float zNear, float zFar)
 
void setPerspective (float fovy, float aspect, float zNear, float zFar)
 
void setLookAt (const QVector3D &center, float distance)
 
void setLookAt (const QVector3D &eye, const QVector3D &center, const QVector3D &up)
 
void setDistance (float distance)
 
float getDistance () const
 
const QVector3D & getEye () const
 
const QVector3D & getCenter () const
 
const QVector3D & getUp () const
 
const QVector3D & getRight () const
 
const QVector3D & getDirection () const
 
QMatrix4x4 rotation () const
 
Camera toCamera () const
 
QVector3D project (const QVector3D &world) const
 
QVector3D unproject (const QVector3D &window) const
 
void getRay (int x, int y, QVector3D *base, QVector3D *direction)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void wheelEvent (QWheelEvent *event)
 
void rotate (int dx, int dy)
 
void pan (int dx, int dy)
 
void zoom (int dy)
 
const QMatrix4x4 & getModelView () const
 
const QMatrix4x4 & getProjection () const
 
const QMatrix4x4 & getModelViewProjection () const
 
const QMatrix4x4 & getModelViewInv () const
 
const QMatrix4x4 & getProjectionInv () const
 
const QMatrix4x4 & getModelViewProjectionInv () const
 

Protected Member Functions

void updateMatrix ()
 
void setModelView (const QMatrix4x4 &m)
 
void setProjection (const QMatrix4x4 &m)
 
void setModelViewProjection (const QMatrix4x4 &m)
 
void updateFrustrum ()
 

Protected Attributes

QVector3D eye_
 
QVector3D center_
 
QVector3D right_
 
QVector3D up_
 
QVector3D direction_
 
QQuaternion rotation_
 
float distance_
 
float fov_
 
float zNear_
 
float zFar_
 
bool perspective_
 
QRect viewport_
 
QMatrix4x4 projection_
 
QMatrix4x4 projectionInv_
 
QMatrix4x4 modelView_
 
QMatrix4x4 modelViewInv_
 
QMatrix4x4 modelViewProjection_
 
QMatrix4x4 modelViewProjectionInv_
 
std::vector< float > frustrumPlanes_
 
QPoint mouseLastPosition_
 
float sensitivityX_
 
float sensitivityY_
 
float sensitivityZoom_
 

Constructor & Destructor Documentation

◆ ViewerCamera()

ViewerCamera::ViewerCamera ( )

◆ ~ViewerCamera()

ViewerCamera::~ViewerCamera ( )

Member Function Documentation

◆ getCenter()

const QVector3D & ViewerCamera::getCenter ( ) const
inline

◆ getDirection()

◆ getDistance()

float ViewerCamera::getDistance ( ) const
inline

◆ getEye()

const QVector3D & ViewerCamera::getEye ( ) const
inline

◆ getModelView()

const QMatrix4x4 & ViewerCamera::getModelView ( ) const
inline

◆ getModelViewInv()

const QMatrix4x4 & ViewerCamera::getModelViewInv ( ) const
inline

◆ getModelViewProjection()

const QMatrix4x4 & ViewerCamera::getModelViewProjection ( ) const
inline

◆ getModelViewProjectionInv()

const QMatrix4x4 & ViewerCamera::getModelViewProjectionInv ( ) const
inline

◆ getProjection()

const QMatrix4x4 & ViewerCamera::getProjection ( ) const
inline

◆ getProjectionInv()

const QMatrix4x4 & ViewerCamera::getProjectionInv ( ) const
inline

◆ getRay()

void ViewerCamera::getRay ( int  x,
int  y,
QVector3D *  base,
QVector3D *  direction 
)

◆ getRight()

const QVector3D & ViewerCamera::getRight ( ) const
inline

◆ getUp()

const QVector3D & ViewerCamera::getUp ( ) const
inline

◆ height()

int ViewerCamera::height ( ) const
inline

◆ mouseMoveEvent()

void ViewerCamera::mouseMoveEvent ( QMouseEvent *  event)

◆ mousePressEvent()

void ViewerCamera::mousePressEvent ( QMouseEvent *  event)

◆ pan()

void ViewerCamera::pan ( int  dx,
int  dy 
)

Referenced by mouseMoveEvent().

◆ project()

QVector3D ViewerCamera::project ( const QVector3D &  world) const

◆ rotate()

void ViewerCamera::rotate ( int  dx,
int  dy 
)

Referenced by mouseMoveEvent().

◆ rotation()

QMatrix4x4 ViewerCamera::rotation ( ) const

◆ setDistance()

void ViewerCamera::setDistance ( float  distance)

Referenced by setLookAt(), and zoom().

◆ setLookAt() [1/2]

◆ setLookAt() [2/2]

void ViewerCamera::setLookAt ( const QVector3D &  eye,
const QVector3D &  center,
const QVector3D &  up 
)

◆ setModelView()

void ViewerCamera::setModelView ( const QMatrix4x4 &  m)
protected

Referenced by updateMatrix().

◆ setModelViewProjection()

void ViewerCamera::setModelViewProjection ( const QMatrix4x4 &  m)
protected

Referenced by setModelView(), and setProjection().

◆ setOrthographic()

void ViewerCamera::setOrthographic ( )

◆ setPerspective() [1/3]

void ViewerCamera::setPerspective ( )

◆ setPerspective() [2/3]

void ViewerCamera::setPerspective ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)

◆ setPerspective() [3/3]

void ViewerCamera::setPerspective ( float  fovy,
float  zNear,
float  zFar 
)

◆ setProjection()

void ViewerCamera::setProjection ( const QMatrix4x4 &  m)
protected

Referenced by setOrthographic(), and setPerspective().

◆ setViewport()

void ViewerCamera::setViewport ( int  x,
int  y,
int  width,
int  height 
)

◆ toCamera()

Camera ViewerCamera::toCamera ( ) const

◆ unproject()

QVector3D ViewerCamera::unproject ( const QVector3D &  window) const

◆ updateFrustrum()

void ViewerCamera::updateFrustrum ( )
protected

Referenced by setModelViewProjection().

◆ updateMatrix()

void ViewerCamera::updateMatrix ( )
protected

Referenced by pan(), rotate(), setDistance(), and setLookAt().

◆ updateProjection()

void ViewerCamera::updateProjection ( )

◆ wheelEvent()

void ViewerCamera::wheelEvent ( QWheelEvent *  event)

◆ width()

int ViewerCamera::width ( ) const
inline

◆ zoom()

void ViewerCamera::zoom ( int  dy)

Referenced by mouseMoveEvent(), and wheelEvent().

Member Data Documentation

◆ center_

QVector3D ViewerCamera::center_
protected

◆ direction_

QVector3D ViewerCamera::direction_
protected

Referenced by getDirection(), and updateMatrix().

◆ distance_

float ViewerCamera::distance_
protected

◆ eye_

QVector3D ViewerCamera::eye_
protected

Referenced by getEye(), toCamera(), and updateMatrix().

◆ fov_

float ViewerCamera::fov_
protected

◆ frustrumPlanes_

std::vector<float> ViewerCamera::frustrumPlanes_
protected

Referenced by updateFrustrum(), and ViewerCamera().

◆ modelView_

QMatrix4x4 ViewerCamera::modelView_
protected

◆ modelViewInv_

QMatrix4x4 ViewerCamera::modelViewInv_
protected

◆ modelViewProjection_

QMatrix4x4 ViewerCamera::modelViewProjection_
protected

◆ modelViewProjectionInv_

QMatrix4x4 ViewerCamera::modelViewProjectionInv_
protected

◆ mouseLastPosition_

QPoint ViewerCamera::mouseLastPosition_
protected

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ perspective_

bool ViewerCamera::perspective_
protected

◆ projection_

QMatrix4x4 ViewerCamera::projection_
protected

◆ projectionInv_

QMatrix4x4 ViewerCamera::projectionInv_
protected

◆ right_

QVector3D ViewerCamera::right_
protected

Referenced by getRight(), pan(), and updateMatrix().

◆ rotation_

QQuaternion ViewerCamera::rotation_
protected

◆ sensitivityX_

float ViewerCamera::sensitivityX_
protected

Referenced by pan(), and rotate().

◆ sensitivityY_

float ViewerCamera::sensitivityY_
protected

Referenced by pan(), and rotate().

◆ sensitivityZoom_

float ViewerCamera::sensitivityZoom_
protected

Referenced by zoom().

◆ up_

QVector3D ViewerCamera::up_
protected

Referenced by getUp(), pan(), toCamera(), and updateMatrix().

◆ viewport_

QRect ViewerCamera::viewport_
protected

◆ zFar_

float ViewerCamera::zFar_
protected

Referenced by setOrthographic(), and setPerspective().

◆ zNear_

float ViewerCamera::zNear_
protected

Referenced by setOrthographic(), and setPerspective().


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