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

#include <ViewerCamera.hpp>

Public Member Functions

 ViewerCamera ()
 
 ~ViewerCamera ()
 
void setViewportId (size_t id)
 
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 setLookAt (const QVector3D &dir, float distance, const QVector3D &center, const QVector3D &up)
 
void setDistance (float distance)
 
float distance () const
 
const QVector3D & eye () const
 
const QVector3D & center () const
 
const QVector3D & up () const
 
const QVector3D & right () const
 
const QVector3D & direction () const
 
QMatrix4x4 rotation () const
 
Camera toCamera () const
 
QVector3D project (const QVector3D &world) const
 
QVector3D unproject (const QVector3D &window) const
 
void ray (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 & modelView () const
 
const QMatrix4x4 & projection () const
 
const QMatrix4x4 & modelViewProjection () const
 
const QMatrix4x4 & modelViewInv () const
 
const QMatrix4x4 & projectionInv () const
 
const QMatrix4x4 & modelViewProjectionInv () 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_
 
size_t viewportId_
 
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_
 

Friends

void toJson (Json &out, const ViewerCamera &in)
 
std::string toString (const ViewerCamera &in)
 
std::ostream & operator<< (std::ostream &out, const ViewerCamera &in)
 

Constructor & Destructor Documentation

◆ ViewerCamera()

ViewerCamera::ViewerCamera ( )

◆ ~ViewerCamera()

ViewerCamera::~ViewerCamera ( )

Member Function Documentation

◆ center()

◆ direction()

◆ distance()

◆ eye()

const QVector3D & ViewerCamera::eye ( ) const
inline

◆ height()

int ViewerCamera::height ( ) const
inline

◆ modelView()

const QMatrix4x4 & ViewerCamera::modelView ( ) const
inline

◆ modelViewInv()

const QMatrix4x4 & ViewerCamera::modelViewInv ( ) const
inline

◆ modelViewProjection()

const QMatrix4x4 & ViewerCamera::modelViewProjection ( ) const
inline

◆ modelViewProjectionInv()

const QMatrix4x4 & ViewerCamera::modelViewProjectionInv ( ) 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

◆ projection()

const QMatrix4x4 & ViewerCamera::projection ( ) const
inline

◆ projectionInv()

const QMatrix4x4 & ViewerCamera::projectionInv ( ) const
inline

◆ ray()

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

◆ right()

const QVector3D & ViewerCamera::right ( ) const
inline

Referenced by setLookAt(), and setOrthographic().

◆ 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/3]

◆ setLookAt() [2/3]

void ViewerCamera::setLookAt ( const QVector3D & dir,
float distance,
const QVector3D & center,
const QVector3D & up )

◆ setLookAt() [3/3]

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 )

◆ setViewportId()

void ViewerCamera::setViewportId ( size_t id)

◆ toCamera()

Camera ViewerCamera::toCamera ( ) const

◆ unproject()

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

◆ up()

const QVector3D & ViewerCamera::up ( ) const
inline

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

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const ViewerCamera & in )
friend

◆ toJson

void toJson ( Json & out,
const ViewerCamera & in )
friend

◆ toString

std::string toString ( const ViewerCamera & in)
friend

Member Data Documentation

◆ center_

QVector3D ViewerCamera::center_
protected

◆ direction_

QVector3D ViewerCamera::direction_
protected

Referenced by direction(), and updateMatrix().

◆ distance_

float ViewerCamera::distance_
protected

◆ eye_

QVector3D ViewerCamera::eye_
protected

Referenced by eye(), 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

Referenced by modelViewInv(), ray(), and setModelView().

◆ 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

Referenced by projectionInv(), ray(), and setProjection().

◆ right_

QVector3D ViewerCamera::right_
protected

Referenced by pan(), right(), 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 pan(), toCamera(), up(), and updateMatrix().

◆ viewport_

QRect ViewerCamera::viewport_
protected

◆ viewportId_

size_t ViewerCamera::viewportId_
protected

Referenced by setViewportId(), and toCamera().

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