Commit 9e7d215a authored by Oliver Bock's avatar Oliver Bock

Improved initial settings

* Using show event to update pulse profile
* Using 60 deg inclination of magentic axis
parent e33b9c89
......@@ -78,7 +78,7 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
// initial companion is "Neutron Star"
m_companionMass = 1.4;
m_pulsarSpinAxisInclination = 0.0;
m_pulsarMagneticAxisInclination = 45.0;
m_pulsarMagneticAxisInclination = 60.0;
m_pulsarSemiMajorAxis = 5.0;
m_companionSemiMajorAxis = (m_pulsarMass/m_companionMass) * m_pulsarSemiMajorAxis;
// initial spin frequency of 0.5 Hz
......@@ -102,9 +102,6 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
// update camera based on settings above
updateCameraPosition(m_mouseAngleH, m_mouseAngleV, m_cameraZoom);
// finally, create initial pulse profile based on settings above
updatePulseProfile();
}
PulsarAnimationWidget::~PulsarAnimationWidget()
......@@ -512,6 +509,14 @@ void PulsarAnimationWidget::mouseReleaseEvent(QMouseEvent *event)
updateGL();
}
void PulsarAnimationWidget::showEvent(QShowEvent *event)
{
Q_UNUSED(event);
// update and propagate pulse profile
updatePulseProfile();
}
void PulsarAnimationWidget::updateCameraPosition(const int angleH, const int angleV, const double zoom)
{
m_cameraPosX = sin(angleH * deg2rad) * cos(angleV * deg2rad) * zoom;
......
......@@ -70,6 +70,7 @@ private:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void showEvent(QShowEvent *event);
void updateOrbitPeriod();
void updateOrbitRadii();
......
......@@ -226,7 +226,7 @@
<number>180</number>
</property>
<property name="value" >
<number>45</number>
<number>60</number>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
......@@ -244,8 +244,11 @@
<property name="segmentStyle" >
<enum>QLCDNumber::Flat</enum>
</property>
<property name="value" stdset="0" >
<double>60.000000000000000</double>
</property>
<property name="intValue" stdset="0" >
<number>45</number>
<number>60</number>
</property>
</widget>
</item>
......
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