diff --git a/.gitignore b/.gitignore index 2635231b4e6f886b36824dc00b85c1a0cc9efb2b..8f8181c4d7ec48524e2d55ea7a5c76328eae37b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # patterns *~ -ui_*.h # files .project @@ -10,5 +9,7 @@ PulsatingScience # folders -debug/ -release/ \ No newline at end of file +.moc/ +.ui/ +.rcc/ +.obj/ \ No newline at end of file diff --git a/pulsatingscience.pro b/pulsatingscience.pro index aaf026870f382a6005f304d626b126fb376d2095..f326f327d3c9025c0cef49db825f58bcdf41f6e0 100644 --- a/pulsatingscience.pro +++ b/pulsatingscience.pro @@ -1,29 +1,35 @@ # ############################################################################## -# Copyright (C) 2008 by Oliver Bock # -# oliver.bock[AT]aei.mpg.de # -# # -# This file is part of PulsatingScience. # -# # -# PulsatingScience is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published # -# by the Free Software Foundation, version 3 of the License. # -# # -# PulsatingScience is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. # -# # +# Copyright (C) 2008 by Oliver Bock # +# oliver.bock[AT]aei.mpg.de # +# # +# This file is part of PulsatingScience. # +# # +# PulsatingScience is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published # +# by the Free Software Foundation, version 3 of the License. # +# # +# PulsatingScience is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. # +# # # ############################################################################## TEMPLATE = app TARGET = PulsatingScience QT += core \ gui \ opengl -HEADERS += src/pulsatingscience.h -SOURCES += src/pulsatingscience.cpp \ +HEADERS += src/pulsaranimationwidget.h \ + src/pulsatingscience.h +SOURCES += src/pulsaranimationwidget.cpp \ + src/pulsatingscience.cpp \ src/main.cpp FORMS += src/pulsatingscience.ui RESOURCES += src/pulsatingscience.qrc +UI_DIR = src/.ui +RCC_DIR = src/.rcc +MOC_DIR = src/.moc +OBJECTS_DIR = src/.obj \ No newline at end of file diff --git a/src/pulsaranimationwidget.cpp b/src/pulsaranimationwidget.cpp new file mode 100644 index 0000000000000000000000000000000000000000..67aed8becb2a62b51b7a14a9a31f8c7575babdc7 --- /dev/null +++ b/src/pulsaranimationwidget.cpp @@ -0,0 +1,45 @@ +/****************************************************************************** + * Copyright (C) 2008 by Oliver Bock * + * oliver.bock[AT]aei.mpg.de * + * * + * This file is part of PulsatingScience. * + * * + * PulsatingScience is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published * + * by the Free Software Foundation, version 3 of the License. * + * * + * PulsatingScience is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. * + * * + ******************************************************************************/ + +#include "pulsaranimationwidget.h" + +PulsarAnimationWidget::PulsarAnimationWidget(QWidget *parent) : QGLWidget(parent) +{ + +} + +PulsarAnimationWidget::~PulsarAnimationWidget() +{ + +} + +void PulsarAnimationWidget::initializeGL() +{ + +} + +void PulsarAnimationWidget::resizeGL(int w, int h) +{ + +} + +void PulsarAnimationWidget::paintGL() { + +} diff --git a/src/pulsaranimationwidget.h b/src/pulsaranimationwidget.h new file mode 100644 index 0000000000000000000000000000000000000000..5be88b7876c780790aa5097a51b0d26c61466ad6 --- /dev/null +++ b/src/pulsaranimationwidget.h @@ -0,0 +1,43 @@ +/****************************************************************************** + * Copyright (C) 2008 by Oliver Bock * + * oliver.bock[AT]aei.mpg.de * + * * + * This file is part of PulsatingScience. * + * * + * PulsatingScience is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published * + * by the Free Software Foundation, version 3 of the License. * + * * + * PulsatingScience is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. * + * * + ******************************************************************************/ + +#ifndef PULSARANIMATIONWIDGET_H_ +#define PULSARANIMATIONWIDGET_H_ + +#include <QGLWidget> + +class PulsarAnimationWidget : public QGLWidget +{ + Q_OBJECT + +public: + PulsarAnimationWidget(QWidget *parent); + virtual ~PulsarAnimationWidget(); + +protected: + + void initializeGL(); + + void resizeGL(int w, int h); + + void paintGL(); +}; + +#endif /* PULSARANIMATIONWIDGET_H_ */ diff --git a/src/pulsatingscience.cpp b/src/pulsatingscience.cpp index 23a24585842e5efcf8e91ba0f7eab3bdf9d7eb04..62072ca14f886cef9044a3ceea0310312998d294 100644 --- a/src/pulsatingscience.cpp +++ b/src/pulsatingscience.cpp @@ -23,6 +23,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); + ui.menuView->addAction(ui.dockAnimControl->toggleViewAction()); } PulsatingScience::~PulsatingScience() diff --git a/src/pulsatingscience.qrc b/src/pulsatingscience.qrc index 40da1037fd52f5b48308024ce8ea2194c1dcc986..0b97917bb7700a17c864797273537ce59fd61ccb 100644 --- a/src/pulsatingscience.qrc +++ b/src/pulsatingscience.qrc @@ -1,5 +1,12 @@ <RCC> <qresource prefix="icons" > + <file>resources/control-pause.png</file> + <file>resources/control-quit.png</file> + <file>resources/control-run.png</file> + <file>resources/control-stop.png</file> + <file>resources/help-about.png</file> + <file>resources/help-help.png</file> + <file>resources/help-website.png</file> <file>resources/aei-icon48.png</file> </qresource> </RCC> diff --git a/src/pulsatingscience.ui b/src/pulsatingscience.ui index aafe861c7fbab342e631e79a7b56dcabbd93c577..8abd8c678afacd56ed2e3aef4ab6151cca71ef0b 100644 --- a/src/pulsatingscience.ui +++ b/src/pulsatingscience.ui @@ -5,7 +5,7 @@ <rect> <x>0</x> <y>0</y> - <width>800</width> + <width>550</width> <height>600</height> </rect> </property> @@ -16,21 +16,178 @@ <iconset resource="pulsatingscience.qrc" > <normaloff>:/icons/resources/aei-icon48.png</normaloff>:/icons/resources/aei-icon48.png</iconset> </property> - <widget class="QWidget" name="centralwidget" /> - <widget class="QMenuBar" name="menubar" > + <widget class="QWidget" name="centralwidget" > + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <widget class="PulsarAnimationWidget" native="1" name="widget" /> + </item> + </layout> + </widget> + <widget class="QStatusBar" name="statusbar" /> + <widget class="QDockWidget" name="dockAnimControl" > + <property name="features" > + <set>QDockWidget::AllDockWidgetFeatures</set> + </property> + <property name="windowTitle" > + <string>Animation Control</string> + </property> + <attribute name="dockWidgetArea" > + <number>8</number> + </attribute> + <widget class="QWidget" name="dockWidgetContents" > + <layout class="QGridLayout" name="gridLayout_2" > + <item row="0" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string>Spin Frequency:</string> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="sliderSpinFrequency" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QLCDNumber" name="lcdSpinFrequency" /> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + <widget class="QMenuBar" name="menuBar" > <property name="geometry" > <rect> <x>0</x> <y>0</y> - <width>800</width> + <width>550</width> <height>21</height> </rect> </property> + <widget class="QMenu" name="menuView" > + <property name="title" > + <string>View</string> + </property> + </widget> + <widget class="QMenu" name="menuHelp" > + <property name="title" > + <string>Help</string> + </property> + <addaction name="actionHelp" /> + <addaction name="actionWebsite" /> + <addaction name="separator" /> + <addaction name="actionAbout" /> + </widget> + <widget class="QMenu" name="menuControl" > + <property name="title" > + <string>Control</string> + </property> + <addaction name="actionRun" /> + <addaction name="actionPause" /> + <addaction name="actionStop" /> + <addaction name="separator" /> + <addaction name="actionQuit" /> + </widget> + <addaction name="menuControl" /> + <addaction name="menuView" /> + <addaction name="menuHelp" /> </widget> - <widget class="QStatusBar" name="statusbar" /> + <action name="actionWebsite" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/help-website.png</normaloff>:/icons/resources/help-website.png</iconset> + </property> + <property name="text" > + <string>Website</string> + </property> + </action> + <action name="actionAbout" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/help-about.png</normaloff>:/icons/resources/help-about.png</iconset> + </property> + <property name="text" > + <string>About</string> + </property> + </action> + <action name="actionQuit" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/control-quit.png</normaloff>:/icons/resources/control-quit.png</iconset> + </property> + <property name="text" > + <string>Quit</string> + </property> + </action> + <action name="actionRun" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/control-run.png</normaloff>:/icons/resources/control-run.png</iconset> + </property> + <property name="text" > + <string>Run</string> + </property> + </action> + <action name="actionStop" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/control-stop.png</normaloff>:/icons/resources/control-stop.png</iconset> + </property> + <property name="text" > + <string>Stop</string> + </property> + </action> + <action name="actionPause" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/control-pause.png</normaloff>:/icons/resources/control-pause.png</iconset> + </property> + <property name="text" > + <string>Pause</string> + </property> + </action> + <action name="actionHelp" > + <property name="icon" > + <iconset resource="pulsatingscience.qrc" > + <normaloff>:/icons/resources/help-help.png</normaloff>:/icons/resources/help-help.png</iconset> + </property> + <property name="text" > + <string>Help</string> + </property> + </action> </widget> + <customwidgets> + <customwidget> + <class>PulsarAnimationWidget</class> + <extends>QWidget</extends> + <header>src/pulsaranimationwidget.h</header> + <container>1</container> + </customwidget> + </customwidgets> <resources> <include location="pulsatingscience.qrc" /> </resources> - <connections/> + <connections> + <connection> + <sender>actionQuit</sender> + <signal>activated()</signal> + <receiver>PulsatingScienceClass</receiver> + <slot>close()</slot> + <hints> + <hint type="sourcelabel" > + <x>-1</x> + <y>-1</y> + </hint> + <hint type="destinationlabel" > + <x>274</x> + <y>299</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/src/resources/control-pause.png b/src/resources/control-pause.png new file mode 100644 index 0000000000000000000000000000000000000000..d17123b9d40687ae9ec12070fe1804dcce11b6d3 Binary files /dev/null and b/src/resources/control-pause.png differ diff --git a/src/resources/control-quit.png b/src/resources/control-quit.png new file mode 100644 index 0000000000000000000000000000000000000000..1c7d8fb0ff606f3b5f8e78a7cdcbe530b2b842fe Binary files /dev/null and b/src/resources/control-quit.png differ diff --git a/src/resources/control-run.png b/src/resources/control-run.png new file mode 100644 index 0000000000000000000000000000000000000000..9b0acb78a22a27ce7169dd27e2d3b3c0c4a63f03 Binary files /dev/null and b/src/resources/control-run.png differ diff --git a/src/resources/control-stop.png b/src/resources/control-stop.png new file mode 100644 index 0000000000000000000000000000000000000000..603526cbfdd05c2f53d7dfff660e6e57e098819e Binary files /dev/null and b/src/resources/control-stop.png differ diff --git a/src/resources/help-about.png b/src/resources/help-about.png new file mode 100644 index 0000000000000000000000000000000000000000..88b58ee67e04b6af1501a0b3d81bdb87904ae6d6 Binary files /dev/null and b/src/resources/help-about.png differ diff --git a/src/resources/help-help.png b/src/resources/help-help.png new file mode 100644 index 0000000000000000000000000000000000000000..6bd02815da850b432fad2922161b2d3db3770067 Binary files /dev/null and b/src/resources/help-help.png differ diff --git a/src/resources/help-website.png b/src/resources/help-website.png new file mode 100644 index 0000000000000000000000000000000000000000..51b0258c5f31ba0ac2badce073a900d9dc5abdd2 Binary files /dev/null and b/src/resources/help-website.png differ