Skip to content
Snippets Groups Projects
Select Git revision
  • 817406f3427f19f9568c81e9cefa32a1a83fad7c
  • master default protected
  • antenna-patterns
  • qt5-qopenglwidget
  • license-demo
  • isolated
  • isolated-fixedprofile
  • release_1.1
  • press-conference
  • rim-only
  • release_1.0
11 results

pulsatingscience.cpp

Blame
  • pulsatingscience.cpp 12.21 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 "pulsatingscience.h"
    
    PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
    {
    	ui.setupUi(this);
    
    	QAction* animControl = ui.dockAnimControl->toggleViewAction();
    	animControl->setStatusTip("Toggle the animation control visibility");
    	animControl->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
    	ui.menuView->addAction(animControl);
    
    	// inital status (based on GUI)
    	m_permanentOrbits = ui.actionPermanent_orbits->isChecked();
    	m_rotationAxesVisible = ui.actionRotationAxes->isChecked();
        m_menuBarVisible = ui.actionMenu_bar->isChecked();
    	m_statusBarVisible = ui.actionStatus_bar->isChecked();
    	m_animControlVisible = true;
    	m_animControlFloating = ui.dockAnimControl->isFloating();
    
    	// register alternate shortcuts (will be enabled when menu is hidden)
    	m_runShortcut = new QShortcut(ui.actionRun->shortcut(), this);
    	m_runShortcut->setEnabled(false);
    	m_pauseShortcut = new QShortcut(ui.actionPause->shortcut(), this);
    	m_pauseShortcut->setEnabled(false);
    	m_stopShortcut = new QShortcut(ui.actionStop->shortcut(), this);
    	m_stopShortcut->setEnabled(false);
    	m_permanentOrbitsShortcut = new QShortcut(ui.actionPermanent_orbits->shortcut(), this);
    	m_permanentOrbitsShortcut->setEnabled(false);
    	m_rotationAxesShortcut = new QShortcut(ui.actionRotationAxes->shortcut(), this);
    	m_rotationAxesShortcut->setEnabled(false);
    	m_menuBarShortcut = new QShortcut(ui.actionMenu_bar->shortcut(), this);
    	m_menuBarShortcut->setEnabled(false);
    	m_fullscreenShortcut = new QShortcut(ui.actionFullscreen->shortcut(), this);
    	m_fullscreenShortcut->setEnabled(false);
    
    	// establish object communications
    	connect(ui.actionRun, SIGNAL(activated()),
    			ui.pulsarGlWidget, SLOT(runAnimation()));
    
    	connect(ui.actionPause, SIGNAL(activated()),
    				ui.pulsarGlWidget, SLOT(pauseAnimation()));
    
    	connect(ui.actionStop, SIGNAL(activated()),
    				ui.pulsarGlWidget, SLOT(stopAnimation()));
    
    	connect(ui.actionPermanent_orbits, SIGNAL(toggled(bool)),
    				ui.pulsarGlWidget, SLOT(showOrbits(bool)));
    
    	connect(ui.actionRotationAxes, SIGNAL(toggled(bool)),
    				ui.pulsarGlWidget, SLOT(showRotationAxes(bool)));