32 |
|
*/ |
33 |
|
#ifndef BRAINS_SNAPSHOT_HPP |
34 |
|
#define BRAINS_SNAPSHOT_HPP |
35 |
+ |
|
36 |
+ |
#include <vector> |
37 |
+ |
|
38 |
+ |
#include "math/Vector3.hpp" |
39 |
+ |
#include "math/SquareMatrix3.hpp" |
40 |
+ |
|
41 |
+ |
using namespace std; |
42 |
+ |
|
43 |
|
namespace oopse{ |
44 |
|
|
45 |
|
/** |
50 |
|
*/ |
51 |
|
class Snapshot { |
52 |
|
public: |
53 |
+ |
|
54 |
+ |
Snapshot(int i) { |
55 |
+ |
|
56 |
+ |
} |
57 |
+ |
|
58 |
+ |
Snapshot(const Snapshot& s); |
59 |
+ |
|
60 |
+ |
Snapshot& operator =(const Snapshot& s); |
61 |
|
|
62 |
< |
PropertyMap properties_; |
62 |
> |
/** Returns the id of this Snapshot */ |
63 |
> |
int getID() { |
64 |
> |
return id_; |
65 |
> |
} |
66 |
> |
|
67 |
> |
/** Sets the id of this Snapshot */ |
68 |
> |
void setID(int id) { |
69 |
> |
id_ = id; |
70 |
> |
} |
71 |
> |
|
72 |
> |
/** */ |
73 |
> |
Snapshot* clone() { |
74 |
> |
return new Snapshot(*this); |
75 |
> |
} |
76 |
> |
|
77 |
> |
|
78 |
> |
//template<typename T> |
79 |
> |
//static typename T::ElemPointerType getArrayPointer(vector<T>& v) { |
80 |
> |
// return v[0]->getArrayPointer(); |
81 |
> |
//} |
82 |
> |
|
83 |
> |
static double* getArrayPointer(vector<Vector3d>& v) { |
84 |
> |
return v[0].getArrayPointer(); |
85 |
> |
} |
86 |
|
|
87 |
< |
private: |
87 |
> |
static double* getArrayPointer(vector<RotMat3x3d>& v) { |
88 |
> |
return v[0].getArrayPointer(); |
89 |
> |
} |
90 |
|
|
91 |
+ |
static double* getArrayPointer(vector<double>& v) { |
92 |
+ |
assert(v.size() > 0); |
93 |
+ |
return &(v[0]); |
94 |
+ |
} |
95 |
+ |
|
96 |
+ |
vector<Vector3d> pos; |
97 |
+ |
vector<Vector3d> vel; |
98 |
+ |
vector<Vector3d> frc; |
99 |
+ |
vector<Vector3d> trq; |
100 |
+ |
vector<RotMat3x3d> Amat; |
101 |
+ |
vector<Vector3d> mu; |
102 |
+ |
vector<Vector3d> ul; |
103 |
+ |
vector<double> zAngle; |
104 |
+ |
|
105 |
+ |
private: |
106 |
+ |
|
107 |
+ |
int id_; /**< identification number of the snapshot */ |
108 |
|
}; |
109 |
|
|
110 |
|
} |