Commit bc7e81e6 authored by Oliver Bock's avatar Oliver Bock

First changes towards a special "isolated" edition

* Removed binary features
  - Removed companion
  - Removed orbital planes
  - Removed pulsar mass
  - Removed semi major axis
* Using triangle fans and rims to contruct complex beam cones (instead of simple quadric)
* Using wireframe model instead of textures (better cone feature visualisation)
* Using lighting only for spherical pulsar shape (doesn't yet work for cones)
* Adjusted pulsar rotation axis to line up with wireframe poles
* Adjusted initial view to be in line with rotation axis (as requested by Ben)
parent 88dcf497
This diff is collapsed.
......@@ -40,12 +40,9 @@ public:
virtual ~PulsarAnimationWidget();
void setFramePerSecond(const unsigned int fps);
void setCompanionMass(const double mass);
void setPulsarMass(const double mass);
void setPulsarSpinFrequency(const double frequency);
void setPulsarSpinAxisInclination(const int degrees);
void setPulsarMagneticAxisInclination(const int degrees);
void setPulsarSemiMajorAxis(const double length);
public slots:
void runAnimation();
......@@ -54,11 +51,9 @@ public slots:
void updateFrame();
void showOrbits(bool enabled);
void showRotationAxes(bool enabled);
signals:
void pulsarSemiMajorAxisUpdated(double value);
void pulseProfileUpdated(const QVector<double>& data);
void pulsarAnimationStep(double position);
......@@ -72,21 +67,18 @@ private:
void mouseReleaseEvent(QMouseEvent *event);
void showEvent(QShowEvent *event);
void updateOrbitPeriod();
void updateOrbitRadii();
void updateCameraPosition(const double angleH, const double angleV, const double zoom);
void resetParameters();
void updatePulseProfile();
QTimer m_frameTimer;
GLUquadricObj *m_quadricCompanionOrbitPlane;
GLUquadricObj *m_quadricCompanion;
GLUquadricObj *m_quadricPulsarOrbitPlane;
GLUquadricObj *m_quadricPulsar;
GLUquadricObj *m_quadricPulsarCone1;
GLUquadricObj *m_quadricPulsarCone2;
GLUquadricObj *m_quadricPulsarConeRim1;
GLUquadricObj *m_quadricPulsarConeRim2;
GLUquadricObj *m_quadricPulsarSpinAxis;
GLUquadricObj *m_quadricPulsarSpinAxisTop1;
GLUquadricObj *m_quadricPulsarSpinAxisTop2;
GLUquadricObj *m_quadricPulsarMagneticAxis;
GLuint m_pulsarTexture;
......@@ -97,19 +89,11 @@ private:
double m_pulsarRotationAngle;
double m_pulsarRotationDelta;
double m_orbitalPeriod;
double m_orbitRotationAngle;
double m_orbitRotationDelta;
double m_pulsarMass;
double m_pulsarSemiMajorAxis;
double m_companionMass;
double m_companionSemiMajorAxis;
double m_pulsarSpinAxisInclination;
double m_pulsarMagneticAxisInclination;
double m_pulsarBeamInnerRadius;
double m_pulsarBeamOuterRadius;
bool m_showOrbits;
bool m_showRotationAxes;
bool m_cameraInteraction;
......
......@@ -38,7 +38,6 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
#endif
// 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();
......@@ -53,8 +52,6 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
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);
......@@ -93,15 +90,9 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
connect(ui.actionStop, SIGNAL(triggered()),
this, SLOT(on_pushStop_clicked()));
connect(ui.actionPermanent_orbits, SIGNAL(toggled(bool)),
ui.pulsarGlWidget, SLOT(showOrbits(bool)));
connect(ui.actionRotationAxes, SIGNAL(toggled(bool)),
ui.pulsarGlWidget, SLOT(showRotationAxes(bool)));
connect(ui.pulsarGlWidget, SIGNAL(pulsarSemiMajorAxisUpdated(double)),
this, SLOT(updatePulsarSemiMajorAxisValue(double)));
connect(ui.pulsarGlWidget, SIGNAL(pulsarAnimationStep(double)),
ui.pulseScopeWidget, SLOT(setMarker(double)), Qt::DirectConnection);
......@@ -129,11 +120,6 @@ PulsatingScience::~PulsatingScience()
delete m_stopShortcut;
}
if(m_permanentOrbitsShortcut) {
m_permanentOrbitsShortcut->disconnect();
delete m_permanentOrbitsShortcut;
}
if(m_rotationAxesShortcut) {
m_rotationAxesShortcut->disconnect();
delete m_rotationAxesShortcut;
......@@ -193,36 +179,6 @@ void PulsatingScience::on_pushStop_clicked()
ui.pushStop->setEnabled(false);
}
void PulsatingScience::on_radioCompanionWD_toggled(bool checked)
{
if(checked) {
ui.pulsarGlWidget->setCompanionMass(0.6);
ui.lcdCompanionMass->display(QString::number(0.6, 'f', 1));
}
}
void PulsatingScience::on_radioCompanionSun_toggled(bool checked)
{
if(checked) {
ui.pulsarGlWidget->setCompanionMass(1.0);
ui.lcdCompanionMass->display(QString::number(1.0, 'f', 1));
}
}
void PulsatingScience::on_radioCompanionNS_toggled(bool checked)
{
if(checked) {
ui.pulsarGlWidget->setCompanionMass(1.4);
ui.lcdCompanionMass->display(QString::number(1.4, 'f', 1));
}
}
void PulsatingScience::on_sliderPulsarMass_valueChanged(int value)
{
ui.pulsarGlWidget->setPulsarMass(value * 0.1);
ui.lcdPulsarMass->display(QString::number(value * 0.1, 'f', 1));
}
void PulsatingScience::on_sliderPulsarSpinFrequency_valueChanged(int value)
{
ui.pulsarGlWidget->setPulsarSpinFrequency(value * 0.1);
......@@ -241,28 +197,6 @@ void PulsatingScience::on_sliderPulsarMagneticAxisInclination_valueChanged(int v
ui.lcdPulsarMagneticAxisInclination->display(QString::number(value));
}
void PulsatingScience::on_sliderPulsarSemiMajorAxis_valueChanged(int value)
{
ui.pulsarGlWidget->setPulsarSemiMajorAxis(value * 0.001);
ui.lcdPulsarSemiMajorAxis->display(QString::number(value * 0.001, 'f', 1));
ui.lcdPulsarSemiMajorAxis->setStyleSheet("color: black");
}
void PulsatingScience::permanentOrbitsToggled() {
if(m_permanentOrbits) {
on_actionPermanent_orbits_toggled(false);
ui.actionPermanent_orbits->setChecked(false);
}
else {
on_actionPermanent_orbits_toggled(true);
ui.actionPermanent_orbits->setChecked(true);
}
}
void PulsatingScience::on_actionPermanent_orbits_toggled(bool checked) {
m_permanentOrbits = checked;
}
void PulsatingScience::rotationAxesToggled() {
if(m_rotationAxesVisible) {
on_actionRotationAxes_toggled(false);
......@@ -304,8 +238,6 @@ void PulsatingScience::on_actionMenu_bar_toggled(bool checked)
m_pauseShortcut->setEnabled(false);
m_stopShortcut->disconnect();
m_stopShortcut->setEnabled(false);
m_permanentOrbitsShortcut->disconnect();
m_permanentOrbitsShortcut->setEnabled(false);
m_rotationAxesShortcut->disconnect();
m_rotationAxesShortcut->setEnabled(false);
m_fullscreenShortcut->disconnect();
......@@ -324,8 +256,6 @@ void PulsatingScience::on_actionMenu_bar_toggled(bool checked)
connect(m_pauseShortcut, SIGNAL(activated()), ui.pulsarGlWidget, SLOT(pauseAnimation()));
m_stopShortcut->setEnabled(true);
connect(m_stopShortcut, SIGNAL(activated()), ui.pulsarGlWidget, SLOT(stopAnimation()));
m_permanentOrbitsShortcut->setEnabled(true);
connect(m_permanentOrbitsShortcut, SIGNAL(activated()), this, SLOT(permanentOrbitsToggled()));
m_rotationAxesShortcut->setEnabled(true);
connect(m_rotationAxesShortcut, SIGNAL(activated()), this, SLOT(rotationAxesToggled()));
m_fullscreenShortcut->setEnabled(true);
......@@ -417,10 +347,10 @@ void PulsatingScience::on_actionAbout_triggered()
"%4<br>"
"(%5 ESO/IDA/Danish 1.5 m/R.Gendler, J-E. Ovaldsen, C. Th&ouml;ne, C. Feron)<br><br>"
"%6: GNU General Public License (Version 3)<br><br>"
"Copyright &copy; 2009 Max-Planck-Institut f&uuml;r Gravitationsphysik";
"Copyright &copy; 2009-2010 Max-Planck-Institut f&uuml;r Gravitationsphysik";
content = content.arg(
tr("Pulsating Science"),
tr("Pulsating Science (J2007+27 Edition)"),
tr("International Year of Astronomy 2009"),
tr("Authors"),
tr("Background image: The Carina Nebula"),
......@@ -430,21 +360,6 @@ void PulsatingScience::on_actionAbout_triggered()
QMessageBox::about(this, tr("About \"Pulsating Science\""), content);
}
void PulsatingScience::updatePulsarSemiMajorAxisValue(double value)
{
ui.sliderPulsarSemiMajorAxis->setValue(qRound(value * 1000.0));
if((int)value <= 1 || (int)value >= 20) {
if((int)value < 1 || (int)value > 20) {
ui.lcdPulsarSemiMajorAxis->setStyleSheet("color: red");
}
else {
ui.lcdPulsarSemiMajorAxis->setStyleSheet("color: black");
}
ui.lcdPulsarSemiMajorAxis->display(QString::number(value, 'f', 1));
}
}
void PulsatingScience::toggleHiddenDemoMode()
{
if(m_hiddenDemoModeActivated) {
......
......@@ -47,17 +47,10 @@ public slots:
void on_pushPause_clicked();
void on_pushStop_clicked();
void on_radioCompanionWD_toggled(bool checked);
void on_radioCompanionSun_toggled(bool checked);
void on_radioCompanionNS_toggled(bool checked);
void on_sliderPulsarMass_valueChanged(int value);
void on_sliderPulsarSpinFrequency_valueChanged(int value);
void on_sliderPulsarSpinAxisInclination_valueChanged(int value);
void on_sliderPulsarMagneticAxisInclination_valueChanged(int value);
void on_sliderPulsarSemiMajorAxis_valueChanged(int value);
void permanentOrbitsToggled();
void on_actionPermanent_orbits_toggled(bool checked);
void rotationAxesToggled();
void on_actionRotationAxes_toggled(bool checked);
void fullscreenToggled();
......@@ -72,7 +65,6 @@ public slots:
void on_actionWebsite_triggered();
void on_actionAbout_triggered();
void updatePulsarSemiMajorAxisValue(double value);
void toggleHiddenDemoMode();
private:
......@@ -87,7 +79,6 @@ private:
QShortcut *m_fullscreenShortcut;
QShortcut *m_hiddenShortcut;
bool m_permanentOrbits;
bool m_rotationAxesVisible;
bool m_menuBarVisible;
bool m_statusBarVisible;
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment