--- trunk/OOPSE-3.0/src/brains/Snapshot.hpp 2004/10/20 05:52:25 1615 +++ trunk/OOPSE-3.0/src/brains/Snapshot.hpp 2004/10/21 21:31:39 1630 @@ -32,6 +32,14 @@ namespace oopse{ */ #ifndef BRAINS_SNAPSHOT_HPP #define BRAINS_SNAPSHOT_HPP + +#include + +#include "math/Vector3.hpp" +#include "math/SquareMatrix3.hpp" + +using namespace std; + namespace oopse{ /** @@ -42,11 +50,61 @@ namespace oopse{ */ class Snapshot { public: + + Snapshot(int i) { + + } + + Snapshot(const Snapshot& s); + + Snapshot& operator =(const Snapshot& s); - PropertyMap properties_; + /** Returns the id of this Snapshot */ + int getID() { + return id_; + } + + /** Sets the id of this Snapshot */ + void setID(int id) { + id_ = id; + } + + /** */ + Snapshot* clone() { + return new Snapshot(*this); + } + + + //template + //static typename T::ElemPointerType getArrayPointer(vector& v) { + // return v[0]->getArrayPointer(); + //} + + static double* getArrayPointer(vector& v) { + return v[0].getArrayPointer(); + } - private: + static double* getArrayPointer(vector& v) { + return v[0].getArrayPointer(); + } + static double* getArrayPointer(vector& v) { + assert(v.size() > 0); + return &(v[0]); + } + + vector pos; + vector vel; + vector frc; + vector trq; + vector Amat; + vector mu; + vector ul; + vector zAngle; + + private: + + int id_; /**< identification number of the snapshot */ }; }