infovis
|
00001 #ifndef GLWIDGET_H 00002 #define GLWIDGET_H 00003 #include <QGLWidget> 00004 00005 #include "circle.h" 00006 #include "triangle.h" 00007 #include "quad.h" 00008 #include "BoundingBox.h" 00009 #include "MappingRenderer.h" 00010 #include "IdenticalMapping.h" 00011 #include "ComplexRootMapping.h" 00012 #include "ComplexLogMapping.h" 00013 #include "ui_glgeogenerator.h" 00014 00015 //#include "GLMatrix.h" 00016 00017 //using namespace mathglpp; 00018 00019 class GLWidget : public QGLWidget 00020 { 00021 Q_OBJECT 00022 00023 public: 00024 GLWidget(QWidget *parent = 0); 00025 ~GLWidget(); 00026 00027 //void InitGeoShapesVector( int numGeoShapes ); 00028 00029 signals: 00030 void MappingTypeChanged(int newMappingType); 00031 void aValueChanged(double a); 00032 00033 public slots: 00034 void setA(double aValue); 00035 00036 00037 protected: 00038 void initializeGL(); 00039 void paintGL(); 00040 void mousePressEvent(QMouseEvent *e); 00041 void mouseMoveEvent(QMouseEvent *e); 00042 void mouseReleaseEvent(QMouseEvent *e); 00043 void keyPressEvent(QKeyEvent *e); 00044 void setProjection(); 00045 void resizeGL( int w, int h ); 00046 void setMappingType(); 00047 00048 void ClearGeoShapesVector( void ); 00049 00050 private: 00051 00052 enum View {IDENTICAL, COMPLEX_ROOT, COMPLEX_LOG}; 00053 00054 QColor qtBackground; // Background color 00055 int mNumGeoShapes; // Number of geometric objects 00056 int mNumConnection; // Number of connections between the objects 00057 float ratio; // Aspect ratio of the viewport 00058 int xClick, yClick; // Mouse Coordinates when the mouse is pressed 00059 float xTrans, yTrans; // Translation values 00060 MappingRenderer *currentMapping; 00061 IdenticalMapping idMapping; 00062 ComplexRootMapping crMapping; 00063 ComplexLogMapping clMapping; 00064 float left, right, bottom, top;// Coordinates for the orthogonal projection clipping planes 00065 float a; // parameter 'a' to control the opening angle of the wedge (smooth transition) 00066 View mappingType; // Current mapping used (Identical, CLV...) 00067 }; 00068 00069 #endif