/******************************************************************************
* Copyright (C) 2008 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of PulsatingScience. *
* *
* PulsatingScience 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, version 3 of the License. *
* *
* PulsatingScience 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 PulsatingScience. If not, see . *
* *
******************************************************************************/
#ifndef PULSARANIMATIONWIDGET_H_
#define PULSARANIMATIONWIDGET_H_
#include
#include
class PulsarAnimationWidget : public QGLWidget
{
Q_OBJECT
public:
PulsarAnimationWidget(QWidget *parent);
virtual ~PulsarAnimationWidget();
void setFramePerSecond(const unsigned int fps);
void setPulsarSpinFrequency(const float frequency);
public slots:
void runAnimation();
void pauseAnimation();
void stopAnimation();
void updateFrame();
void updatePulsarSpin();
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
QTimer m_frameTimer;
QTimer m_pulsarSpinTimer;
GLUquadricObj *m_quadricPulsar;
GLUquadricObj *m_quadricPulsarCone1;
GLUquadricObj *m_quadricPulsarCone2;
int m_framesPerSecond;
float m_pulsarSpinFrequency;
float m_pulsarRotationAngle;
};
#endif /* PULSARANIMATIONWIDGET_H_ */