Molecule Viewer
 All Classes Functions Variables Enumerations Pages
Public Member Functions | Protected Member Functions | List of all members
Widget Class Reference

QT OpenGL Widget where the molecule is rendered inside. More...

#include <widget.h>

Inheritance diagram for Widget:

Public Member Functions

 Widget (QWidget *parent=0)
 Creates the OpenGL Widget and initializes the OpenGL rendering context.
 
 Widget (QWidget *parent, QGLFormat const &p_format)
 Creates the OpenGL Widget and initializes the OpenGL rendering context with a given OGL format.
 
 ~Widget ()
 Deletes the OpenGL Widget.
 
void setMainApp (AppMain *mainapp)
 Sets the main render object, used to control the rendering. More...
 

Protected Member Functions

virtual void initializeGL ()
 Some initializations (including GLEW)
 
virtual void paintGL ()
 Renders the molecule to the OpenGL widget.
 
virtual void resizeGL (int w, int h)
 Callback function: Open GL Window Size was changed. More...
 
virtual void mouseMoveEvent (QMouseEvent *event)
 Callback function: Mouse was moved. Different actions depending on the mouse button state. More...
 
virtual void mousePressEvent (QMouseEvent *event)
 Callback function: Mouse button was pressed, just an update of the mouse button state.
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 Callback function: Mouse button was released, just an update of the mouse button state.
 
virtual void wheelEvent (QWheelEvent *event)
 Callback function: Zoom in or out if the mouse wheel was changed. More...
 

Detailed Description

QT OpenGL Widget where the molecule is rendered inside.

Definition at line 20 of file widget.h.

Member Function Documentation

void Widget::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

Callback function: Mouse was moved. Different actions depending on the mouse button state.

-Rotate Molecule around origin (when left mouse button is pressed) -Rotate Light around Molecule (when right mouse button is pressed) -Move Camera left/right and up/down (when middle mouse button is pressed)

Renders the scene again after the transformation.

Definition at line 86 of file widget.cpp.

void Widget::resizeGL ( int  w,
int  h 
)
protectedvirtual

Callback function: Open GL Window Size was changed.

Notify other objects about this change (-> change the scene's camera projection matrix). Renders the scene again after this change.

Definition at line 62 of file widget.cpp.

void Widget::setMainApp ( AppMain mainapp)

Sets the main render object, used to control the rendering.

Also does some the OpenGL initializations in this function.

Definition at line 13 of file widget.cpp.

void Widget::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Callback function: Zoom in or out if the mouse wheel was changed.

Renders the scene again after the transformation.

Definition at line 79 of file widget.cpp.


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