-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathSimulation.h
More file actions
53 lines (40 loc) · 1.05 KB
/
Simulation.h
File metadata and controls
53 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __Simulation_h__
#define __Simulation_h__
#include "Common/Common.h"
#include "SimulationModel.h"
#include "ParameterObject.h"
#include "TimeStep.h"
namespace PBD
{
/** \brief Class to manage the current simulation time and the time step size.
* This class is a singleton.
*/
class Simulation : public GenParam::ParameterObject
{
public:
static int GRAVITATION;
protected:
SimulationModel *m_model;
TimeStep *m_timeStep;
Vector3r m_gravitation;
virtual void initParameters();
private:
static Simulation *current;
public:
Simulation ();
Simulation(const Simulation&) = delete;
Simulation& operator=(const Simulation&) = delete;
~Simulation ();
void init();
void reset();
// Singleton
static Simulation* getCurrent ();
static void setCurrent (Simulation* tm);
static bool hasCurrent();
SimulationModel *getModel() { return m_model; }
void setModel(SimulationModel *model) { m_model = model; }
TimeStep *getTimeStep() { return m_timeStep; }
void setTimeStep(TimeStep *ts) { m_timeStep = ts; }
};
}
#endif