1 // File: GLViewer_Widget.h
2 // Created: November, 2004
4 // Copyright (C) CEA 2004
6 /***************************************************************************
7 ** Class: GLViewer_Widget
8 ** Descr: OpenGL Widget for GLViewer
10 ** Created: UI team, 27.03.03
11 ****************************************************************************/
12 #ifndef GLVIEWER_WIDGET_H
13 #define GLVIEWER_WIDGET_H
20 class GLViewer_ViewPort2d;
21 class GLViewer_CoordSystem;
23 class GLVIEWER_EXPORT GLViewer_Widget : public QGLWidget
28 GLViewer_Widget( QWidget*, const char* = 0 );
31 GLViewer_ViewPort2d* getViewPort() const { return myViewPort; }
32 GLint getWidth() const { return myWidth; }
33 GLint getHeight() const { return myHeight; }
35 void getScale( GLfloat&, GLfloat&, GLfloat& );
36 void setScale( GLfloat, GLfloat, GLfloat );
38 void getPan( GLfloat&, GLfloat&, GLfloat& );
39 void setPan( GLfloat, GLfloat, GLfloat );
41 GLfloat getRotationAngle() const { return myRotationAnglePrev; }
42 void setRotationAngle( GLfloat a ) { myRotationAnglePrev = a; }
43 void getRotationStart( GLfloat&, GLfloat&, GLfloat& );
44 void setRotationStart( GLfloat, GLfloat, GLfloat );
45 void getRotation( GLfloat&, GLfloat&, GLfloat&, GLfloat& );
46 void setRotation( GLfloat, GLfloat, GLfloat, GLfloat );
47 void setBackground( QString );
49 void addToolTip( QString, QRect );
53 virtual void translateBackgroundToPS( QFile& hFile, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aPSCS );
58 virtual void translateBackgroundToEMF( HDC dc, GLViewer_CoordSystem* aViewerCS, GLViewer_CoordSystem* aEMFCS );
62 void getBackgroundRectInViewerCS( double& left, double& top, double& right, double& bottom );
65 virtual void initializeGL();
66 virtual void paintGL();
67 virtual void resizeGL( int, int );
69 virtual void paintEvent( QPaintEvent* );
70 virtual void mouseMoveEvent( QMouseEvent* );
71 virtual void mousePressEvent( QMouseEvent* );
72 virtual void mouseReleaseEvent( QMouseEvent* );
73 virtual void enterEvent( QEvent* );
74 virtual void leaveEvent( QEvent* );
88 GLfloat myRotationStartX;
89 GLfloat myRotationStartY;
90 GLfloat myRotationStartZ;
91 GLfloat myRotationAngle;
92 GLfloat myRotationCenterX;
93 GLfloat myRotationCenterY;
94 GLfloat myRotationCenterZ;
95 GLfloat myRotationAnglePrev;
98 GLViewer_ViewPort2d* myViewPort;
101 bool isLoadBackground;
102 QString myBackgroundFile;
106 int myBackgroundSize;
115 #endif // GLVIEWER_WIDGET_H