//**************************************************************************** //! \file wengine.hpp //! \date 06-03-2003 //! \class WEngine //! \brief The engine of the Weird Demo //**************************************************************************** // This file is part of the Weird Demo. // // The Weird Demo is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // The Weird Demo is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with DataView; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //**************************************************************************** #ifndef WENGINE_HPP #define WENGINE_HPP #include "engine/engine.hpp" //*************************************************************************** class WEngine : public GLView //---------------------------------------------------------------------------- //! It is derived from GLView and does the actual demo //*************************************************************************** { Q_OBJECT public: //! \brief Constructor, derived from the QGLWidget Constructor //! \param parent the parent widged (0 if top level) //! \param name the name of the widget WEngine( QWidget *parent, char const *name); //! \brief Destructor ~WEngine(); //! \brief response to key events needed for moving of reference point virtual void evKeyPress( QKeyEvent *); //! \brief Set up everything that has to be set up (non OpenGL stuff) //! \attention must be called before the Widget is made visible //! \param sm The GL shading model //! \param df The GL depth function //! \param in the time intervall for the widgets timer (in ms) virtual void Init( const unsigned int sm = GL_SMOOTH, const unsigned int df = GL_LEQUAL, const int in = 50); protected: unsigned int object; //!< two untextured spheres (test) //! This function acts as a kind of film script for the demo //! \brief this is the function that actually directs the demo virtual void director(); //! \brief moves the lights according to their velocities (actually no need to overload) virtual void adjustLights(); //! \brief moves the camera according to its velocities (actually no need to overload either) virtual void adjustCamera(); //! \brief moves the objects in the scene according to their velocities virtual void adjustScene(); //! \brief makes if activated the objects shadows //! \attention only support for non rotating cubes till now virtual void makeShades(); virtual void makeCont(); //! \brief overloaded member function inherited from QGLWidget sets up all OpenGL related stuff virtual void initializeGL(); private: bool switcher; int texanim; unsigned int transo; //!< a translucend sphere (test) unsigned int tetra; //!< an untextured Tetraeder unsigned int texo; //!< a textured crate (test) GLUquadricObj *quad; //!< used for displaying a sphere // object making functions void makeTetra(); void makeObject(); void makeTransObject(); void makeTexObject(); }; #endif