23 |
|
* |
24 |
|
*/ |
25 |
|
|
26 |
+ |
#include "brains/SimInfo.hpp" |
27 |
+ |
#include "brains/SimSnapshotManager.hpp" |
28 |
+ |
|
29 |
|
namespace oopse { |
30 |
|
|
31 |
< |
SimSnapshotManager::SimSnapshotManager(SimModel* model) : model_(model){ |
32 |
< |
int nAtoms = model->getNAtoms(); |
33 |
< |
int nRigidBodies = model->getNRigidBodies(); |
31 |
> |
SimSnapshotManager::SimSnapshotManager(SimInfo* info) : info_(info){ |
32 |
> |
int nAtoms = info_->getNAtoms(); |
33 |
> |
int nRigidBodies = info_->getNRigidBodies(); |
34 |
|
|
35 |
|
//allocate memory for snapshots |
36 |
|
previousSnapshot_ = new Snapshot(nAtoms, nRigidBodies); |
40 |
|
bool SimSnapshotManager::advance() { |
41 |
|
|
42 |
|
*previousSnapshot_ = *currentSnapshot_; |
43 |
+ |
currentSnapshot_->setID(currentSnapshot_->getID() + 1); |
44 |
+ |
return true; |
45 |
|
} |
46 |
|
|
47 |
|
Snapshot* SimSnapshotManager::getSnapshot(int id) { |