--- trunk/OOPSE-2.0/src/brains/Snapshot.hpp 2004/10/26 17:28:53 1645 +++ trunk/OOPSE-2.0/src/brains/Snapshot.hpp 2004/10/26 22:19:22 1648 @@ -36,67 +36,15 @@ #include -#include "math/Vector3.hpp" -#include "math/SquareMatrix3.hpp" +#include "brains/DataStorage.hpp" using namespace std; namespace oopse{ - - //forward declaration - class Snapshot; - class SnapshotManager; class StuntDouble; /** - * @class DataStorage - * @warning do not try to insert element into (or ease element from) private member data - * of DataStorage directly. - */ - class DataStorage { - public: - - enum{ - slPosition = 1, - slVelocity = 2, - slAmat = 4, - slAngularMomentum = 8, - slUnitVector = 16, - slZAngle = 32, - slForce = 64, - slTorque = 128 - }; - - DataStorage(int size); - - /** return the size of this DataStorage */ - int size(); - void resize(int size); - void reserve(int size); - - void move(int source, int num, int target); - int getStorageLayout(); - void setStorageLayout(int layout); - - double *getArrayPointer(int ); - - friend class StuntDouble; - - private: - int size_; - int storageLayout_; - vector position; /** position array */ - vector velocity; /** velocity array */ - vector aMat; /** rotation matrix array */ - vector angularMomentum;/** velocity array */ - vector unitVector; /** the lab frame unit vector array*/ - vector zAngle; /** z -angle array */ - vector force; /** force array */ - vector torque; /** torque array */ - }; - - /** * @class Snapshot Snapshot.hpp "brains/Snapshot.hpp" * @brief Snapshot class is a repository class for storing dynamic data during * Simulation @@ -132,17 +80,17 @@ namespace oopse{ //} int getSize() { - return atomData.size() + rigidbodyData.size(); + return atomData.getSize() + rigidbodyData.getSize(); } /** Returns the number of atoms */ int getNumberOfAtoms() { - return atomData.size(); + return atomData.getSize(); } /** Returns the number of rigid bodies */ int getNumberOfRigidBodies() { - return rigidbodyData.size(); + return rigidbodyData.getSize(); } /** Returns the H-Matrix */