Commit 3c302dfe authored by Oliver Bock's avatar Oliver Bock
Browse files

Added Virgo

parent 399e2ccf
......@@ -53,8 +53,8 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
connect(&m_frameTimer, SIGNAL(timeout()), this, SLOT(updateFrame()));
// initialize quadric pointers
m_quadricCompanionOrbitPlane = NULL;
m_quadricCompanion = NULL;
m_quadricVirgoh = NULL;
m_quadricVirgov = NULL;
m_quadricPulsarOrbitPlane = NULL;
m_quadricPulsar = NULL;
m_quadricLLOh = NULL;
......@@ -78,7 +78,7 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
// initial parameters (have to match GUI!)
m_LHOAngle = 180;
m_LLOAngle = -100;
m_VirgoAngle = 0;
m_VirgoAngle = 165;
m_pulsarRadius = 3.0;
m_pulsarSpinAxisInclination = 0.0;
......@@ -116,8 +116,8 @@ PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) :
PulsarAnimationWidget::~PulsarAnimationWidget()
{
if(m_quadricCompanionOrbitPlane) gluDeleteQuadric(m_quadricCompanionOrbitPlane);
if(m_quadricCompanion) gluDeleteQuadric(m_quadricCompanion);
if(m_quadricVirgoh) gluDeleteQuadric(m_quadricVirgoh);
if(m_quadricVirgov) gluDeleteQuadric(m_quadricVirgov);
if(m_quadricPulsarOrbitPlane) gluDeleteQuadric(m_quadricPulsarOrbitPlane);
if(m_quadricPulsar) gluDeleteQuadric(m_quadricPulsar);
if(m_quadricLLOh) gluDeleteQuadric(m_quadricLLOh);
......@@ -161,8 +161,8 @@ void PulsarAnimationWidget::initializeGL()
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
m_quadricCompanionOrbitPlane = gluNewQuadric();
m_quadricCompanion = gluNewQuadric();
m_quadricVirgoh = gluNewQuadric();
m_quadricVirgov = gluNewQuadric();
m_quadricPulsarOrbitPlane = gluNewQuadric();
m_quadricPulsar = gluNewQuadric();
m_quadricLLOh = gluNewQuadric();
......@@ -172,8 +172,8 @@ void PulsarAnimationWidget::initializeGL()
m_quadricLHOv = gluNewQuadric();
m_quadricLHOh = gluNewQuadric();
gluQuadricNormals(m_quadricCompanionOrbitPlane, GLU_SMOOTH);
gluQuadricNormals(m_quadricCompanion, GLU_SMOOTH);
gluQuadricNormals(m_quadricVirgoh, GLU_SMOOTH);
gluQuadricNormals(m_quadricVirgov, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsarOrbitPlane, GLU_SMOOTH);
gluQuadricNormals(m_quadricPulsar, GLU_SMOOTH);
gluQuadricNormals(m_quadricLLOh, GLU_SMOOTH);
......@@ -358,6 +358,33 @@ void PulsarAnimationWidget::paintGL()
}
glPopMatrix();
// draw Virgo
glPushMatrix();
{
glColor3f(1.0f, 1.0f, 1.0f);
glRotatef(50, 0.0, 1.0, 0.0);
glRotatef(-43, 1.0, 0.0, 0.0);
glTranslatef(0.0, 0.0, m_pulsarRadius);
glRotatef(m_VirgoAngle, 0.0, 0.0, 1.0);
glPushMatrix();
{
glRotatef(90, 0.0, 1.0, 0.0);
gluCylinder(m_quadricVirgoh, 0.010, 0.010, 0.20, 32, 1);
}
glPopMatrix();
glPushMatrix();
{
glRotatef(90, 0.0, 1.0, 0.0);
glRotatef(90, 1.0, 0.0, 0.0);
glColor3f(0.5f, 1.0f, 0.5f);
gluCylinder(m_quadricVirgov, 0.010, 0.010, 0.20, 32, 1);
}
glPopMatrix();
}
glPopMatrix();
// draw source
glPushMatrix();
{
......@@ -620,7 +647,7 @@ void PulsarAnimationWidget::setLLOAngle(const double degrees)
void PulsarAnimationWidget::setVirgoAngle(const int degrees)
{
m_VirgoAngle = degrees;
m_VirgoAngle = degrees + 165;
updatePulseProfile();
updateGL();
......
......@@ -90,8 +90,8 @@ private:
QTimer m_frameTimer;
GLUquadricObj *m_quadricCompanionOrbitPlane;
GLUquadricObj *m_quadricCompanion;
GLUquadricObj *m_quadricVirgoh;
GLUquadricObj *m_quadricVirgov;
GLUquadricObj *m_quadricPulsarOrbitPlane;
GLUquadricObj *m_quadricPulsar;
GLUquadricObj *m_quadricLLOh;
......
......@@ -216,6 +216,7 @@ void PulsatingScience::on_sliderLLOAngle_valueChanged(int value)
void PulsatingScience::on_sliderVirgoAngle_valueChanged(int value)
{
ui.pulsarGlWidget->setVirgoAngle(value);
ui.lcdVirgoAngle->display(QString::number(value));
}
......
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