Hierarchical Edge Bundle 1.0
J:/Caro/C++_Coding/HierarchicalEdgeBundle/HierarchicalEdgeBundle/header/OpenGLWidget.h
Go to the documentation of this file.
00001 #pragma once
00002 #include "glm/glm.hpp"
00003 #include "Camera.h"
00004 #include "View.h"
00005 #include "Light.h"
00006 #include "RenderImplementation.h"
00007 
00008 #include <glew.h>
00009 #include <QGLWidget>
00010 #include <QtOpenGL>
00011 #include <QColor>
00012 #include <QGLContext>
00013 #include <QGLFormat>
00014 #include <vector>
00015 
00020 class OpenGLWidget : public QGLWidget
00021 {
00022         Q_OBJECT
00023 
00024 public:
00028         OpenGLWidget(QWidget* parent = 0);
00032         ~OpenGLWidget();
00033 
00034         static QGLContext* context;
00035         static QGLFormat* format;
00036 
00037 protected:
00041         void initializeGL();
00047         void resizeGL(int width,int height);
00051         void paintGL();
00052 
00057     void mousePressEvent(QMouseEvent *event);
00062     void mouseMoveEvent(QMouseEvent *event);
00067     void mouseReleaseEvent(QMouseEvent *event);
00068 
00073         void keyPressEvent(QKeyEvent *event);
00078         void keyReleaseEvent(QKeyEvent *event);
00079 
00080 private:
00081         vec3 camera_uvt;
00082         float translateZ;
00083 
00084 
00085         bool mode3D;
00086 
00087         vec3 m_oldMousePosition;
00088 
00090          QColor black;
00092          int screenWidth;
00094          int screenHeight;
00095          //model matrix
00096          glm::mat4 model;
00097          //perspective or orthogonal view
00098          bool perspective;
00099 
00100          Light* m_light;
00101 
00103          Camera* camera_orth;
00104          Camera* camera_pers;
00105          View** m_view;
00106 
00110          void setCameraProjection();
00111 
00112          RenderImplementation* renderer;
00113 
00114 private slots:
00115         void setView(View** view);
00116 };
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines