Select Git revision
AbstractGraphicsEngine.h
Forked from
einsteinathome / graphicsframework
Source project has a limited visibility.
-
Oliver Bock authoredOliver Bock authored
pulsaranimationwidget.cpp 17.61 KiB
/******************************************************************************
* 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 <http://www.gnu.org/licenses/>. *
* *
******************************************************************************/
#include "pulsaranimationwidget.h"
const double PulsarAnimationWidget::deg2rad = PI/180.0;
PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
QGLWidget(QGLFormat(QGL::AlphaChannel | QGL::SampleBuffers), parent),
m_pulseProfile(360, 0.0)
{
QString msgThis = tr("3D animation");
if(!format().directRendering()) {
QString msg = tr("Sorry, no direct rendering support for %1...");
qWarning() << msg.arg(msgThis);
}
if(!format().doubleBuffer()) {
QString msg = tr("Sorry, no double buffering support for %1...");
qWarning() << msg.arg(msgThis);
}
if(!format().rgba()) {
QString msg = tr("Sorry, no RGBA support for %1...");
qWarning() << msg.arg(msgThis);
}
if(!format().alpha()) {
QString msg = tr("Sorry, no alpha channel support for %1...");
qWarning() << msg.arg(msgThis);
}
if(!format().sampleBuffers()) {
QString msg = tr("Sorry, no multisampling support for %1...");
qWarning() << msg.arg(msgThis);
}
// initialize quadric pointers
m_quadricVirgoh = NULL;
m_quadricVirgov = NULL;
m_quadricEarth = NULL;
m_quadricLLOh = NULL;
m_quadricLLOv = NULL;
m_quadricSourcePlane = NULL;
m_quadricSourcePlaneNormal = NULL;
m_quadricSourcePlaneNormalCap = NULL;
m_quadricLHOv = NULL;
m_quadricLHOh = NULL;
// initialize texture pointers
m_beamTexture = 0;
// initial parameters (have to match GUI!)
m_LHOAngle = 180;
m_LLOAngle = -100;
m_VirgoAngle = 165;