Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pulsatingscience
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
einsteinathome
pulsatingscience
Commits
3526540e
Commit
3526540e
authored
Sep 09, 2011
by
Oliver Bock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleansed source (tabs->spaces, indentation, trailing whitespaces)
parent
88dcf497
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
931 additions
and
933 deletions
+931
-933
pulsatingscience.pro
pulsatingscience.pro
+15
-15
src/main.cpp
src/main.cpp
+1
-1
src/pulsaranimationwidget.cpp
src/pulsaranimationwidget.cpp
+441
-443
src/pulsaranimationwidget.h
src/pulsaranimationwidget.h
+64
-64
src/pulsatingscience.cpp
src/pulsatingscience.cpp
+308
-308
src/pulsatingscience.h
src/pulsatingscience.h
+35
-35
src/pulsatingsciencehelp.cpp
src/pulsatingsciencehelp.cpp
+4
-4
src/pulsatingsciencehelp.h
src/pulsatingsciencehelp.h
+2
-2
src/pulsescopewidget.cpp
src/pulsescopewidget.cpp
+49
-49
src/pulsescopewidget.h
src/pulsescopewidget.h
+12
-12
No files found.
pulsatingscience.pro
View file @
3526540e
...
...
@@ -41,11 +41,11 @@ TS_DIR = src/resources
TRANSLATIONS
=
src
/
resources
/
pulsatingscience_de
.
ts
win32
{
RC_FILE
=
src
/
resources
/
pulsatingscience
.
rc
RC_FILE
=
src
/
resources
/
pulsatingscience
.
rc
}
macx
{
QMAKE_LFLAGS
+=
-
bind_at_load
ICON
=
src
/
resources
/
pulsatingscience
.
icns
QMAKE_LFLAGS
+=
-
bind_at_load
ICON
=
src
/
resources
/
pulsatingscience
.
icns
}
INCLUDEPATH
+=
.
/
...
...
@@ -55,18 +55,18 @@ MOC_DIR = src/.moc
OBJECTS_DIR
=
src
/.
obj
!
isEmpty
(
TRANSLATIONS
)
{
isEmpty
(
QMAKE_LRELEASE
)
{
win32
:
QMAKE_LRELEASE
=
$$
[
QT_INSTALL_BINS
]
\
lrelease
.
exe
else
:
QMAKE_LRELEASE
=
$$
[
QT_INSTALL_BINS
]
/
lrelease
}
isEmpty
(
QMAKE_LRELEASE
)
{
win32
:
QMAKE_LRELEASE
=
$$
[
QT_INSTALL_BINS
]
\
lrelease
.
exe
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
.
input
=
TRANSLATIONS
linguist
.
output
=
$$
TS_DIR
/
$
{
QMAKE_FILE_BASE
}.
qm
linguist
.
commands
=
$$
QMAKE_LRELEASE
$
{
QMAKE_FILE_IN
}
linguist
.
CONFIG
=
no_link
QMAKE_EXTRA_COMPILERS
+=
linguist
PRE_TARGETDEPS
+=
compiler_linguist_make_all
linguist
.
name
=
lrelease
$
{
QMAKE_FILE_IN
}
linguist
.
input
=
TRANSLATIONS
linguist
.
output
=
$$
TS_DIR
/
$
{
QMAKE_FILE_BASE
}.
qm
linguist
.
commands
=
$$
QMAKE_LRELEASE
$
{
QMAKE_FILE_IN
}
linguist
.
CONFIG
=
no_link
QMAKE_EXTRA_COMPILERS
+=
linguist
PRE_TARGETDEPS
+=
compiler_linguist_make_all
}
src/main.cpp
View file @
3526540e
...
...
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
PulsatingScience
window
;
if
(
argc
==
2
&&
QString
(
argv
[
1
])
==
"--demo"
)
{
window
.
toggleHiddenDemoMode
();
window
.
toggleHiddenDemoMode
();
}
window
.
show
();
...
...
src/pulsaranimationwidget.cpp
View file @
3526540e
This diff is collapsed.
Click to expand it.
src/pulsaranimationwidget.h
View file @
3526540e
...
...
@@ -33,34 +33,34 @@
class
PulsarAnimationWidget
:
public
QGLWidget
{
Q_OBJECT
Q_OBJECT
public:
PulsarAnimationWidget
(
QWidget
*
parent
);
virtual
~
PulsarAnimationWidget
();
PulsarAnimationWidget
(
QWidget
*
parent
);
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
);
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
();
void
pauseAnimation
();
void
stopAnimation
();
void
runAnimation
();
void
pauseAnimation
();
void
stopAnimation
();
void
updateFrame
();
void
updateFrame
();
void
showOrbits
(
bool
enabled
);
void
showRotationAxes
(
bool
enabled
);
void
showOrbits
(
bool
enabled
);
void
showRotationAxes
(
bool
enabled
);
signals:
void
pulsarSemiMajorAxisUpdated
(
double
value
);
void
pulseProfileUpdated
(
const
QVector
<
double
>&
data
);
void
pulsarAnimationStep
(
double
position
);
void
pulsarSemiMajorAxisUpdated
(
double
value
);
void
pulseProfileUpdated
(
const
QVector
<
double
>&
data
);
void
pulsarAnimationStep
(
double
position
);
private:
void
initializeGL
();
...
...
@@ -72,7 +72,7 @@ private:
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
void
showEvent
(
QShowEvent
*
event
);
void
updateOrbitPeriod
();
void
updateOrbitPeriod
();
void
updateOrbitRadii
();
void
updateCameraPosition
(
const
double
angleH
,
const
double
angleV
,
const
double
zoom
);
void
resetParameters
();
...
...
@@ -83,50 +83,50 @@ private:
GLUquadricObj
*
m_quadricCompanionOrbitPlane
;
GLUquadricObj
*
m_quadricCompanion
;
GLUquadricObj
*
m_quadricPulsarOrbitPlane
;
GLUquadricObj
*
m_quadricPulsar
;
GLUquadricObj
*
m_quadricPulsarCone1
;
GLUquadricObj
*
m_quadricPulsarCone2
;
GLUquadricObj
*
m_quadricPulsarSpinAxis
;
GLUquadricObj
*
m_quadricPulsarMagneticAxis
;
GLuint
m_pulsarTexture
;
GLuint
m_backgroundTexture
;
int
m_framesPerSecond
;
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
;
bool
m_showOrbits
;
bool
m_showRotationAxes
;
bool
m_cameraInteraction
;
int
m_mouseLastX
;
int
m_mouseLastY
;
double
m_mouseAngleH
;
double
m_mouseAngleV
;
double
m_cameraZoom
;
double
m_cameraZoomLBound
;
double
m_cameraZoomUBound
;
double
m_cameraPosX
;
double
m_cameraPosY
;
double
m_cameraPosZ
;
QVector
<
double
>
m_pulseProfile
;
static
const
double
deg2rad
;
GLUquadricObj
*
m_quadricPulsar
;
GLUquadricObj
*
m_quadricPulsarCone1
;
GLUquadricObj
*
m_quadricPulsarCone2
;
GLUquadricObj
*
m_quadricPulsarSpinAxis
;
GLUquadricObj
*
m_quadricPulsarMagneticAxis
;
GLuint
m_pulsarTexture
;
GLuint
m_backgroundTexture
;
int
m_framesPerSecond
;
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
;
bool
m_showOrbits
;
bool
m_showRotationAxes
;
bool
m_cameraInteraction
;
int
m_mouseLastX
;
int
m_mouseLastY
;
double
m_mouseAngleH
;
double
m_mouseAngleV
;
double
m_cameraZoom
;
double
m_cameraZoomLBound
;
double
m_cameraZoomUBound
;
double
m_cameraPosX
;
double
m_cameraPosY
;
double
m_cameraPosZ
;
QVector
<
double
>
m_pulseProfile
;
static
const
double
deg2rad
;
};
#endif
/* PULSARANIMATIONWIDGET_H_ */
src/pulsatingscience.cpp
View file @
3526540e
This diff is collapsed.
Click to expand it.
src/pulsatingscience.h
View file @
3526540e
...
...
@@ -43,37 +43,37 @@ public:
void
closeEvent
(
QCloseEvent
*
event
);
public
slots
:
void
on_pushRun_clicked
();
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
();
void
on_actionFullscreen_toggled
(
bool
checked
);
void
menuBarToggled
();
void
on_actionMenu_bar_toggled
(
bool
checked
);
void
on_actionStatus_bar_toggled
(
bool
checked
);
void
on_dockAnimControl_visibilityChanged
(
bool
visible
);
void
on_dockAnimControl_topLevelChanged
(
bool
topLevel
);
void
on_actionHelp_triggered
();
void
on_actionWebsite_triggered
();
void
on_actionAbout_triggered
();
void
updatePulsarSemiMajorAxisValue
(
double
value
);
void
toggleHiddenDemoMode
();
void
on_pushRun_clicked
();
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
();
void
on_actionFullscreen_toggled
(
bool
checked
);
void
menuBarToggled
();
void
on_actionMenu_bar_toggled
(
bool
checked
);
void
on_actionStatus_bar_toggled
(
bool
checked
);
void
on_dockAnimControl_visibilityChanged
(
bool
visible
);
void
on_dockAnimControl_topLevelChanged
(
bool
topLevel
);
void
on_actionHelp_triggered
();
void
on_actionWebsite_triggered
();
void
on_actionAbout_triggered
();
void
updatePulsarSemiMajorAxisValue
(
double
value
);
void
toggleHiddenDemoMode
();
private:
Ui
::
PulsatingScienceClass
ui
;
...
...
@@ -90,10 +90,10 @@ private:
bool
m_permanentOrbits
;
bool
m_rotationAxesVisible
;
bool
m_menuBarVisible
;
bool
m_statusBarVisible
;
bool
m_animControlVisible
;
bool
m_animControlFloating
;
bool
m_hiddenDemoModeActivated
;
bool
m_statusBarVisible
;
bool
m_animControlVisible
;
bool
m_animControlFloating
;
bool
m_hiddenDemoModeActivated
;
};
#endif // PULSATINGSCIENCE_H
src/pulsatingsciencehelp.cpp
View file @
3526540e
...
...
@@ -22,11 +22,11 @@
PulsatingScienceHelp
::
PulsatingScienceHelp
(
QWidget
*
parent
)
:
QDialog
(
parent
),
Ui
::
PulsatingScienceHelp
()
{
setupUi
(
this
);
setupUi
(
this
);
if
(
QLocale
::
system
().
language
()
==
QLocale
::
German
)
{
webView
->
setUrl
(
QUrl
(
"qrc:/content/resources/help_de.html"
));
}
if
(
QLocale
::
system
().
language
()
==
QLocale
::
German
)
{
webView
->
setUrl
(
QUrl
(
"qrc:/content/resources/help_de.html"
));
}
}
PulsatingScienceHelp
::~
PulsatingScienceHelp
()
...
...
src/pulsatingsciencehelp.h
View file @
3526540e
...
...
@@ -33,8 +33,8 @@ class PulsatingScienceHelp : public QDialog, private Ui::PulsatingScienceHelp
Q_OBJECT
public:
PulsatingScienceHelp
(
QWidget
*
parent
=
0
);
virtual
~
PulsatingScienceHelp
();
PulsatingScienceHelp
(
QWidget
*
parent
=
0
);
virtual
~
PulsatingScienceHelp
();
};
#endif
/* PULSATINGSCIENCEHELP_H */
src/pulsescopewidget.cpp
View file @
3526540e
...
...
@@ -21,77 +21,77 @@
#include "pulsescopewidget.h"
PulseScopeWidget
::
PulseScopeWidget
(
QWidget
*
parent
)
:
QGraphicsView
(
parent
),
m_scene
(),
m_data
()
m_scene
(),
m_data
()
{
setViewport
(
new
QGLWidget
(
QGLFormat
(
QGL
::
AlphaChannel
|
QGL
::
SampleBuffers
)));
QGLWidget
*
glScope
=
(
QGLWidget
*
)
viewport
();
setViewport
(
new
QGLWidget
(
QGLFormat
(
QGL
::
AlphaChannel
|
QGL
::
SampleBuffers
)));
QGLWidget
*
glScope
=
(
QGLWidget
*
)
viewport
();
QString
msgThis
=
tr
(
"pulse profile"
);
if
(
!
glScope
->
format
().
directRendering
())
{
QString
msg
=
tr
(
"Sorry, no direct rendering support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
doubleBuffer
())
{
QString
msg
=
tr
(
"Sorry, no double buffering support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
rgba
())
{
QString
msg
=
tr
(
"Sorry, no RGBA support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
alpha
())
{
QString
msg
=
tr
(
"Sorry, no alpha channel support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
sampleBuffers
())
{
QString
msg
=
tr
(
"Sorry, no multisampling support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
QString
msgThis
=
tr
(
"pulse profile"
);
if
(
!
glScope
->
format
().
directRendering
())
{
QString
msg
=
tr
(
"Sorry, no direct rendering support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
doubleBuffer
())
{
QString
msg
=
tr
(
"Sorry, no double buffering support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
rgba
())
{
QString
msg
=
tr
(
"Sorry, no RGBA support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
alpha
())
{
QString
msg
=
tr
(
"Sorry, no alpha channel support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
if
(
!
glScope
->
format
().
sampleBuffers
())
{
QString
msg
=
tr
(
"Sorry, no multisampling support for %1..."
);
qWarning
()
<<
msg
.
arg
(
msgThis
);
}
m_scopeSizeH
=
360.0
;
m_scopeSizeV
=
1.0
;
m_scopeSizeH
=
360.0
;
m_scopeSizeV
=
1.0
;
m_path
=
NULL
;
m_marker
=
m_scene
.
addLine
(
0.0
,
0.0
,
0.0
,
m_scopeSizeV
,
QPen
(
Qt
::
red
));
m_marker
->
setZValue
(
1
);
m_path
=
NULL
;
m_marker
=
m_scene
.
addLine
(
0.0
,
0.0
,
0.0
,
m_scopeSizeV
,
QPen
(
Qt
::
red
));
m_marker
->
setZValue
(
1
);
setScene
(
&
m_scene
);
setScene
(
&
m_scene
);
m_data
.
fill
(
0.0
,
qRound
(
m_scopeSizeH
));
drawCurve
(
m_data
);
m_data
.
fill
(
0.0
,
qRound
(
m_scopeSizeH
));
drawCurve
(
m_data
);
}
PulseScopeWidget
::~
PulseScopeWidget
()
{
m_scene
.
clear
();
m_scene
.
clear
();
}
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
)
{
m_data
=
vector
;
m_data
=
vector
;
QPainterPath
pulsePath
(
QPointF
(
0.0
,
m_scopeSizeV
-
m_data
.
at
(
0
)));
for
(
int
i
=
1
;
i
<
m_scopeSizeH
;
++
i
)
{
pulsePath
.
lineTo
(
i
,
m_scopeSizeV
-
m_data
.
at
(
i
));
}
if
(
m_path
==
NULL
)
{
m_path
=
m_scene
.
addPath
(
pulsePath
,
QPen
(
Qt
::
yellow
));
}
else
{
m_path
->
setPath
(
pulsePath
);
}
QPainterPath
pulsePath
(
QPointF
(
0.0
,
m_scopeSizeV
-
m_data
.
at
(
0
)));
for
(
int
i
=
1
;
i
<
m_scopeSizeH
;
++
i
)
{
pulsePath
.
lineTo
(
i
,
m_scopeSizeV
-
m_data
.
at
(
i
));
}
if
(
m_path
==
NULL
)
{
m_path
=
m_scene
.
addPath
(
pulsePath
,
QPen
(
Qt
::
yellow
));
}
else
{
m_path
->
setPath
(
pulsePath
);
}
fitInView
(
m_scene
.
itemsBoundingRect
(),
Qt
::
IgnoreAspectRatio
);
fitInView
(
m_scene
.
itemsBoundingRect
(),
Qt
::
IgnoreAspectRatio
);
}
void
PulseScopeWidget
::
setMarker
(
double
position
)
{
m_marker
->
setLine
(
position
,
0.0
,
position
,
m_scopeSizeV
);
m_marker
->
setLine
(
position
,
0.0
,
position
,
m_scopeSizeV
);
}
src/pulsescopewidget.h
View file @
3526540e
...
...
@@ -33,26 +33,26 @@
class
PulseScopeWidget
:
public
QGraphicsView
{
Q_OBJECT
Q_OBJECT
public:
PulseScopeWidget
(
QWidget
*
parent
=
0
);
virtual
~
PulseScopeWidget
();
PulseScopeWidget
(
QWidget
*
parent
=
0
);
virtual
~
PulseScopeWidget
();
void
resizeEvent
(
QResizeEvent
*
event
);
void
resizeEvent
(
QResizeEvent
*
event
);
public
slots
:
void
drawCurve
(
const
QVector
<
double
>&
vector
);
void
setMarker
(
double
position
);
void
drawCurve
(
const
QVector
<
double
>&
vector
);
void
setMarker
(
double
position
);
private:
QGraphicsScene
m_scene
;
QVector
<
double
>
m_data
;
QGraphicsPathItem
*
m_path
;
QGraphicsLineItem
*
m_marker
;
QGraphicsScene
m_scene
;
QVector
<
double
>
m_data
;
QGraphicsPathItem
*
m_path
;
QGraphicsLineItem
*
m_marker
;
double
m_scopeSizeH
;
double
m_scopeSizeV
;
double
m_scopeSizeH
;
double
m_scopeSizeV
;
};
#endif
/* PULSESCOPEWIDGET_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment