cherish
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
GLWidget Class Reference

A proxy class connecting QOpenGLWidget with the content of RootScene; and also to transmit events. More...

#include <GLWidget.h>

Inheritance diagram for GLWidget:

Public Slots

void onFOVChangedSlider (double fov)
 
void onOrthoSet (bool ortho)
 

Signals

void autoSwitchMode (cher::MOUSE_MODE mode)
 
void mouseModeSet (cher::MOUSE_MODE mode)
 
void FOVSet (double fov)
 
void importPhoto (const QString &path, const QString &fileName)
 

Public Member Functions

 GLWidget (RootScene *root, QUndoStack *stack, QWidget *parent=0, Qt::WindowFlags f=0)
 
osg::Camera * getCamera () const
 
void setCameraView (const osg::Vec3d &eye, const osg::Vec3d &center, const osg::Vec3d &up, const double &fov2)
 
void getCameraView (osg::Vec3d &eye, osg::Vec3d &center, osg::Vec3d &up, double &fov) const
 
void setMouseMode (const cher::MOUSE_MODE &mode)
 
const cher::MOUSE_MODE getMouseMode () const
 
cher::MOUSE_MODE getMousePrevious () const
 
void setTabletActivity (bool active)
 
QPixmap getScreenShot (const osg::Vec3d &eye, const osg::Vec3d &center, const osg::Vec3d &up)
 
virtual void onHome ()
 

Protected Member Functions

void setCameraView ()
 
virtual void initializeGL ()
 
virtual void paintGL ()
 
virtual void resizeGL (int w, int h)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
virtual bool event (QEvent *event)
 
void dragEnterEvent (QDragEnterEvent *event)
 
void dragLeaveEvent (QDragLeaveEvent *event)
 
void dragMoveEvent (QDragMoveEvent *event)
 
void dropEvent (QDropEvent *event)
 

Detailed Description

A proxy class connecting QOpenGLWidget with the content of RootScene; and also to transmit events.

Constructor & Destructor Documentation

§ GLWidget()

GLWidget::GLWidget ( RootScene root,
QUndoStack *  stack,
QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

Construtor.

Member Function Documentation

§ autoSwitchMode

void GLWidget::autoSwitchMode ( cher::MOUSE_MODE  mode)
signal

Signal is emitted on double click to automatically switch the mouse mode.

§ FOVSet

void GLWidget::FOVSet ( double  fov)
signal

Signal is emitted when FOV was changed.

§ getCamera()

osg::Camera * GLWidget::getCamera ( ) const
Returns
a non-const pointer on osg::Camera that is current for the GLWidget.

§ getCameraView()

void GLWidget::getCameraView ( osg::Vec3d &  eye,
osg::Vec3d &  center,
osg::Vec3d &  up,
double &  fov 
) const

Method to return manipulator's camera parameters.

§ getMouseMode()

const cher::MOUSE_MODE GLWidget::getMouseMode ( ) const
Returns
current mouse mode.

§ getMousePrevious()

cher::MOUSE_MODE GLWidget::getMousePrevious ( ) const
Returns
a mouse mode which was before the current one.

§ getScreenShot()

QPixmap GLWidget::getScreenShot ( const osg::Vec3d &  eye,
const osg::Vec3d &  center,
const osg::Vec3d &  up 
)

Method to obtain a scene graph screenshot by given camera position. This method resets the view back to what it was before the screenshot was taken.

§ importPhoto

void GLWidget::importPhoto ( const QString &  path,
const QString &  fileName 
)
signal

Signal is emitted when user performs drag-and-drop from PhotoWidget to GLWidget.

§ mouseModeSet

void GLWidget::mouseModeSet ( cher::MOUSE_MODE  mode)
signal

Signal is emitted when mouse mode was set. It is connected to MainWindow::onMouseModeSet().

§ onFOVChangedSlider

void GLWidget::onFOVChangedSlider ( double  fov)
slot
Parameters
fovis the new FOV (to change manipulator's camera)

§ onOrthoSet

void GLWidget::onOrthoSet ( bool  ortho)
slot
Parameters
ortho- true of "ortho" mode is set, false - otherwise.

§ setCameraView()

void GLWidget::setCameraView ( const osg::Vec3d &  eye,
const osg::Vec3d &  center,
const osg::Vec3d &  up,
const double &  fov2 
)

Method to set up the manipulator to specified camera paramenters.

Parameters
fov2is the full angle FOV, in degrees.

§ setMouseMode()

void GLWidget::setMouseMode ( const cher::MOUSE_MODE mode)
Parameters
modeis the mouse mode to set up for the GLWidget and whole application.

§ setTabletActivity()

void GLWidget::setTabletActivity ( bool  active)

Method to set tablet proximity flag.


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