9 #include <QOpenGLWidget>
10 #include <QOpenGLFunctions_3_1>
12 #include <QOpenGLFunctions>
13 #include <QOpenGLBuffer>
14 #include <QOpenGLShaderProgram>
27 class Canvas:
public QOpenGLWidget,
protected QOpenGLFunctions
32 Canvas(QWidget *parent = 0);
45 virtual void resizeGL(
int width,
int height);
113 QOpenGLShaderProgram mainShader;
118 QOpenGLFramebufferObject* sceneFBO;
123 GLuint sceneDepthTexture;
128 QOpenGLShaderProgram haloShader;
133 QOpenGLFramebufferObject* haloFBO;
138 QOpenGLShaderProgram edgeShader;
143 QOpenGLFramebufferObject* edgeFBO;
148 QOpenGLShaderProgram shadowMapShader;
153 QOpenGLShaderProgram occlusionMapShader;
158 QOpenGLFramebufferObject* occlusionMapFBO;
163 GLuint shadowMapTexture;
168 QOpenGLShaderProgram postprocessShader;
174 QOpenGLBuffer quadVertexBuffer;
179 QOpenGLBuffer quadUVBuffer;
184 QOpenGLVertexArrayObject postProcessVAO;
189 void initializeShaders();
194 void initializeQuad();
199 void initializeFrameBufferObjects();
204 void destroyFrameBufferObjects();
virtual void mouseMoveEvent(QMouseEvent *event)
mouseMoveEvent - Callback Function for when the Mouse is being moved
Definition: Canvas.cpp:245
void drawPostProcess()
drawPostProcess - calculates the post process edge cueing effects, contours and halos ...
Definition: Canvas.cpp:193
The Molecule class - This class represents a molecule. It consists of atoms and bonds.
Definition: Molecule.h:70
The Canvas class - represents the main class of our application, since the whole logic and the calls ...
Definition: Canvas.h:27
void drawHalos()
drawHalos - Draws the previously rendered scene from the framebuffer onto the screen with postprocess...
Definition: Canvas.cpp:157
The Camera class - simulates the view point of the user. When the user interacts with the visualized ...
Definition: Camera.h:10
~Canvas()
Definition: Canvas.cpp:17
virtual void mouseReleaseEvent(QMouseEvent *event)
mouseReleaseEvent - Callback Function for when a Mouse button is released
Definition: Canvas.cpp:273
void calculateAmbientOcclusionMap()
calculateAmbientOcclusion - calculates the ambient occlusion effect for the current scene ...
Definition: Canvas.cpp:371
Canvas(QWidget *parent=0)
Definition: Canvas.cpp:9
void drawEdges()
drawEdges - Draws the edge effect
Definition: Canvas.cpp:138
virtual void mousePressEvent(QMouseEvent *event)
mousePressEvent - Callback Function for when a Mouse button is pressed
Definition: Canvas.cpp:263
void drawScene()
drawScene - Draws the sccene onto the bound framebuffer
Definition: Canvas.cpp:105
virtual void resizeGL(int width, int height)
resizeGL - callback method, which handels situations where the width or heigt of the window changes ...
Definition: Canvas.cpp:232
virtual void paintGL()
paintGL - takes care of everything that will be drawn on the canvas. Calls methods which regulate div...
Definition: Canvas.cpp:62
void loadModel()
loadModel - Load model from currently specified file path
Definition: Canvas.cpp:44
virtual void wheelEvent(QWheelEvent *event)
wheelEvent - Callback Function for when the Mouse scroll wheel is being activated ...
Definition: Canvas.cpp:282
virtual void initializeGL()
initializeGL - takes care of the initialization of al important OpenGL aspects
Definition: Canvas.cpp:26