ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/brains/SimSnapshotManager.cpp
(Generate patch)

Comparing:
trunk/OOPSE-2.0/src/brains/SimSnapshotManager.cpp (file contents), Revision 1642 by tim, Mon Oct 25 04:08:14 2004 UTC vs.
branches/new_design/OOPSE-2.0/src/brains/SimSnapshotManager.cpp (file contents), Revision 1820 by tim, Thu Dec 2 00:09:35 2004 UTC

# Line 23 | Line 23 | namespace oopse {
23   *
24   */
25  
26 + #include "brains/SimInfo.hpp"
27 + #include "brains/SimSnapshotManager.hpp"
28 +
29   namespace oopse {
30  
31 < SimSnapshotManager::SimSnapshotManager(){
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();
37 <    currentSnapshot_ = new Snapshot();
36 >    previousSnapshot_ = new Snapshot(nAtoms, nRigidBodies);
37 >    currentSnapshot_ = new Snapshot(nAtoms, nRigidBodies);
38   }
39  
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) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines