25 |
|
|
26 |
|
namespace oopse { |
27 |
|
|
28 |
< |
SimSnapshotManager::SimSnapshotManager(SimModel* model) : model_(model){ |
29 |
< |
int nAtoms = model->getNAtoms(); |
30 |
< |
int nRigidBodies = model->getNRigidBodies(); |
28 |
> |
SimSnapshotManager::SimSnapshotManager(SimInfo* info) : info_(info){ |
29 |
> |
int nAtoms = info_->getNAtoms(); |
30 |
> |
int nRigidBodies = info_->getNRigidBodies(); |
31 |
|
|
32 |
|
//allocate memory for snapshots |
33 |
|
previousSnapshot_ = new Snapshot(nAtoms, nRigidBodies); |
37 |
|
bool SimSnapshotManager::advance() { |
38 |
|
|
39 |
|
*previousSnapshot_ = *currentSnapshot_; |
40 |
+ |
currentSnapshot_->setID(currentSnapshot_->getID() + 1); |
41 |
|
} |
42 |
|
|
43 |
|
Snapshot* SimSnapshotManager::getSnapshot(int id) { |