Commit 3526540e authored by Oliver Bock's avatar Oliver Bock

Cleansed source (tabs->spaces, indentation, trailing whitespaces)

parent 88dcf497
...@@ -41,11 +41,11 @@ TS_DIR = src/resources ...@@ -41,11 +41,11 @@ TS_DIR = src/resources
TRANSLATIONS = src/resources/pulsatingscience_de.ts TRANSLATIONS = src/resources/pulsatingscience_de.ts
win32 { win32 {
RC_FILE = src/resources/pulsatingscience.rc RC_FILE = src/resources/pulsatingscience.rc
} }
macx { macx {
QMAKE_LFLAGS += -bind_at_load QMAKE_LFLAGS += -bind_at_load
ICON = src/resources/pulsatingscience.icns ICON = src/resources/pulsatingscience.icns
} }
INCLUDEPATH += ./ INCLUDEPATH += ./
...@@ -55,18 +55,18 @@ MOC_DIR = src/.moc ...@@ -55,18 +55,18 @@ MOC_DIR = src/.moc
OBJECTS_DIR = src/.obj OBJECTS_DIR = src/.obj
!isEmpty(TRANSLATIONS) { !isEmpty(TRANSLATIONS) {
isEmpty(QMAKE_LRELEASE) { isEmpty(QMAKE_LRELEASE) {
win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
} }
isEmpty(TS_DIR):TS_DIR = translations isEmpty(TS_DIR):TS_DIR = translations
linguist.name = lrelease ${QMAKE_FILE_IN} linguist.name = lrelease ${QMAKE_FILE_IN}
linguist.input = TRANSLATIONS linguist.input = TRANSLATIONS
linguist.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm linguist.output = $$TS_DIR/${QMAKE_FILE_BASE}.qm
linguist.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} linguist.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN}
linguist.CONFIG = no_link linguist.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += linguist QMAKE_EXTRA_COMPILERS += linguist
PRE_TARGETDEPS += compiler_linguist_make_all PRE_TARGETDEPS += compiler_linguist_make_all
} }
...@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) ...@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
PulsatingScience window; PulsatingScience window;
if(argc == 2 && QString(argv[1]) == "--demo") { if(argc == 2 && QString(argv[1]) == "--demo") {
window.toggleHiddenDemoMode(); window.toggleHiddenDemoMode();
} }
window.show(); window.show();
......
This diff is collapsed.
...@@ -33,34 +33,34 @@ ...@@ -33,34 +33,34 @@
class PulsarAnimationWidget : public QGLWidget class PulsarAnimationWidget : public QGLWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
PulsarAnimationWidget(QWidget *parent); PulsarAnimationWidget(QWidget *parent);
virtual ~PulsarAnimationWidget(); virtual ~PulsarAnimationWidget();
void setFramePerSecond(const unsigned int fps); void setFramePerSecond(const unsigned int fps);
void setCompanionMass(const double mass); void setCompanionMass(const double mass);
void setPulsarMass(const double mass); void setPulsarMass(const double mass);
void setPulsarSpinFrequency(const double frequency); void setPulsarSpinFrequency(const double frequency);
void setPulsarSpinAxisInclination(const int degrees); void setPulsarSpinAxisInclination(const int degrees);
void setPulsarMagneticAxisInclination(const int degrees); void setPulsarMagneticAxisInclination(const int degrees);
void setPulsarSemiMajorAxis(const double length); void setPulsarSemiMajorAxis(const double length);
public slots: public slots:
void runAnimation(); void runAnimation();
void pauseAnimation(); void pauseAnimation();
void stopAnimation(); void stopAnimation();
void updateFrame(); void updateFrame();
void showOrbits(bool enabled); void showOrbits(bool enabled);
void showRotationAxes(bool enabled); void showRotationAxes(bool enabled);
signals: signals:
void pulsarSemiMajorAxisUpdated(double value); void pulsarSemiMajorAxisUpdated(double value);
void pulseProfileUpdated(const QVector<double>& data); void pulseProfileUpdated(const QVector<double>& data);
void pulsarAnimationStep(double position); void pulsarAnimationStep(double position);
private: private:
void initializeGL(); void initializeGL();
...@@ -72,7 +72,7 @@ private: ...@@ -72,7 +72,7 @@ private:
void mouseReleaseEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event);
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
void updateOrbitPeriod(); void updateOrbitPeriod();
void updateOrbitRadii(); void updateOrbitRadii();
void updateCameraPosition(const double angleH, const double angleV, const double zoom); void updateCameraPosition(const double angleH, const double angleV, const double zoom);
void resetParameters(); void resetParameters();
...@@ -83,50 +83,50 @@ private: ...@@ -83,50 +83,50 @@ private:
GLUquadricObj *m_quadricCompanionOrbitPlane; GLUquadricObj *m_quadricCompanionOrbitPlane;
GLUquadricObj *m_quadricCompanion; GLUquadricObj *m_quadricCompanion;
GLUquadricObj *m_quadricPulsarOrbitPlane; GLUquadricObj *m_quadricPulsarOrbitPlane;
GLUquadricObj *m_quadricPulsar; GLUquadricObj *m_quadricPulsar;
GLUquadricObj *m_quadricPulsarCone1; GLUquadricObj *m_quadricPulsarCone1;
GLUquadricObj *m_quadricPulsarCone2; GLUquadricObj *m_quadricPulsarCone2;
GLUquadricObj *m_quadricPulsarSpinAxis; GLUquadricObj *m_quadricPulsarSpinAxis;
GLUquadricObj *m_quadricPulsarMagneticAxis; GLUquadricObj *m_quadricPulsarMagneticAxis;
GLuint m_pulsarTexture; GLuint m_pulsarTexture;
GLuint m_backgroundTexture; GLuint m_backgroundTexture;
int m_framesPerSecond; int m_framesPerSecond;
double m_pulsarRotationAngle; double m_pulsarRotationAngle;
double m_pulsarRotationDelta; double m_pulsarRotationDelta;
double m_orbitalPeriod; double m_orbitalPeriod;
double m_orbitRotationAngle; double m_orbitRotationAngle;
double m_orbitRotationDelta; double m_orbitRotationDelta;
double m_pulsarMass; double m_pulsarMass;
double m_pulsarSemiMajorAxis; double m_pulsarSemiMajorAxis;
double m_companionMass; double m_companionMass;
double m_companionSemiMajorAxis; double m_companionSemiMajorAxis;
double m_pulsarSpinAxisInclination; double m_pulsarSpinAxisInclination;
double m_pulsarMagneticAxisInclination; double m_pulsarMagneticAxisInclination;
bool m_showOrbits; bool m_showOrbits;
bool m_showRotationAxes; bool m_showRotationAxes;
bool m_cameraInteraction; bool m_cameraInteraction;
int m_mouseLastX; int m_mouseLastX;
int m_mouseLastY; int m_mouseLastY;
double m_mouseAngleH; double m_mouseAngleH;
double m_mouseAngleV; double m_mouseAngleV;
double m_cameraZoom; double m_cameraZoom;
double m_cameraZoomLBound; double m_cameraZoomLBound;
double m_cameraZoomUBound; double m_cameraZoomUBound;
double m_cameraPosX; double m_cameraPosX;
double m_cameraPosY; double m_cameraPosY;
double m_cameraPosZ; double m_cameraPosZ;
QVector<double> m_pulseProfile; QVector<double> m_pulseProfile;
static const double deg2rad; static const double deg2rad;
}; };
#endif /* PULSARANIMATIONWIDGET_H_ */ #endif /* PULSARANIMATIONWIDGET_H_ */
This diff is collapsed.
...@@ -43,37 +43,37 @@ public: ...@@ -43,37 +43,37 @@ public:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
public slots: public slots:
void on_pushRun_clicked(); void on_pushRun_clicked();
void on_pushPause_clicked(); void on_pushPause_clicked();
void on_pushStop_clicked(); void on_pushStop_clicked();
void on_radioCompanionWD_toggled(bool checked); void on_radioCompanionWD_toggled(bool checked);
void on_radioCompanionSun_toggled(bool checked); void on_radioCompanionSun_toggled(bool checked);
void on_radioCompanionNS_toggled(bool checked); void on_radioCompanionNS_toggled(bool checked);
void on_sliderPulsarMass_valueChanged(int value); void on_sliderPulsarMass_valueChanged(int value);
void on_sliderPulsarSpinFrequency_valueChanged(int value); void on_sliderPulsarSpinFrequency_valueChanged(int value);
void on_sliderPulsarSpinAxisInclination_valueChanged(int value); void on_sliderPulsarSpinAxisInclination_valueChanged(int value);
void on_sliderPulsarMagneticAxisInclination_valueChanged(int value); void on_sliderPulsarMagneticAxisInclination_valueChanged(int value);
void on_sliderPulsarSemiMajorAxis_valueChanged(int value); void on_sliderPulsarSemiMajorAxis_valueChanged(int value);
void permanentOrbitsToggled(); void permanentOrbitsToggled();
void on_actionPermanent_orbits_toggled(bool checked); void on_actionPermanent_orbits_toggled(bool checked);
void rotationAxesToggled(); void rotationAxesToggled();
void on_actionRotationAxes_toggled(bool checked); void on_actionRotationAxes_toggled(bool checked);
void fullscreenToggled(); void fullscreenToggled();
void on_actionFullscreen_toggled(bool checked); void on_actionFullscreen_toggled(bool checked);
void menuBarToggled(); void menuBarToggled();
void on_actionMenu_bar_toggled(bool checked); void on_actionMenu_bar_toggled(bool checked);
void on_actionStatus_bar_toggled(bool checked); void on_actionStatus_bar_toggled(bool checked);
void on_dockAnimControl_visibilityChanged(bool visible); void on_dockAnimControl_visibilityChanged(bool visible);
void on_dockAnimControl_topLevelChanged(bool topLevel); void on_dockAnimControl_topLevelChanged(bool topLevel);
void on_actionHelp_triggered(); void on_actionHelp_triggered();
void on_actionWebsite_triggered(); void on_actionWebsite_triggered();
void on_actionAbout_triggered(); void on_actionAbout_triggered();
void updatePulsarSemiMajorAxisValue(double value); void updatePulsarSemiMajorAxisValue(double value);
void toggleHiddenDemoMode(); void toggleHiddenDemoMode();
private: private:
Ui::PulsatingScienceClass ui; Ui::PulsatingScienceClass ui;
...@@ -90,10 +90,10 @@ private: ...@@ -90,10 +90,10 @@ private:
bool m_permanentOrbits; bool m_permanentOrbits;
bool m_rotationAxesVisible; bool m_rotationAxesVisible;
bool m_menuBarVisible; bool m_menuBarVisible;
bool m_statusBarVisible; bool m_statusBarVisible;
bool m_animControlVisible; bool m_animControlVisible;
bool m_animControlFloating; bool m_animControlFloating;
bool m_hiddenDemoModeActivated; bool m_hiddenDemoModeActivated;
}; };
#endif // PULSATINGSCIENCE_H #endif // PULSATINGSCIENCE_H
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
PulsatingScienceHelp::PulsatingScienceHelp(QWidget *parent) : QDialog(parent), Ui::PulsatingScienceHelp() PulsatingScienceHelp::PulsatingScienceHelp(QWidget *parent) : QDialog(parent), Ui::PulsatingScienceHelp()
{ {
setupUi(this); setupUi(this);
if(QLocale::system().language() == QLocale::German) { if(QLocale::system().language() == QLocale::German) {
webView->setUrl(QUrl("qrc:/content/resources/help_de.html")); webView->setUrl(QUrl("qrc:/content/resources/help_de.html"));
} }
} }
PulsatingScienceHelp::~PulsatingScienceHelp() PulsatingScienceHelp::~PulsatingScienceHelp()
......
...@@ -33,8 +33,8 @@ class PulsatingScienceHelp : public QDialog, private Ui::PulsatingScienceHelp ...@@ -33,8 +33,8 @@ class PulsatingScienceHelp : public QDialog, private Ui::PulsatingScienceHelp
Q_OBJECT Q_OBJECT
public: public:
PulsatingScienceHelp(QWidget *parent = 0); PulsatingScienceHelp(QWidget *parent = 0);
virtual ~PulsatingScienceHelp(); virtual ~PulsatingScienceHelp();
}; };
#endif /* PULSATINGSCIENCEHELP_H */ #endif /* PULSATINGSCIENCEHELP_H */
...@@ -21,77 +21,77 @@ ...@@ -21,77 +21,77 @@
#include "pulsescopewidget.h" #include "pulsescopewidget.h"
PulseScopeWidget::PulseScopeWidget(QWidget *parent) : QGraphicsView(parent), PulseScopeWidget::PulseScopeWidget(QWidget *parent) : QGraphicsView(parent),
m_scene(), m_scene(),
m_data() m_data()
{ {
setViewport(new QGLWidget(QGLFormat(QGL::AlphaChannel | QGL::SampleBuffers))); setViewport(new QGLWidget(QGLFormat(QGL::AlphaChannel | QGL::SampleBuffers)));
QGLWidget *glScope = (QGLWidget*) viewport(); QGLWidget *glScope = (QGLWidget*) viewport();
QString msgThis = tr("pulse profile"); QString msgThis = tr("pulse profile");
if(!glScope->format().directRendering()) { if(!glScope->format().directRendering()) {
QString msg = tr("Sorry, no direct rendering support for %1..."); QString msg = tr("Sorry, no direct rendering support for %1...");
qWarning() << msg.arg(msgThis); qWarning() << msg.arg(msgThis);
} }
if(!glScope->format().doubleBuffer()) { if(!glScope->format().doubleBuffer()) {
QString msg = tr("Sorry, no double buffering support for %1..."); QString msg = tr("Sorry, no double buffering support for %1...");
qWarning() << msg.arg(msgThis); qWarning() << msg.arg(msgThis);
} }
if(!glScope->format().rgba()) { if(!glScope->format().rgba()) {
QString msg = tr("Sorry, no RGBA support for %1..."); QString msg = tr("Sorry, no RGBA support for %1...");
qWarning() << msg.arg(msgThis); qWarning() << msg.arg(msgThis);
} }
if(!glScope->format().alpha()) { if(!glScope->format().alpha()) {
QString msg = tr("Sorry, no alpha channel support for %1..."); QString msg = tr("Sorry, no alpha channel support for %1...");
qWarning() << msg.arg(msgThis); qWarning() << msg.arg(msgThis);
} }
if(!glScope->format().sampleBuffers()) { if(!glScope->format().sampleBuffers()) {
QString msg = tr("Sorry, no multisampling support for %1..."); QString msg = tr("Sorry, no multisampling support for %1...");
qWarning() << msg.arg(msgThis); qWarning() << msg.arg(msgThis);
} }
m_scopeSizeH = 360.0; m_scopeSizeH = 360.0;
m_scopeSizeV = 1.0; m_scopeSizeV = 1.0;
m_path = NULL; m_path = NULL;
m_marker = m_scene.addLine(0.0, 0.0, 0.0, m_scopeSizeV, QPen(Qt::red)); m_marker = m_scene.addLine(0.0, 0.0, 0.0, m_scopeSizeV, QPen(Qt::red));
m_marker->setZValue(1); m_marker->setZValue(1);
setScene(&m_scene); setScene(&m_scene);
m_data.fill(0.0, qRound(m_scopeSizeH)); m_data.fill(0.0, qRound(m_scopeSizeH));
drawCurve(m_data); drawCurve(m_data);
} }
PulseScopeWidget::~PulseScopeWidget() PulseScopeWidget::~PulseScopeWidget()
{ {
m_scene.clear(); m_scene.clear();
} }
void PulseScopeWidget::resizeEvent(QResizeEvent *event) void PulseScopeWidget::resizeEvent(QResizeEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
fitInView(m_scene.itemsBoundingRect(), Qt::IgnoreAspectRatio); fitInView(m_scene.itemsBoundingRect(), Qt::IgnoreAspectRatio);
} }
void PulseScopeWidget::drawCurve(const QVector<double>& vector) void PulseScopeWidget::drawCurve(const QVector<double>& vector)
{ {
m_data = vector; m_data = vector;
QPainterPath pulsePath(QPointF(0.0, m_scopeSizeV - m_data.at(0))); QPainterPath pulsePath(QPointF(0.0, m_scopeSizeV - m_data.at(0)));
for(int i = 1; i < m_scopeSizeH; ++i) { for(int i = 1; i < m_scopeSizeH; ++i) {
pulsePath.lineTo(i, m_scopeSizeV - m_data.at(i)); pulsePath.lineTo(i, m_scopeSizeV - m_data.at(i));
} }
if(m_path == NULL) { if(m_path == NULL) {
m_path = m_scene.addPath(pulsePath, QPen(Qt::yellow)); m_path = m_scene.addPath(pulsePath, QPen(Qt::yellow));
} }
else { else {
m_path->setPath(pulsePath); m_path->setPath(pulsePath);
} }
fitInView(m_scene.itemsBoundingRect(), Qt::IgnoreAspectRatio); fitInView(m_scene.itemsBoundingRect(), Qt::IgnoreAspectRatio);
} }
void PulseScopeWidget::setMarker(double position) { void PulseScopeWidget::setMarker(double position) {
m_marker->setLine(position, 0.0, position, m_scopeSizeV); m_marker->setLine(position, 0.0, position, m_scopeSizeV);
} }
...@@ -33,26 +33,26 @@ ...@@ -33,26 +33,26 @@
class PulseScopeWidget : public QGraphicsView class PulseScopeWidget : public QGraphicsView
{ {
Q_OBJECT Q_OBJECT
public: public:
PulseScopeWidget(QWidget *parent = 0); PulseScopeWidget(QWidget *parent = 0);
virtual ~PulseScopeWidget(); virtual ~PulseScopeWidget();
void resizeEvent(QResizeEvent *event); void resizeEvent(QResizeEvent *event);
public slots: public slots:
void drawCurve(const QVector<double>& vector); void drawCurve(const QVector<double>& vector);
void setMarker(double position); void setMarker(double position);
private: private:
QGraphicsScene m_scene; QGraphicsScene m_scene;
QVector<double> m_data; QVector<double> m_data;
QGraphicsPathItem *m_path; QGraphicsPathItem *m_path;
QGraphicsLineItem *m_marker; QGraphicsLineItem *m_marker;
double m_scopeSizeH; double m_scopeSizeH;
double m_scopeSizeV; double m_scopeSizeV;
}; };
#endif /* PULSESCOPEWIDGET_H_ */ #endif /* PULSESCOPEWIDGET_H_ */
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