Space Comps
 All Classes Files Functions Variables
collisionsystem.h
1 #ifndef COLLISIONSYSTEM_H
2 #define COLLISIONSYSTEM_H
3 
4 #include <QMainWindow>
5 #include <QThread>
6 #include <QCloseEvent>
7 #include "qalgorithm.h"
8 #include "collisiondisplay3d.h"
9 
10 namespace Ui {
11 class CollisionSystem;
12 }
13 
20 class CollisionSystem : public QMainWindow
21 {
22  Q_OBJECT
23 
24 public:
34  explicit CollisionSystem(QWidget *parent = 0);
35  ~CollisionSystem();
36 
43  void setSeed();
50  void setNumParticles();
51 
58  void setRadiusRange();
59 
60 private:
61  void initializeConnections();
62  void closeEvent(QCloseEvent* event);
63 
64  Ui::CollisionSystem *ui;
65  QAlgorithm* qalg;
66  QThread* cdThread;
67  QThread* algThread;
68  QTimer outputTimer;
69 
70  bool paused;
71  bool algRunning;
72  bool displayRunning;
73  bool space2D;
74 
75  CollisionDisplay3D* collisionDisplay3D;
76  QWidget* display3DContainer;
77 
78  QCloseEvent* closing;
79 
80 public slots:
89  void start();
90 
99  void terminate();
100 
109  void printInfo();
110 
123  void changePausedState();
124 
133  void resetCamera();
134 
143  void generateSeed();
144 
152  void setAlgFinished();
153 
161  void setDisplayFinished();
162 
172  void setLookaheadTime(double d);
173 
185  void setTargetFramerate(int n);
186 
197  void setMinRadiusMax(double d);
198 
209  void setMaxRadiusMin(double d);
210 
222  void setTimestepLimit(int n);
223 
233  void setTimestepLimitEnabled(bool b);
234 
245  void setSpace(int b);
246 
247 signals:
251  void begin();
252 };
253 
254 #endif // COLLISIONSYSTEM_H
void setSeed()
Sets the seed for the random number generator.
Definition: collisionsystem.cpp:168
void start()
Creates an Algorithm and sets up connections to the GUI.
Definition: collisionsystem.cpp:178
void printInfo()
Prints selected information to the GUI text output.
Definition: collisionsystem.cpp:372
The QAlgorithm class is a QT wrapper for Algorithm.
Definition: qalgorithm.h:13
void resetCamera()
Moves the camera back to the starting position (for a 3D display only).
Definition: collisionsystem.cpp:468
void setTimestepLimitEnabled(bool b)
Enables or disables the timestep limit input field.
Definition: collisionsystem.cpp:514
void setTargetFramerate(int n)
Sets the new target framerate for the display.
Definition: collisionsystem.cpp:493
void setSpace(int b)
Sets the variable representing the simulation dimensionality.
Definition: collisionsystem.cpp:524
The view containing 3D visualization.
Definition: collisiondisplay3d.h:17
void changePausedState()
Pauses or unpauses the display.
Definition: collisionsystem.cpp:443
void terminate()
Kills the algorithm thread and cleans up for the next algorithm.
Definition: collisionsystem.cpp:312
void setNumParticles()
Sets the number of particles with which an Algorithm will run.
Definition: collisionsystem.cpp:163
The main window of the graphical interface.
Definition: collisionsystem.h:20
void setAlgFinished()
Tells the CollisionSystem the the Algorithm is no longer running.
Definition: collisionsystem.cpp:479
CollisionSystem(QWidget *parent=0)
Constructs a CollisionSystem object.
Definition: collisionsystem.cpp:16
void setDisplayFinished()
Tells the CollisionSystem that the display is no longer running.
Definition: collisionsystem.cpp:484
void setMinRadiusMax(double d)
Sets the maximum value for the minimum radius input.
Definition: collisionsystem.cpp:500
void begin()
A signal emitted to begin the Algorithm and display.
void generateSeed()
Generates a new seed for the random number generator.
Definition: collisionsystem.cpp:474
void setMaxRadiusMin(double d)
Sets the minimum value for the maximum radius input.
Definition: collisionsystem.cpp:505
void setTimestepLimit(int n)
Sets a limit on the number of timesteps the Algorithm will run.
Definition: collisionsystem.cpp:510
void setRadiusRange()
Sets the range for Particle radius.
Definition: collisionsystem.cpp:172
void setLookaheadTime(double d)
Changes the lookahead time to the specified value.
Definition: collisionsystem.cpp:489