Skip to content
Snippets Groups Projects
Select Git revision
  • 3c593b606ab3ba016c3f1c145bde0a71ff61a452
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
21 results

atacmds.cpp

Blame
  • pulsaranimationwidget.cpp 20.32 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_frameTimer(),
    	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);
    	}
    
    	// connect primary rendering timer to local callback
        connect(&m_frameTimer, SIGNAL(timeout()), this, SLOT(updateFrame()));
    
        // initialize quadric pointers
        m_quadricCompanionOrbitPlane = NULL;
        m_quadricCompanion = NULL;
        m_quadricPulsarOrbitPlane = NULL;
        m_quadricPulsar = NULL;
    	m_quadricPulsarCone1 = NULL;
    	m_quadricPulsarCone2 = NULL;
    	m_quadricPulsarSpinAxis = NULL;
    	m_quadricPulsarMagneticAxis = NULL;
    
    	// initialize texture pointers
    	m_pulsarTexture = 0;
    	m_backgroundTexture = 0;
    
    	// initial render timing settings
    	m_framesPerSecond = 25;