#include <GLViewer_Widget.h>

Public Member Functions | |
| GLViewer_Widget (QWidget *theParent, const char *theName=0) | |
| A constructor. | |
| ~GLViewer_Widget () | |
| A destructor. | |
| GLViewer_ViewPort2d * | getViewPort () const |
| Returns parent GLViewer_ViewPort2d. | |
| GLint | getWidth () const |
| Returns width of OpenGl Window. | |
| GLint | getHeight () const |
| Returns height of OpenGl Window. | |
| void | getScale (GLfloat &xScale, GLfloat &yScale, GLfloat &zScale) |
| Returns scales on OpenGL scene along 3 directions. | |
| void | setScale (GLfloat xScale, GLfloat yScale, GLfloat zScaleGLfloat) |
| A function for installing the scales of OpenGL scene. | |
| void | getPan (GLfloat &xPan, GLfloat &yPan, GLfloat &zPan) |
| Returns offset parameters of Window in OpenGL global scene. | |
| void | setPan (GLfloat xPan, GLfloat yPan, GLfloat zPan) |
| A function for installing the offset parameters of Window in OpenGL global scene. | |
| GLfloat | getRotationAngle () const |
| Returns rotation angle of Window in OpenGL global scene in degree. | |
| void | setRotationAngle (GLfloat a) |
| A function for installing the rotation angle of Window in OpenGL global scene in degree. | |
| void | getRotationStart (GLfloat &rotationStartX, GLfloat &rotationStartY, GLfloat &rotationStartZ) |
| Returns start point of curren rotation of Window in OpenGL global scene. | |
| void | setRotationStart (GLfloat rotationStartX, GLfloat rotationStartY, GLfloat rotationStartZ) |
| A function for installing the start point of curren rotation of Window in OpenGL global scene. | |
| void | getRotation (GLfloat &rotationAngle, GLfloat &rotationCenterX, GLfloat &rotationCenterY, GLfloat &rotationCenterZ) |
| Returns parameters of current rotation. | |
| void | setRotation (GLfloat, GLfloat, GLfloat, GLfloat) |
| A function for installing the parameters of current rotation. | |
| void | setBackground (QString theFileName) |
| A function load picture from file with name theFileName and post it in center of global OpenGL scene. | |
| void | addToolTip (QString theTTText, QRect theTTRect) |
| A function add the tool tip with text theTTText on theTTRect rect to the widget window. | |
| void | removeToolTip () |
| A function remove tool tip form widget window. | |
| virtual void | translateBackgroundToPS (QFile &hFile, GLViewer_CoordSystem *aViewerCS, GLViewer_CoordSystem *aPSCS) |
| A function translate background of window in to PostScript file on disk. | |
| void | exportRepaint () |
| A function repaints OpenGL scene in export mode. | |
Protected Member Functions | |
| virtual void | initializeGL () |
| A function is called before first display of window (create OpenGL scene) | |
| virtual void | paintGL () |
| A function is called in earch paint event of window. | |
| virtual void | resizeGL (int, int) |
| A function is called in earch resize event of window. | |
| virtual void | paintEvent (QPaintEvent *) |
| virtual void | mouseMoveEvent (QMouseEvent *) |
| virtual void | mousePressEvent (QMouseEvent *) |
| virtual void | mouseReleaseEvent (QMouseEvent *) |
| virtual void | enterEvent (QEvent *) |
| virtual void | leaveEvent (QEvent *) |
| virtual bool | event (QEvent *) |
Private Member Functions | |
| void | getBackgroundRectInViewerCS (double &left, double &top, double &right, double &bottom) |
| Auxiliary function. Returns rect of window background in viewer coordinate system. | |
Private Attributes | |
| GLint | myWidth |
| width of window | |
| GLint | myHeight |
| height of window | |
| GLfloat | myXScale |
| Scale along X direction. | |
| GLfloat | myYScale |
| Scale along Y direction. | |
| GLfloat | myZScale |
| Scale along Z direction. | |
| GLfloat | myXPan |
| Window offset along X direction. | |
| GLfloat | myYPan |
| Window offset along Y direction. | |
| GLfloat | myZPan |
| Window offset along Z direction. | |
| GLfloat | myRotationStartX |
| GLfloat | myRotationStartY |
| GLfloat | myRotationStartZ |
| GLfloat | myRotationAngle |
| GLfloat | myRotationCenterX |
| GLfloat | myRotationCenterY |
| GLfloat | myRotationCenterZ |
| GLfloat | myRotationAnglePrev |
| GLboolean | myStart |
| GLViewer_ViewPort2d * | myViewPort |
| bool | isLoadBackground |
| True if background is loaded. | |
| QString | myBackgroundFile |
| File name of background image. | |
| GLuint | texName |
| Texture id of loaded background image. | |
| int | myIW |
| Width of background image. | |
| int | myIH |
| Height of background image. | |
| int | myBackgroundSize |
| Size of background image. | |
| QRect | myToolTipRect |
| bool | isExportMode |
| Needs for export repaint. | |
Widget for visualization of OpenGL scene
| GLViewer_Widget::GLViewer_Widget | ( | QWidget * | parent, |
| const char * | name = 0 |
||
| ) |
Parameters using for QOGLWidget as is
A constructor Parameters using for QOGLWidget as is
References isExportMode, myRotationAngle, myRotationAnglePrev, myRotationCenterX, myRotationCenterY, myRotationCenterZ, myStart, myViewPort, myXPan, myXScale, myYPan, myYScale, myZPan, and myZScale.
| GLViewer_Widget::~GLViewer_Widget | ( | ) |
Destructor
| GLViewer_ViewPort2d* GLViewer_Widget.getViewPort | ( | ) | const |
ViewPort2d because this class is not use for 3D Viewer
| GLint GLViewer_Widget.getWidth | ( | ) | const |
| GLint GLViewer_Widget.getHeight | ( | ) | const |
| void GLViewer_Widget::getScale | ( | GLfloat & | xScale, |
| GLfloat & | yScale, | ||
| GLfloat & | zScale | ||
| ) |
| void GLViewer_Widget::setScale | ( | GLfloat | xScale, |
| GLfloat | yScale, | ||
| GLfloat | zScale | ||
| ) |
| void GLViewer_Widget::getPan | ( | GLfloat & | xPan, |
| GLfloat & | yPan, | ||
| GLfloat & | zPan | ||
| ) |
| void GLViewer_Widget::setPan | ( | GLfloat | xPan, |
| GLfloat | yPan, | ||
| GLfloat | zPan | ||
| ) |
| GLfloat GLViewer_Widget.getRotationAngle | ( | ) | const |
Only in 2D
| void GLViewer_Widget.setRotationAngle | ( | GLfloat | a | ) |
Only in 2D
References test_table.a.
| void GLViewer_Widget::getRotationStart | ( | GLfloat & | rotationStartX, |
| GLfloat & | rotationStartY, | ||
| GLfloat & | rotationStartZ | ||
| ) |
References myRotationStartX, myRotationStartY, and myRotationStartZ.
| void GLViewer_Widget::setRotationStart | ( | GLfloat | rotationStartX, |
| GLfloat | rotationStartY, | ||
| GLfloat | rotationStartZ | ||
| ) |
A function for installing the rotation angle of Window in OpenGL global scene in degree (Only in 2D)
References myRotationStartX, myRotationStartY, and myRotationStartZ.
| void GLViewer_Widget::getRotation | ( | GLfloat & | rotationAngle, |
| GLfloat & | rotationCenterX, | ||
| GLfloat & | rotationCenterY, | ||
| GLfloat & | rotationCenterZ | ||
| ) |
| rotationAngle | - angle |
| rotationCenterX | - center x |
| rotationCenterY | - center y |
| rotationCenterZ | - center z |
References myRotationAngle, myRotationCenterX, myRotationCenterY, and myRotationCenterZ.
| void GLViewer_Widget::setRotation | ( | GLfloat | rotationAngle, |
| GLfloat | rotationCenterX, | ||
| GLfloat | rotationCenterY, | ||
| GLfloat | rotationCenterZ | ||
| ) |
Sets parameters of rotation
| rotationAngle | - angle |
| rotationCenterX | - center x |
| rotationCenterY | - center y |
| rotationCenterZ | - center z |
References myRotationAngle, myRotationCenterX, myRotationCenterY, and myRotationCenterZ.
| void GLViewer_Widget::setBackground | ( | QString | filename | ) |
Sets image as background
| filename | - name of file |
References isLoadBackground, myBackgroundFile, myBackgroundSize, myIH, myIW, and texName.
| void GLViewer_Widget::addToolTip | ( | QString | theString, |
| QRect | theRect | ||
| ) |
Adds tooltip
| theString | - tooltip text |
| theRect | - tooltip rectangle |
References myToolTipRect.
| void GLViewer_Widget::removeToolTip | ( | ) |
Removes tooltip
| void GLViewer_Widget::translateBackgroundToPS | ( | QFile & | hFile, |
| GLViewer_CoordSystem * | aViewerCS, | ||
| GLViewer_CoordSystem * | aPSCS | ||
| ) | [virtual] |
| hFile | the name of PostScript file chosen by user |
| aViewerCS | the GLViewer_CoordSystem of window |
| aPSCS | the GLViewer_CoordSystem of PostScript page |
Translates background to PostScript
| hFile | - PostScript file |
| aViewerCS | - viewer co-ordinate system |
| aPSCS | - paper co-ordinate system |
References test_table.a, AddImagePart(), test_table.c, getBackgroundRectInViewerCS(), isLoadBackground, test_big_table.k, myBackgroundFile, and GLViewer_CoordSystem.transform().
| void GLViewer_Widget::exportRepaint | ( | ) |
Provides repaint in export mode
References isExportMode, and paintGL().
| void GLViewer_Widget::getBackgroundRectInViewerCS | ( | double & | left, |
| double & | top, | ||
| double & | right, | ||
| double & | bottom | ||
| ) | [private] |
| void GLViewer_Widget::initializeGL | ( | ) | [protected, virtual] |
Initialization (redefined virtual from QGLWidget)
References isLoadBackground, and setBackground().
| void GLViewer_Widget::paintGL | ( | ) | [protected, virtual] |
Paints content
References GLViewer_Grid.draw(), GLViewer_ViewPort2d.getGrid(), GLViewer_ViewFrame.getViewer(), GLViewer_ViewPort2d.getViewFrame(), getViewPort(), isExportMode, isLoadBackground, myBackgroundSize, myIH, myIW, myRotationAngle, myRotationCenterX, myRotationCenterY, myRotationCenterZ, myViewPort, myXPan, myXScale, myYPan, myYScale, myZPan, myZScale, GLViewer_Viewer2d.repaintView(), texName, and GLViewer_Viewer2d.updateDrawers().
| void GLViewer_Widget::resizeGL | ( | int | w, |
| int | h | ||
| ) | [protected, virtual] |
Resets OpenGl parameters after resize
| w | - new width |
| h | - new height |
References GLViewer_ViewPort2d.initResize(), myHeight, myStart, myViewPort, and myWidth.
| void GLViewer_Widget::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Custom paint event handler
References myViewPort.
| void GLViewer_Widget::mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Custom mouse move event handler
References myViewPort.
| void GLViewer_Widget::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Custom mouse press event handler
References myViewPort.
| void GLViewer_Widget::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Custom mouse release event handler
References myViewPort.
| void GLViewer_Widget::enterEvent | ( | QEvent * | e | ) | [protected, virtual] |
Custom enter event handler
| void GLViewer_Widget::leaveEvent | ( | QEvent * | e | ) | [protected, virtual] |
Custom leave event handler
| bool GLViewer_Widget::event | ( | QEvent * | e | ) | [protected, virtual] |
Custom leave event handler
References myToolTipRect.
GLint GLViewer_Widget.myWidth [private] |
GLint GLViewer_Widget.myHeight [private] |
GLfloat GLViewer_Widget.myXScale [private] |
GLfloat GLViewer_Widget.myYScale [private] |
GLfloat GLViewer_Widget.myZScale [private] |
GLfloat GLViewer_Widget.myXPan [private] |
GLfloat GLViewer_Widget.myYPan [private] |
GLfloat GLViewer_Widget.myZPan [private] |
GLfloat GLViewer_Widget.myRotationStartX [private] |
GLfloat GLViewer_Widget.myRotationStartY [private] |
GLfloat GLViewer_Widget.myRotationStartZ [private] |
GLfloat GLViewer_Widget.myRotationAngle [private] |
GLfloat GLViewer_Widget.myRotationCenterX [private] |
GLfloat GLViewer_Widget.myRotationCenterY [private] |
GLfloat GLViewer_Widget.myRotationCenterZ [private] |
GLfloat GLViewer_Widget.myRotationAnglePrev [private] |
GLboolean GLViewer_Widget.myStart [private] |
GLViewer_ViewPort2d* GLViewer_Widget.myViewPort [private] |
bool GLViewer_Widget.isLoadBackground [private] |
QString GLViewer_Widget.myBackgroundFile [private] |
GLuint GLViewer_Widget.texName [private] |
int GLViewer_Widget.myIW [private] |
int GLViewer_Widget.myIH [private] |
int GLViewer_Widget.myBackgroundSize [private] |
QRect GLViewer_Widget.myToolTipRect [private] |
bool GLViewer_Widget.isExportMode [private] |