OpenMask, OpenGL and QT Widget


PhotoPhoto
Photo
The Animation controlled by QT buttons



In this chapter,we try to explain how we can draw an object in OpenGL directly controlling by a QT widget.


Download this file and uncompress : QTOpenGLMask.tar.gz
These files have been tested on Mandrake 9.1.
You may have to modify the .pro if you are running on an other operating system.


The Method

Details of the archive :
      main.cxx                                     //A classic OpenMask main file
      PsXEventHandler.h                            //Files which send signals to OpenGL
      PsXEventHandler.cxx
      PsvOpenGLParamSensitiveInputHandler.h        //Files which contain the OpenGL code
      PsvOpenGLParamSensitiveInputHandler.cxx
      PsParam.h                                    //Files which contain parameters for the OpenGL object
      PsParam.cxx
      scene.OpenMASK3                              //The OpenMask simulation tree
      1Window_1Viewport.3DVis.OpenMASK3
      cube.pro                                     //Generate the Makefile
      Makefile

QTInterface/
      OpenMASKInterface.pro                         //Generate the Makefile
      Makefile
      PsOpenMASKWidget.h                            //This class sends signals to PsXEventHandler (for the control)
      PsOpenMASKWidget.cxx
      OpenMASKWidget.ui.h                           //This file was constructing by QTdesigner

The Result

Compile and see the animation. As you can see a polygon is turning round and its color change.
You can stop or start the animation with the QT Widget. You can also move the slider to accelerate or decelerate the animation.

Return to the summary