Space Comps
 All Classes Files Functions Variables
qalgorithm.h
1 #ifndef QALGORITHM_H
2 #define QALGORITHM_H
3 
4 #include <QObject>
5 #include "algorithm.h"
6 
13 class QAlgorithm : public QObject
14 {
15  Q_OBJECT
16 public:
24  explicit QAlgorithm(Algorithm* a, QObject *parent = 0);
25  ~QAlgorithm();
26 
32  void setAlgorithm(Algorithm* a);
33 
39 
45  std::vector<Particle*> getParticles();
46 
53 
58  double getSystemKE();
59 
64  double getSystemPE();
65 
66 signals:
71  void finished();
72 
73 public slots:
77  void run();
78 
82  void stop();
83 
84 private:
85  Algorithm* alg;
86 
87 };
88 
89 #endif // QALGORITHM_H
The Algorithm class is a parent to all the specific Algorithms we test.
Definition: algorithm.h:16
The QAlgorithm class is a QT wrapper for Algorithm.
Definition: qalgorithm.h:13
void setAlgorithm(Algorithm *a)
setAlgorithm setter for the Algorithm it is wrapping and interacting with.
Definition: qalgorithm.cpp:24
void run()
runs the Algorithm algs and emits the signal finished() once algs is done.
Definition: qalgorithm.cpp:29
Definition: particle.h:12
QAlgorithm(Algorithm *a, QObject *parent=0)
QAlgorithm constructor calls the QObject constructor on its parent if it has one. It also initializes...
Definition: qalgorithm.cpp:3
std::vector< Particle * > getParticles()
getParticles getter for the list of Particle's in the environment, which the Algorithm algs knows abo...
Definition: qalgorithm.cpp:14
void stop()
stops the Algorithm algs.
Definition: qalgorithm.cpp:35
Particle * getCenterOfGravity()
getCenterOfGravity getter for the Particle that represetns the center of gravity, which the Algorithm...
Definition: qalgorithm.cpp:19
void finished()
finished signal emited to begin the process of terminating the visualization and simulation.
double getSystemPE()
getSystemPE goes to the Algorithm algs to get the system potential energy.
Definition: qalgorithm.cpp:50
Algorithm * getAlgorithm()
getAlgorithm getter for Algorithm currently wrapping.
Definition: qalgorithm.cpp:40
double getSystemKE()
getSystemKE goes to the Algorithm algs to get the system kinetic energy.
Definition: qalgorithm.cpp:45