1 |
< |
/* |
1 |
> |
/* |
2 |
|
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
3 |
|
* |
4 |
|
* The University of Notre Dame grants you ("Licensee") a |
46 |
|
* @version 1.0 |
47 |
|
*/ |
48 |
|
|
49 |
< |
#ifndef PRIMITIVES_STUNTDOUBLE_HPP |
50 |
< |
#define PRIMITIVES_STUNTDOUBLE_HPP |
49 |
> |
#ifndef PRIMITIVES_STUNTDOUBLE_HPP |
50 |
> |
#define PRIMITIVES_STUNTDOUBLE_HPP |
51 |
|
|
52 |
|
#include <vector> |
53 |
|
|
65 |
|
/** |
66 |
|
* @class StuntDouble StuntDouble.hpp "Primitives/StuntDouble.hpp" |
67 |
|
* @brief |
68 |
+ |
* "Don't move, or you're dead! Stand up! Captain, we've got them!" |
69 |
+ |
* |
70 |
+ |
* "Spectacular stunt, my friends, but all for naught. Turn around |
71 |
+ |
* please. Ha. What a pity. What a pity. So, Princess, you thought |
72 |
+ |
* you could outwit the imperious forces of...." |
73 |
+ |
* |
74 |
+ |
* "You idiots! These are not them. You've captured their stunt |
75 |
+ |
* doubles! Search the area. Find them! Find them!" |
76 |
+ |
* |
77 |
|
* StuntDouble is a very strange idea. A StuntDouble stands in for |
78 |
|
* some object that can be manipulated by the Integrators or |
79 |
|
* Minimizers. Some of the manipulable objects are Atoms, some are |
80 |
|
* DirectionalAtoms, and some are RigidBodies. StuntDouble |
81 |
|
* provides an interface for the Integrators and Minimizers to use, |
82 |
|
* and does some preliminary sanity checking so that the program |
83 |
< |
* doesn't try to do something stupid like torque an Atom |
83 |
> |
* doesn't try to do something stupid like torque an Atom (The |
84 |
> |
* quotes above are from Spaceballs...) |
85 |
> |
* |
86 |
|
* @note the dynamic data of stuntdouble will be stored outside of the class |
87 |
|
*/ |
88 |
< |
class StuntDouble{ |
89 |
< |
public: |
88 |
> |
class StuntDouble{ |
89 |
> |
public: |
90 |
|
|
91 |
< |
enum ObjectType{ |
92 |
< |
otAtom, |
93 |
< |
otDAtom, |
94 |
< |
otRigidBody |
95 |
< |
}; |
91 |
> |
enum ObjectType{ |
92 |
> |
otAtom, |
93 |
> |
otDAtom, |
94 |
> |
otRigidBody |
95 |
> |
}; |
96 |
|
|
97 |
< |
virtual ~StuntDouble(); |
97 |
> |
virtual ~StuntDouble(); |
98 |
|
|
99 |
< |
/** |
100 |
< |
* Returns the global index of this stuntdouble. |
101 |
< |
* @return the global index of this stuntdouble |
102 |
< |
*/ |
103 |
< |
int getGlobalIndex() { |
104 |
< |
return globalIndex_; |
105 |
< |
} |
99 |
> |
/** |
100 |
> |
* Returns the global index of this stuntRealType. |
101 |
> |
* @return the global index of this stuntdouble |
102 |
> |
*/ |
103 |
> |
int getGlobalIndex() { |
104 |
> |
return globalIndex_; |
105 |
> |
} |
106 |
|
|
107 |
< |
/** |
108 |
< |
* Sets the global index of this stuntdouble. |
109 |
< |
* @param new global index to be set |
110 |
< |
*/ |
111 |
< |
void setGlobalIndex(int index) { |
112 |
< |
globalIndex_ = index; |
113 |
< |
} |
107 |
> |
/** |
108 |
> |
* Sets the global index of this stuntRealType. |
109 |
> |
* @param new global index to be set |
110 |
> |
*/ |
111 |
> |
void setGlobalIndex(int index) { |
112 |
> |
globalIndex_ = index; |
113 |
> |
} |
114 |
|
|
115 |
< |
/** |
116 |
< |
* Returns the local index of this stuntdouble |
117 |
< |
* @return the local index of this stuntdouble |
118 |
< |
*/ |
119 |
< |
int getLocalIndex() { |
120 |
< |
return localIndex_; |
121 |
< |
} |
115 |
> |
/** |
116 |
> |
* Returns the local index of this stuntdouble |
117 |
> |
* @return the local index of this stuntdouble |
118 |
> |
*/ |
119 |
> |
int getLocalIndex() { |
120 |
> |
return localIndex_; |
121 |
> |
} |
122 |
|
|
123 |
< |
/** |
124 |
< |
* Sets the local index of this stuntdouble |
125 |
< |
* @param index new index to be set |
126 |
< |
*/ |
127 |
< |
void setLocalIndex(int index) { |
128 |
< |
localIndex_ = index; |
129 |
< |
} |
123 |
> |
/** |
124 |
> |
* Sets the local index of this stuntdouble |
125 |
> |
* @param index new index to be set |
126 |
> |
*/ |
127 |
> |
void setLocalIndex(int index) { |
128 |
> |
localIndex_ = index; |
129 |
> |
} |
130 |
|
|
131 |
< |
/** |
132 |
< |
* Sets the Snapshot Manager of this stuntdouble |
133 |
< |
*/ |
134 |
< |
void setSnapshotManager(SnapshotManager* sman) { |
135 |
< |
snapshotMan_ = sman; |
136 |
< |
} |
131 |
> |
int getGlobalIntegrableObjectIndex(){ |
132 |
> |
return globalIntegrableObjectIndex_; |
133 |
> |
} |
134 |
> |
void setGlobalIntegrableObjectIndex(int index) { |
135 |
> |
globalIntegrableObjectIndex_ = index; |
136 |
> |
} |
137 |
|
|
138 |
< |
/** |
139 |
< |
* Tests if this stuntdouble is an atom |
140 |
< |
* @return true is this stuntdouble is an atom(or a directional atom), return false otherwise |
141 |
< |
*/ |
142 |
< |
bool isAtom(){ |
143 |
< |
return objType_ == otAtom || objType_ == otDAtom; |
133 |
< |
} |
138 |
> |
/** |
139 |
> |
* Sets the Snapshot Manager of this stuntdouble |
140 |
> |
*/ |
141 |
> |
void setSnapshotManager(SnapshotManager* sman) { |
142 |
> |
snapshotMan_ = sman; |
143 |
> |
} |
144 |
|
|
145 |
< |
/** |
146 |
< |
* Tests if this stuntdouble is an directional atom |
147 |
< |
* @return true if this stuntdouble is an directional atom, return false otherwise |
148 |
< |
*/ |
149 |
< |
bool isDirectionalAtom(){ |
150 |
< |
return objType_ == otDAtom; |
151 |
< |
} |
145 |
> |
/** |
146 |
> |
* Tests if this stuntdouble is an atom |
147 |
> |
* @return true is this stuntdouble is an atom(or a directional atom), return false otherwise |
148 |
> |
*/ |
149 |
> |
bool isAtom(){ |
150 |
> |
return objType_ == otAtom || objType_ == otDAtom; |
151 |
> |
} |
152 |
|
|
153 |
< |
/** |
154 |
< |
* Tests if this stuntdouble is a rigid body. |
155 |
< |
* @return true if this stuntdouble is a rigid body, otherwise return false |
156 |
< |
*/ |
157 |
< |
bool isRigidBody(){ |
158 |
< |
return objType_ == otRigidBody; |
159 |
< |
} |
153 |
> |
/** |
154 |
> |
* Tests if this stuntdouble is an directional atom |
155 |
> |
* @return true if this stuntdouble is an directional atom, return false otherwise |
156 |
> |
*/ |
157 |
> |
bool isDirectionalAtom(){ |
158 |
> |
return objType_ == otDAtom; |
159 |
> |
} |
160 |
|
|
161 |
< |
/** |
162 |
< |
* Tests if this stuntdouble is a directional one. |
163 |
< |
* @return true is this stuntdouble is a directional atom or a rigid body, return false otherwise |
164 |
< |
*/ |
165 |
< |
bool isDirectional(){ |
166 |
< |
return isDirectionalAtom() || isRigidBody(); |
167 |
< |
} |
161 |
> |
/** |
162 |
> |
* Tests if this stuntdouble is a rigid body. |
163 |
> |
* @return true if this stuntdouble is a rigid body, otherwise return false |
164 |
> |
*/ |
165 |
> |
bool isRigidBody(){ |
166 |
> |
return objType_ == otRigidBody; |
167 |
> |
} |
168 |
|
|
169 |
< |
/** |
170 |
< |
* Returns the previous position of this stuntdouble |
171 |
< |
* @return the position of this stuntdouble |
172 |
< |
*/ |
173 |
< |
Vector3d getPrevPos() { |
174 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_]; |
175 |
< |
} |
166 |
< |
|
167 |
< |
/** |
168 |
< |
* Returns the current position of this stuntdouble |
169 |
< |
* @return the position of this stuntdouble |
170 |
< |
*/ |
171 |
< |
Vector3d getPos() { |
172 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_]; |
173 |
< |
} |
169 |
> |
/** |
170 |
> |
* Tests if this stuntdouble is a directional one. |
171 |
> |
* @return true is this stuntdouble is a directional atom or a rigid body, return false otherwise |
172 |
> |
*/ |
173 |
> |
bool isDirectional(){ |
174 |
> |
return isDirectionalAtom() || isRigidBody(); |
175 |
> |
} |
176 |
|
|
177 |
< |
/** |
178 |
< |
* Returns the position of this stuntdouble in specified snapshot |
179 |
< |
* @return the position of this stuntdouble |
180 |
< |
* @param snapshotNo |
181 |
< |
*/ |
182 |
< |
Vector3d getPos(int snapshotNo) { |
183 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_]; |
184 |
< |
} |
177 |
> |
/** |
178 |
> |
* Freezes out all velocity, angular velocity, forces and torques |
179 |
> |
* on this StuntDouble. Also computes the number of frozen degrees |
180 |
> |
* of freedom. |
181 |
> |
* @return the total number of frozen degrees of freedom |
182 |
> |
*/ |
183 |
> |
int freeze() { |
184 |
> |
|
185 |
> |
int fdf = 3; |
186 |
|
|
187 |
< |
/** |
188 |
< |
* Sets the previous position of this stuntdouble |
189 |
< |
* @param pos new position |
190 |
< |
* @see #getPos |
191 |
< |
*/ |
192 |
< |
void setPrevPos(const Vector3d& pos) { |
193 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_] = pos; |
194 |
< |
} |
195 |
< |
|
196 |
< |
/** |
197 |
< |
* Sets the current position of this stuntdouble |
198 |
< |
* @param pos new position |
196 |
< |
*/ |
197 |
< |
void setPos(const Vector3d& pos) { |
198 |
< |
DataStorage& data = snapshotMan_->getCurrentSnapshot()->*storage_; |
199 |
< |
data.position[localIndex_] = pos; |
200 |
< |
//((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_] = pos; |
201 |
< |
} |
202 |
< |
|
203 |
< |
/** |
204 |
< |
* Sets the position of this stuntdouble in specified snapshot |
205 |
< |
* @param pos position to be set |
206 |
< |
* @param snapshotNo |
207 |
< |
* @see #getPos |
208 |
< |
*/ |
209 |
< |
void setPos(const Vector3d& pos, int snapshotNo) { |
187 |
> |
setVel(V3Zero); |
188 |
> |
setFrc(V3Zero); |
189 |
> |
if (isDirectional()){ |
190 |
> |
setJ(V3Zero); |
191 |
> |
setTrq(V3Zero); |
192 |
> |
if (isLinear()) |
193 |
> |
fdf +=2; |
194 |
> |
else |
195 |
> |
fdf +=3; |
196 |
> |
} |
197 |
> |
return fdf; |
198 |
> |
} |
199 |
|
|
200 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_] = pos; |
200 |
> |
/** |
201 |
> |
* Returns the previous position of this stuntdouble |
202 |
> |
* @return the position of this stuntdouble |
203 |
> |
*/ |
204 |
> |
Vector3d getPrevPos() { |
205 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_]; |
206 |
> |
} |
207 |
> |
|
208 |
> |
/** |
209 |
> |
* Returns the current position of this stuntdouble |
210 |
> |
* @return the position of this stuntdouble |
211 |
> |
*/ |
212 |
> |
Vector3d getPos() { |
213 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_]; |
214 |
> |
} |
215 |
|
|
216 |
< |
} |
216 |
> |
/** |
217 |
> |
* Returns the position of this stuntdouble in specified snapshot |
218 |
> |
* @return the position of this stuntdouble |
219 |
> |
* @param snapshotNo |
220 |
> |
*/ |
221 |
> |
Vector3d getPos(int snapshotNo) { |
222 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_]; |
223 |
> |
} |
224 |
> |
|
225 |
> |
/** |
226 |
> |
* Sets the previous position of this stuntdouble |
227 |
> |
* @param pos new position |
228 |
> |
* @see #getPos |
229 |
> |
*/ |
230 |
> |
void setPrevPos(const Vector3d& pos) { |
231 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).position[localIndex_] = pos; |
232 |
> |
} |
233 |
|
|
234 |
< |
/** |
235 |
< |
* Returns the previous velocity of this stuntdouble |
236 |
< |
* @return the velocity of this stuntdouble |
237 |
< |
*/ |
238 |
< |
Vector3d getPrevVel() { |
239 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_]; |
240 |
< |
} |
241 |
< |
|
242 |
< |
/** |
224 |
< |
* Returns the current velocity of this stuntdouble |
225 |
< |
* @return the velocity of this stuntdouble |
226 |
< |
*/ |
227 |
< |
Vector3d getVel() { |
228 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_]; |
229 |
< |
} |
234 |
> |
/** |
235 |
> |
* Sets the current position of this stuntdouble |
236 |
> |
* @param pos new position |
237 |
> |
*/ |
238 |
> |
void setPos(const Vector3d& pos) { |
239 |
> |
DataStorage& data = snapshotMan_->getCurrentSnapshot()->*storage_; |
240 |
> |
data.position[localIndex_] = pos; |
241 |
> |
//((snapshotMan_->getCurrentSnapshot())->*storage_).position[localIndex_] = pos; |
242 |
> |
} |
243 |
|
|
244 |
< |
/** |
245 |
< |
* Returns the velocity of this stuntdouble in specified snapshot |
246 |
< |
* @return the velocity of this stuntdouble |
247 |
< |
* @param snapshotNo |
248 |
< |
*/ |
249 |
< |
Vector3d getVel(int snapshotNo) { |
250 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_]; |
238 |
< |
} |
244 |
> |
/** |
245 |
> |
* Sets the position of this stuntdouble in specified snapshot |
246 |
> |
* @param pos position to be set |
247 |
> |
* @param snapshotNo |
248 |
> |
* @see #getPos |
249 |
> |
*/ |
250 |
> |
void setPos(const Vector3d& pos, int snapshotNo) { |
251 |
|
|
252 |
< |
/** |
253 |
< |
* Sets the previous velocity of this stuntdouble |
254 |
< |
* @param vel new velocity |
243 |
< |
* @see #getVel |
244 |
< |
*/ |
245 |
< |
void setPrevVel(const Vector3d& vel) { |
246 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_] = vel; |
247 |
< |
} |
252 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).position[localIndex_] = pos; |
253 |
> |
|
254 |
> |
} |
255 |
|
|
256 |
< |
/** |
257 |
< |
* Sets the current velocity of this stuntdouble |
258 |
< |
* @param vel new velocity |
259 |
< |
*/ |
260 |
< |
void setVel(const Vector3d& vel) { |
261 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_] = vel; |
262 |
< |
} |
256 |
> |
/** |
257 |
> |
* Returns the previous velocity of this stuntdouble |
258 |
> |
* @return the velocity of this stuntdouble |
259 |
> |
*/ |
260 |
> |
Vector3d getPrevVel() { |
261 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_]; |
262 |
> |
} |
263 |
> |
|
264 |
> |
/** |
265 |
> |
* Returns the current velocity of this stuntdouble |
266 |
> |
* @return the velocity of this stuntdouble |
267 |
> |
*/ |
268 |
> |
Vector3d getVel() { |
269 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_]; |
270 |
> |
} |
271 |
|
|
272 |
< |
/** |
273 |
< |
* Sets the velocity of this stuntdouble in specified snapshot |
274 |
< |
* @param vel velocity to be set |
275 |
< |
* @param snapshotNo |
276 |
< |
* @see #getVel |
277 |
< |
*/ |
278 |
< |
void setVel(const Vector3d& vel, int snapshotNo) { |
279 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_] = vel; |
265 |
< |
} |
272 |
> |
/** |
273 |
> |
* Returns the velocity of this stuntdouble in specified snapshot |
274 |
> |
* @return the velocity of this stuntdouble |
275 |
> |
* @param snapshotNo |
276 |
> |
*/ |
277 |
> |
Vector3d getVel(int snapshotNo) { |
278 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_]; |
279 |
> |
} |
280 |
|
|
281 |
< |
/** |
282 |
< |
* Returns the previous rotation matrix of this stuntdouble |
283 |
< |
* @return the rotation matrix of this stuntdouble |
284 |
< |
*/ |
285 |
< |
RotMat3x3d getPrevA() { |
286 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_]; |
287 |
< |
} |
281 |
> |
/** |
282 |
> |
* Sets the previous velocity of this stuntdouble |
283 |
> |
* @param vel new velocity |
284 |
> |
* @see #getVel |
285 |
> |
*/ |
286 |
> |
void setPrevVel(const Vector3d& vel) { |
287 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).velocity[localIndex_] = vel; |
288 |
> |
} |
289 |
|
|
290 |
< |
/** |
291 |
< |
* Returns the current rotation matrix of this stuntdouble |
292 |
< |
* @return the rotation matrix of this stuntdouble |
293 |
< |
*/ |
294 |
< |
RotMat3x3d getA() { |
295 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_]; |
296 |
< |
} |
290 |
> |
/** |
291 |
> |
* Sets the current velocity of this stuntdouble |
292 |
> |
* @param vel new velocity |
293 |
> |
*/ |
294 |
> |
void setVel(const Vector3d& vel) { |
295 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).velocity[localIndex_] = vel; |
296 |
> |
} |
297 |
|
|
298 |
< |
/** |
299 |
< |
* Returns the rotation matrix of this stuntdouble in specified snapshot |
300 |
< |
* |
301 |
< |
* @return the rotation matrix of this stuntdouble |
302 |
< |
* @param snapshotNo |
303 |
< |
*/ |
304 |
< |
RotMat3x3d getA(int snapshotNo) { |
305 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_]; |
306 |
< |
} |
298 |
> |
/** |
299 |
> |
* Sets the velocity of this stuntdouble in specified snapshot |
300 |
> |
* @param vel velocity to be set |
301 |
> |
* @param snapshotNo |
302 |
> |
* @see #getVel |
303 |
> |
*/ |
304 |
> |
void setVel(const Vector3d& vel, int snapshotNo) { |
305 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).velocity[localIndex_] = vel; |
306 |
> |
} |
307 |
|
|
308 |
< |
/** |
309 |
< |
* Sets the previous rotation matrix of this stuntdouble |
310 |
< |
* @param a new rotation matrix |
311 |
< |
* @see #getA |
312 |
< |
*/ |
313 |
< |
virtual void setPrevA(const RotMat3x3d& a) { |
314 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = a; |
315 |
< |
} |
308 |
> |
/** |
309 |
> |
* Returns the previous rotation matrix of this stuntdouble |
310 |
> |
* @return the rotation matrix of this stuntdouble |
311 |
> |
*/ |
312 |
> |
RotMat3x3d getPrevA() { |
313 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_]; |
314 |
> |
} |
315 |
> |
|
316 |
> |
/** |
317 |
> |
* Returns the current rotation matrix of this stuntdouble |
318 |
> |
* @return the rotation matrix of this stuntdouble |
319 |
> |
*/ |
320 |
> |
RotMat3x3d getA() { |
321 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_]; |
322 |
> |
} |
323 |
> |
|
324 |
> |
/** |
325 |
> |
* Returns the rotation matrix of this stuntdouble in specified snapshot |
326 |
> |
* |
327 |
> |
* @return the rotation matrix of this stuntdouble |
328 |
> |
* @param snapshotNo |
329 |
> |
*/ |
330 |
> |
RotMat3x3d getA(int snapshotNo) { |
331 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_]; |
332 |
> |
} |
333 |
> |
|
334 |
> |
/** |
335 |
> |
* Sets the previous rotation matrix of this stuntdouble |
336 |
> |
* @param a new rotation matrix |
337 |
> |
* @see #getA |
338 |
> |
*/ |
339 |
> |
virtual void setPrevA(const RotMat3x3d& a) { |
340 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = a; |
341 |
> |
} |
342 |
|
|
343 |
< |
/** |
344 |
< |
* Sets the current rotation matrix of this stuntdouble |
345 |
< |
* @param a new rotation matrix |
346 |
< |
*/ |
347 |
< |
virtual void setA(const RotMat3x3d& a) { |
348 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = a; |
349 |
< |
} |
343 |
> |
/** |
344 |
> |
* Sets the current rotation matrix of this stuntdouble |
345 |
> |
* @param a new rotation matrix |
346 |
> |
*/ |
347 |
> |
virtual void setA(const RotMat3x3d& a) { |
348 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = a; |
349 |
> |
} |
350 |
|
|
351 |
< |
/** |
352 |
< |
* Sets the rotation matrix of this stuntdouble in specified snapshot |
353 |
< |
* @param a rotation matrix to be set |
354 |
< |
* @param snapshotNo |
355 |
< |
* @see #getA |
356 |
< |
*/ |
357 |
< |
virtual void setA(const RotMat3x3d& a, int snapshotNo) { |
358 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = a; |
359 |
< |
} |
351 |
> |
/** |
352 |
> |
* Sets the rotation matrix of this stuntdouble in specified snapshot |
353 |
> |
* @param a rotation matrix to be set |
354 |
> |
* @param snapshotNo |
355 |
> |
* @see #getA |
356 |
> |
*/ |
357 |
> |
virtual void setA(const RotMat3x3d& a, int snapshotNo) { |
358 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = a; |
359 |
> |
} |
360 |
|
|
361 |
< |
/** |
362 |
< |
* Returns the previous angular momentum of this stuntdouble (body-fixed). |
363 |
< |
* @return the angular momentum of this stuntdouble |
364 |
< |
*/ |
365 |
< |
Vector3d getPrevJ() { |
366 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_]; |
367 |
< |
} |
361 |
> |
/** |
362 |
> |
* Returns the previous angular momentum of this stuntdouble (body-fixed). |
363 |
> |
* @return the angular momentum of this stuntdouble |
364 |
> |
*/ |
365 |
> |
Vector3d getPrevJ() { |
366 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_]; |
367 |
> |
} |
368 |
|
|
369 |
< |
/** |
370 |
< |
* Returns the current angular momentum of this stuntdouble (body -fixed). |
371 |
< |
* @return the angular momentum of this stuntdouble |
372 |
< |
*/ |
373 |
< |
Vector3d getJ() { |
374 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_]; |
375 |
< |
} |
369 |
> |
/** |
370 |
> |
* Returns the current angular momentum of this stuntdouble (body -fixed). |
371 |
> |
* @return the angular momentum of this stuntdouble |
372 |
> |
*/ |
373 |
> |
Vector3d getJ() { |
374 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_]; |
375 |
> |
} |
376 |
|
|
377 |
< |
/** |
378 |
< |
* Returns the angular momentum of this stuntdouble in specified snapshot (body-fixed). |
379 |
< |
* @return the angular momentum of this stuntdouble |
380 |
< |
* @param snapshotNo |
381 |
< |
*/ |
382 |
< |
Vector3d getJ(int snapshotNo) { |
383 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_]; |
384 |
< |
} |
377 |
> |
/** |
378 |
> |
* Returns the angular momentum of this stuntdouble in specified snapshot (body-fixed). |
379 |
> |
* @return the angular momentum of this stuntdouble |
380 |
> |
* @param snapshotNo |
381 |
> |
*/ |
382 |
> |
Vector3d getJ(int snapshotNo) { |
383 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_]; |
384 |
> |
} |
385 |
|
|
386 |
< |
/** |
387 |
< |
* Sets the previous angular momentum of this stuntdouble (body-fixed). |
388 |
< |
* @param angMom new angular momentum |
389 |
< |
* @see #getJ |
390 |
< |
*/ |
391 |
< |
void setPrevJ(const Vector3d& angMom) { |
392 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
393 |
< |
} |
386 |
> |
/** |
387 |
> |
* Sets the previous angular momentum of this stuntdouble (body-fixed). |
388 |
> |
* @param angMom new angular momentum |
389 |
> |
* @see #getJ |
390 |
> |
*/ |
391 |
> |
void setPrevJ(const Vector3d& angMom) { |
392 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
393 |
> |
} |
394 |
|
|
395 |
< |
/** |
396 |
< |
* Sets the current angular momentum of this stuntdouble (body-fixed). |
397 |
< |
* @param angMom new angular momentum |
398 |
< |
*/ |
399 |
< |
void setJ(const Vector3d& angMom) { |
400 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
401 |
< |
} |
395 |
> |
/** |
396 |
> |
* Sets the current angular momentum of this stuntdouble (body-fixed). |
397 |
> |
* @param angMom new angular momentum |
398 |
> |
*/ |
399 |
> |
void setJ(const Vector3d& angMom) { |
400 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).angularMomentum[localIndex_] = angMom; |
401 |
> |
} |
402 |
|
|
403 |
< |
/** |
404 |
< |
* Sets the angular momentum of this stuntdouble in specified snapshot(body-fixed). |
405 |
< |
* @param angMom angular momentum to be set |
406 |
< |
* @param snapshotNo |
407 |
< |
* @see #getJ |
408 |
< |
*/ |
409 |
< |
void setJ(const Vector3d& angMom, int snapshotNo) { |
410 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_] = angMom; |
411 |
< |
} |
403 |
> |
/** |
404 |
> |
* Sets the angular momentum of this stuntdouble in specified snapshot(body-fixed). |
405 |
> |
* @param angMom angular momentum to be set |
406 |
> |
* @param snapshotNo |
407 |
> |
* @see #getJ |
408 |
> |
*/ |
409 |
> |
void setJ(const Vector3d& angMom, int snapshotNo) { |
410 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).angularMomentum[localIndex_] = angMom; |
411 |
> |
} |
412 |
|
|
413 |
< |
/** |
414 |
< |
* Returns the previous quaternion of this stuntdouble |
415 |
< |
* @return the quaternion of this stuntdouble |
416 |
< |
*/ |
417 |
< |
Quat4d getPrevQ() { |
418 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
419 |
< |
} |
413 |
> |
/** |
414 |
> |
* Returns the previous quaternion of this stuntdouble |
415 |
> |
* @return the quaternion of this stuntdouble |
416 |
> |
*/ |
417 |
> |
Quat4d getPrevQ() { |
418 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
419 |
> |
} |
420 |
|
|
421 |
< |
/** |
422 |
< |
* Returns the current quaternion of this stuntdouble |
423 |
< |
* @return the quaternion of this stuntdouble |
424 |
< |
*/ |
425 |
< |
Quat4d getQ() { |
426 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
427 |
< |
} |
421 |
> |
/** |
422 |
> |
* Returns the current quaternion of this stuntdouble |
423 |
> |
* @return the quaternion of this stuntdouble |
424 |
> |
*/ |
425 |
> |
Quat4d getQ() { |
426 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toQuaternion(); |
427 |
> |
} |
428 |
|
|
429 |
< |
/** |
430 |
< |
* Returns the quaternion of this stuntdouble in specified snapshot |
431 |
< |
* @return the quaternion of this stuntdouble |
432 |
< |
* @param snapshotNo |
433 |
< |
*/ |
434 |
< |
Quat4d getQ(int snapshotNo) { |
435 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toQuaternion(); |
436 |
< |
} |
429 |
> |
/** |
430 |
> |
* Returns the quaternion of this stuntdouble in specified snapshot |
431 |
> |
* @return the quaternion of this stuntdouble |
432 |
> |
* @param snapshotNo |
433 |
> |
*/ |
434 |
> |
Quat4d getQ(int snapshotNo) { |
435 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toQuaternion(); |
436 |
> |
} |
437 |
|
|
438 |
< |
/** |
439 |
< |
* Sets the previous quaternion of this stuntdouble |
440 |
< |
* @param q new quaternion |
441 |
< |
* @note actual storage data is rotation matrix |
442 |
< |
*/ |
443 |
< |
void setPrevQ(const Quat4d& q) { |
444 |
< |
setPrevA(q); |
445 |
< |
} |
438 |
> |
/** |
439 |
> |
* Sets the previous quaternion of this stuntdouble |
440 |
> |
* @param q new quaternion |
441 |
> |
* @note actual storage data is rotation matrix |
442 |
> |
*/ |
443 |
> |
void setPrevQ(const Quat4d& q) { |
444 |
> |
setPrevA(q); |
445 |
> |
} |
446 |
|
|
447 |
< |
/** |
448 |
< |
* Sets the current quaternion of this stuntdouble |
449 |
< |
* @param q new quaternion |
450 |
< |
* @note actual storage data is rotation matrix |
451 |
< |
*/ |
452 |
< |
void setQ(const Quat4d& q) { |
453 |
< |
setA(q); |
454 |
< |
} |
447 |
> |
/** |
448 |
> |
* Sets the current quaternion of this stuntdouble |
449 |
> |
* @param q new quaternion |
450 |
> |
* @note actual storage data is rotation matrix |
451 |
> |
*/ |
452 |
> |
void setQ(const Quat4d& q) { |
453 |
> |
setA(q); |
454 |
> |
} |
455 |
|
|
456 |
< |
/** |
457 |
< |
* Sets the quaternion of this stuntdouble in specified snapshot |
458 |
< |
* |
459 |
< |
* @param q quaternion to be set |
460 |
< |
* @param snapshotNo |
461 |
< |
* @note actual storage data is rotation matrix |
462 |
< |
*/ |
463 |
< |
void setQ(const Quat4d& q, int snapshotNo) { |
464 |
< |
setA(q, snapshotNo); |
465 |
< |
} |
456 |
> |
/** |
457 |
> |
* Sets the quaternion of this stuntdouble in specified snapshot |
458 |
> |
* |
459 |
> |
* @param q quaternion to be set |
460 |
> |
* @param snapshotNo |
461 |
> |
* @note actual storage data is rotation matrix |
462 |
> |
*/ |
463 |
> |
void setQ(const Quat4d& q, int snapshotNo) { |
464 |
> |
setA(q, snapshotNo); |
465 |
> |
} |
466 |
|
|
467 |
< |
/** |
468 |
< |
* Returns the previous euler angles of this stuntdouble |
469 |
< |
* @return the euler angles of this stuntdouble |
470 |
< |
*/ |
471 |
< |
Vector3d getPrevEuler() { |
472 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
473 |
< |
} |
467 |
> |
/** |
468 |
> |
* Returns the previous euler angles of this stuntdouble |
469 |
> |
* @return the euler angles of this stuntdouble |
470 |
> |
*/ |
471 |
> |
Vector3d getPrevEuler() { |
472 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
473 |
> |
} |
474 |
|
|
475 |
< |
/** |
476 |
< |
* Returns the current euler angles of this stuntdouble |
477 |
< |
* @return the euler angles of this stuntdouble |
478 |
< |
*/ |
479 |
< |
Vector3d getEuler() { |
480 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
481 |
< |
} |
475 |
> |
/** |
476 |
> |
* Returns the current euler angles of this stuntdouble |
477 |
> |
* @return the euler angles of this stuntdouble |
478 |
> |
*/ |
479 |
> |
Vector3d getEuler() { |
480 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_].toEulerAngles(); |
481 |
> |
} |
482 |
|
|
483 |
< |
/** |
484 |
< |
* Returns the euler angles of this stuntdouble in specified snapshot. |
485 |
< |
* @return the euler angles of this stuntdouble |
486 |
< |
* @param snapshotNo |
487 |
< |
*/ |
488 |
< |
Vector3d getEuler(int snapshotNo) { |
489 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toEulerAngles(); |
490 |
< |
} |
483 |
> |
/** |
484 |
> |
* Returns the euler angles of this stuntdouble in specified snapshot. |
485 |
> |
* @return the euler angles of this stuntdouble |
486 |
> |
* @param snapshotNo |
487 |
> |
*/ |
488 |
> |
Vector3d getEuler(int snapshotNo) { |
489 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_].toEulerAngles(); |
490 |
> |
} |
491 |
|
|
492 |
< |
/** |
493 |
< |
* Sets the previous euler angles of this stuntdouble. |
494 |
< |
* @param euler new euler angles |
495 |
< |
* @see #getEuler |
496 |
< |
* @note actual storage data is rotation matrix |
497 |
< |
*/ |
498 |
< |
void setPrevEuler(const Vector3d& euler) { |
499 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = euler; |
500 |
< |
} |
492 |
> |
/** |
493 |
> |
* Sets the previous euler angles of this stuntRealType. |
494 |
> |
* @param euler new euler angles |
495 |
> |
* @see #getEuler |
496 |
> |
* @note actual storage data is rotation matrix |
497 |
> |
*/ |
498 |
> |
void setPrevEuler(const Vector3d& euler) { |
499 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).aMat[localIndex_] = euler; |
500 |
> |
} |
501 |
|
|
502 |
< |
/** |
503 |
< |
* Sets the current euler angles of this stuntdouble |
504 |
< |
* @param euler new euler angles |
505 |
< |
*/ |
506 |
< |
void setEuler(const Vector3d& euler) { |
507 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = euler; |
508 |
< |
} |
502 |
> |
/** |
503 |
> |
* Sets the current euler angles of this stuntdouble |
504 |
> |
* @param euler new euler angles |
505 |
> |
*/ |
506 |
> |
void setEuler(const Vector3d& euler) { |
507 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).aMat[localIndex_] = euler; |
508 |
> |
} |
509 |
|
|
510 |
< |
/** |
511 |
< |
* Sets the euler angles of this stuntdouble in specified snapshot |
512 |
< |
* |
513 |
< |
* @param euler euler angles to be set |
514 |
< |
* @param snapshotNo |
515 |
< |
* @note actual storage data is rotation matrix |
516 |
< |
*/ |
517 |
< |
void setEuler(const Vector3d& euler, int snapshotNo) { |
518 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = euler; |
519 |
< |
} |
510 |
> |
/** |
511 |
> |
* Sets the euler angles of this stuntdouble in specified snapshot |
512 |
> |
* |
513 |
> |
* @param euler euler angles to be set |
514 |
> |
* @param snapshotNo |
515 |
> |
* @note actual storage data is rotation matrix |
516 |
> |
*/ |
517 |
> |
void setEuler(const Vector3d& euler, int snapshotNo) { |
518 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).aMat[localIndex_] = euler; |
519 |
> |
} |
520 |
|
|
521 |
< |
/** |
522 |
< |
* Returns the previous unit vectors of this stuntdouble |
523 |
< |
* @return the unit vectors of this stuntdouble |
524 |
< |
*/ |
525 |
< |
RotMat3x3d getPrevElectroFrame() { |
526 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).electroFrame[localIndex_]; |
527 |
< |
} |
521 |
> |
/** |
522 |
> |
* Returns the previous unit vectors of this stuntdouble |
523 |
> |
* @return the unit vectors of this stuntdouble |
524 |
> |
*/ |
525 |
> |
RotMat3x3d getPrevElectroFrame() { |
526 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).electroFrame[localIndex_]; |
527 |
> |
} |
528 |
|
|
529 |
< |
/** |
530 |
< |
* Returns the current unit vectors of this stuntdouble |
531 |
< |
* @return the unit vectors of this stuntdouble |
532 |
< |
*/ |
533 |
< |
RotMat3x3d getElectroFrame() { |
534 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).electroFrame[localIndex_]; |
535 |
< |
} |
529 |
> |
/** |
530 |
> |
* Returns the current unit vectors of this stuntdouble |
531 |
> |
* @return the unit vectors of this stuntdouble |
532 |
> |
*/ |
533 |
> |
RotMat3x3d getElectroFrame() { |
534 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).electroFrame[localIndex_]; |
535 |
> |
} |
536 |
|
|
537 |
< |
/** |
538 |
< |
* Returns the unit vectors of this stuntdouble in specified snapshot |
539 |
< |
* |
540 |
< |
* @return the unit vectors of this stuntdouble |
541 |
< |
* @param snapshotNo |
542 |
< |
*/ |
543 |
< |
RotMat3x3d getElectroFrame(int snapshotNo) { |
544 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electroFrame[localIndex_]; |
545 |
< |
} |
546 |
< |
|
547 |
< |
/** |
548 |
< |
* Returns the previous force of this stuntdouble |
549 |
< |
* @return the force of this stuntdouble |
550 |
< |
*/ |
551 |
< |
Vector3d getPrevFrc() { |
552 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_]; |
553 |
< |
} |
537 |
> |
/** |
538 |
> |
* Returns the unit vectors of this stuntdouble in specified snapshot |
539 |
> |
* |
540 |
> |
* @return the unit vectors of this stuntdouble |
541 |
> |
* @param snapshotNo |
542 |
> |
*/ |
543 |
> |
RotMat3x3d getElectroFrame(int snapshotNo) { |
544 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).electroFrame[localIndex_]; |
545 |
> |
} |
546 |
> |
|
547 |
> |
/** |
548 |
> |
* Returns the previous force of this stuntdouble |
549 |
> |
* @return the force of this stuntdouble |
550 |
> |
*/ |
551 |
> |
Vector3d getPrevFrc() { |
552 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_]; |
553 |
> |
} |
554 |
|
|
555 |
< |
/** |
556 |
< |
* Returns the current force of this stuntdouble |
557 |
< |
* @return the force of this stuntdouble |
558 |
< |
*/ |
559 |
< |
Vector3d getFrc() { |
560 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_]; |
561 |
< |
} |
555 |
> |
/** |
556 |
> |
* Returns the current force of this stuntdouble |
557 |
> |
* @return the force of this stuntdouble |
558 |
> |
*/ |
559 |
> |
Vector3d getFrc() { |
560 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_]; |
561 |
> |
} |
562 |
|
|
563 |
< |
/** |
564 |
< |
* Returns the force of this stuntdouble in specified snapshot |
565 |
< |
* |
566 |
< |
* @return the force of this stuntdouble |
567 |
< |
* @param snapshotNo |
568 |
< |
*/ |
569 |
< |
Vector3d getFrc(int snapshotNo) { |
570 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_]; |
571 |
< |
} |
563 |
> |
/** |
564 |
> |
* Returns the force of this stuntdouble in specified snapshot |
565 |
> |
* |
566 |
> |
* @return the force of this stuntdouble |
567 |
> |
* @param snapshotNo |
568 |
> |
*/ |
569 |
> |
Vector3d getFrc(int snapshotNo) { |
570 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_]; |
571 |
> |
} |
572 |
|
|
573 |
< |
/** |
574 |
< |
* Sets the previous force of this stuntdouble |
575 |
< |
* |
576 |
< |
* @param frc new force |
577 |
< |
* @see #getFrc |
578 |
< |
*/ |
579 |
< |
void setPrevFrc(const Vector3d& frc) { |
580 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] = frc; |
581 |
< |
} |
573 |
> |
/** |
574 |
> |
* Sets the previous force of this stuntdouble |
575 |
> |
* |
576 |
> |
* @param frc new force |
577 |
> |
* @see #getFrc |
578 |
> |
*/ |
579 |
> |
void setPrevFrc(const Vector3d& frc) { |
580 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] = frc; |
581 |
> |
} |
582 |
|
|
583 |
< |
/** |
584 |
< |
* Sets the current force of this stuntdouble |
585 |
< |
* @param frc new force |
586 |
< |
*/ |
587 |
< |
void setFrc(const Vector3d& frc) { |
588 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] = frc; |
589 |
< |
} |
583 |
> |
/** |
584 |
> |
* Sets the current force of this stuntdouble |
585 |
> |
* @param frc new force |
586 |
> |
*/ |
587 |
> |
void setFrc(const Vector3d& frc) { |
588 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] = frc; |
589 |
> |
} |
590 |
|
|
591 |
< |
/** |
592 |
< |
* Sets the force of this stuntdouble in specified snapshot |
593 |
< |
* |
594 |
< |
* @param frc force to be set |
595 |
< |
* @param snapshotNo |
596 |
< |
* @see #getFrc |
597 |
< |
*/ |
598 |
< |
void setFrc(const Vector3d& frc, int snapshotNo) { |
599 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] = frc; |
600 |
< |
} |
591 |
> |
/** |
592 |
> |
* Sets the force of this stuntdouble in specified snapshot |
593 |
> |
* |
594 |
> |
* @param frc force to be set |
595 |
> |
* @param snapshotNo |
596 |
> |
* @see #getFrc |
597 |
> |
*/ |
598 |
> |
void setFrc(const Vector3d& frc, int snapshotNo) { |
599 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] = frc; |
600 |
> |
} |
601 |
|
|
602 |
< |
/** |
603 |
< |
* Adds force into the previous force of this stuntdouble |
604 |
< |
* |
605 |
< |
* @param frc new force |
606 |
< |
* @see #getFrc |
607 |
< |
*/ |
608 |
< |
void addPrevFrc(const Vector3d& frc) { |
609 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] += frc; |
610 |
< |
} |
602 |
> |
/** |
603 |
> |
* Adds force into the previous force of this stuntdouble |
604 |
> |
* |
605 |
> |
* @param frc new force |
606 |
> |
* @see #getFrc |
607 |
> |
*/ |
608 |
> |
void addPrevFrc(const Vector3d& frc) { |
609 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).force[localIndex_] += frc; |
610 |
> |
} |
611 |
|
|
612 |
< |
/** |
613 |
< |
* Adds force into the current force of this stuntdouble |
614 |
< |
* @param frc new force |
615 |
< |
*/ |
616 |
< |
void addFrc(const Vector3d& frc) { |
617 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] += frc; |
618 |
< |
} |
612 |
> |
/** |
613 |
> |
* Adds force into the current force of this stuntdouble |
614 |
> |
* @param frc new force |
615 |
> |
*/ |
616 |
> |
void addFrc(const Vector3d& frc) { |
617 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).force[localIndex_] += frc; |
618 |
> |
} |
619 |
|
|
620 |
< |
/** |
621 |
< |
* Adds force into the force of this stuntdouble in specified snapshot |
622 |
< |
* |
623 |
< |
* @param frc force to be set |
624 |
< |
* @param snapshotNo |
625 |
< |
* @see #getFrc |
626 |
< |
*/ |
627 |
< |
void addFrc(const Vector3d& frc, int snapshotNo) { |
628 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] += frc; |
629 |
< |
} |
620 |
> |
/** |
621 |
> |
* Adds force into the force of this stuntdouble in specified snapshot |
622 |
> |
* |
623 |
> |
* @param frc force to be set |
624 |
> |
* @param snapshotNo |
625 |
> |
* @see #getFrc |
626 |
> |
*/ |
627 |
> |
void addFrc(const Vector3d& frc, int snapshotNo) { |
628 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).force[localIndex_] += frc; |
629 |
> |
} |
630 |
|
|
631 |
< |
/** |
632 |
< |
* Returns the previous torque of this stuntdouble |
633 |
< |
* @return the torque of this stuntdouble |
634 |
< |
*/ |
635 |
< |
Vector3d getPrevTrq() { |
636 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_]; |
637 |
< |
} |
631 |
> |
/** |
632 |
> |
* Returns the previous torque of this stuntdouble |
633 |
> |
* @return the torque of this stuntdouble |
634 |
> |
*/ |
635 |
> |
Vector3d getPrevTrq() { |
636 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_]; |
637 |
> |
} |
638 |
|
|
639 |
< |
/** |
640 |
< |
* Returns the current torque of this stuntdouble |
641 |
< |
* @return the torque of this stuntdouble |
642 |
< |
*/ |
643 |
< |
Vector3d getTrq() { |
644 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_]; |
645 |
< |
} |
639 |
> |
/** |
640 |
> |
* Returns the current torque of this stuntdouble |
641 |
> |
* @return the torque of this stuntdouble |
642 |
> |
*/ |
643 |
> |
Vector3d getTrq() { |
644 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_]; |
645 |
> |
} |
646 |
|
|
647 |
< |
/** |
648 |
< |
* Returns the torque of this stuntdouble in specified snapshot |
649 |
< |
* |
650 |
< |
* @return the torque of this stuntdouble |
651 |
< |
* @param snapshotNo |
652 |
< |
*/ |
653 |
< |
Vector3d getTrq(int snapshotNo) { |
654 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_]; |
655 |
< |
} |
647 |
> |
/** |
648 |
> |
* Returns the torque of this stuntdouble in specified snapshot |
649 |
> |
* |
650 |
> |
* @return the torque of this stuntdouble |
651 |
> |
* @param snapshotNo |
652 |
> |
*/ |
653 |
> |
Vector3d getTrq(int snapshotNo) { |
654 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_]; |
655 |
> |
} |
656 |
|
|
657 |
< |
/** |
658 |
< |
* Sets the previous torque of this stuntdouble |
659 |
< |
* |
660 |
< |
* @param trq new torque |
661 |
< |
* @see #getTrq |
662 |
< |
*/ |
663 |
< |
void setPrevTrq(const Vector3d& trq) { |
664 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] = trq; |
665 |
< |
} |
657 |
> |
/** |
658 |
> |
* Sets the previous torque of this stuntdouble |
659 |
> |
* |
660 |
> |
* @param trq new torque |
661 |
> |
* @see #getTrq |
662 |
> |
*/ |
663 |
> |
void setPrevTrq(const Vector3d& trq) { |
664 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] = trq; |
665 |
> |
} |
666 |
|
|
667 |
< |
/** |
668 |
< |
* Sets the current torque of this stuntdouble |
669 |
< |
* @param trq new torque |
670 |
< |
*/ |
671 |
< |
void setTrq(const Vector3d& trq) { |
672 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] = trq; |
673 |
< |
} |
667 |
> |
/** |
668 |
> |
* Sets the current torque of this stuntdouble |
669 |
> |
* @param trq new torque |
670 |
> |
*/ |
671 |
> |
void setTrq(const Vector3d& trq) { |
672 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] = trq; |
673 |
> |
} |
674 |
|
|
675 |
< |
/** |
676 |
< |
* Sets the torque of this stuntdouble in specified snapshot |
677 |
< |
* |
678 |
< |
* @param trq torque to be set |
679 |
< |
* @param snapshotNo |
680 |
< |
* @see #getTrq |
681 |
< |
*/ |
682 |
< |
void setTrq(const Vector3d& trq, int snapshotNo) { |
683 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] = trq; |
684 |
< |
} |
675 |
> |
/** |
676 |
> |
* Sets the torque of this stuntdouble in specified snapshot |
677 |
> |
* |
678 |
> |
* @param trq torque to be set |
679 |
> |
* @param snapshotNo |
680 |
> |
* @see #getTrq |
681 |
> |
*/ |
682 |
> |
void setTrq(const Vector3d& trq, int snapshotNo) { |
683 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] = trq; |
684 |
> |
} |
685 |
|
|
686 |
< |
/** |
687 |
< |
* Adds torque into the previous torque of this stuntdouble |
688 |
< |
* |
689 |
< |
* @param trq new torque |
690 |
< |
* @see #getTrq |
691 |
< |
*/ |
692 |
< |
void addPrevTrq(const Vector3d& trq) { |
693 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] += trq; |
694 |
< |
} |
686 |
> |
/** |
687 |
> |
* Adds torque into the previous torque of this stuntdouble |
688 |
> |
* |
689 |
> |
* @param trq new torque |
690 |
> |
* @see #getTrq |
691 |
> |
*/ |
692 |
> |
void addPrevTrq(const Vector3d& trq) { |
693 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).torque[localIndex_] += trq; |
694 |
> |
} |
695 |
|
|
696 |
< |
/** |
697 |
< |
* Adds torque into the current torque of this stuntdouble |
698 |
< |
* @param trq new torque |
699 |
< |
*/ |
700 |
< |
void addTrq(const Vector3d& trq) { |
701 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] += trq; |
702 |
< |
} |
696 |
> |
/** |
697 |
> |
* Adds torque into the current torque of this stuntdouble |
698 |
> |
* @param trq new torque |
699 |
> |
*/ |
700 |
> |
void addTrq(const Vector3d& trq) { |
701 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).torque[localIndex_] += trq; |
702 |
> |
} |
703 |
|
|
704 |
< |
/** |
705 |
< |
* Adds torque into the torque of this stuntdouble in specified snapshot |
706 |
< |
* |
707 |
< |
* @param trq torque to be add |
708 |
< |
* @param snapshotNo |
709 |
< |
* @see #getTrq |
710 |
< |
*/ |
711 |
< |
void addTrq(const Vector3d& trq, int snapshotNo) { |
712 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] += trq; |
713 |
< |
} |
704 |
> |
/** |
705 |
> |
* Adds torque into the torque of this stuntdouble in specified snapshot |
706 |
> |
* |
707 |
> |
* @param trq torque to be add |
708 |
> |
* @param snapshotNo |
709 |
> |
* @see #getTrq |
710 |
> |
*/ |
711 |
> |
void addTrq(const Vector3d& trq, int snapshotNo) { |
712 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).torque[localIndex_] += trq; |
713 |
> |
} |
714 |
|
|
715 |
|
|
716 |
< |
/** |
717 |
< |
* Returns the previous z-angle of this stuntdouble |
718 |
< |
* @return the z-angle of this stuntdouble |
719 |
< |
*/ |
720 |
< |
double getPrevZangle() { |
721 |
< |
return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_]; |
722 |
< |
} |
716 |
> |
/** |
717 |
> |
* Returns the previous z-angle of this stuntdouble |
718 |
> |
* @return the z-angle of this stuntdouble |
719 |
> |
*/ |
720 |
> |
RealType getPrevZangle() { |
721 |
> |
return ((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_]; |
722 |
> |
} |
723 |
|
|
724 |
< |
/** |
725 |
< |
* Returns the current z-angle of this stuntdouble |
726 |
< |
* @return the z-angle of this stuntdouble |
727 |
< |
*/ |
728 |
< |
double getZangle() { |
729 |
< |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_]; |
730 |
< |
} |
724 |
> |
/** |
725 |
> |
* Returns the current z-angle of this stuntdouble |
726 |
> |
* @return the z-angle of this stuntdouble |
727 |
> |
*/ |
728 |
> |
RealType getZangle() { |
729 |
> |
return ((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_]; |
730 |
> |
} |
731 |
|
|
732 |
< |
/** |
733 |
< |
* Returns the z-angle of this stuntdouble in specified snapshot |
734 |
< |
* @return the z-angle of this stuntdouble |
735 |
< |
* @param snapshotNo |
736 |
< |
*/ |
737 |
< |
double getZangle(int snapshotNo) { |
738 |
< |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_]; |
739 |
< |
} |
732 |
> |
/** |
733 |
> |
* Returns the z-angle of this stuntdouble in specified snapshot |
734 |
> |
* @return the z-angle of this stuntdouble |
735 |
> |
* @param snapshotNo |
736 |
> |
*/ |
737 |
> |
RealType getZangle(int snapshotNo) { |
738 |
> |
return ((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_]; |
739 |
> |
} |
740 |
|
|
741 |
< |
/** |
742 |
< |
* Sets the previous z-angle of this stuntdouble |
743 |
< |
* @param angle new z-angle |
744 |
< |
* @see #getZangle |
745 |
< |
*/ |
746 |
< |
void setPrevZangle(double angle) { |
747 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] = angle; |
748 |
< |
} |
741 |
> |
/** |
742 |
> |
* Sets the previous z-angle of this stuntdouble |
743 |
> |
* @param angle new z-angle |
744 |
> |
* @see #getZangle |
745 |
> |
*/ |
746 |
> |
void setPrevZangle(RealType angle) { |
747 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] = angle; |
748 |
> |
} |
749 |
|
|
750 |
< |
/** |
751 |
< |
* Sets the current z-angle of this stuntdouble |
752 |
< |
* @param angle new z-angle |
753 |
< |
*/ |
754 |
< |
void setZangle(double angle) { |
755 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] = angle; |
756 |
< |
} |
750 |
> |
/** |
751 |
> |
* Sets the current z-angle of this stuntdouble |
752 |
> |
* @param angle new z-angle |
753 |
> |
*/ |
754 |
> |
void setZangle(RealType angle) { |
755 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] = angle; |
756 |
> |
} |
757 |
|
|
758 |
< |
/** |
759 |
< |
* Sets the z-angle of this stuntdouble in specified snapshot |
760 |
< |
* @param angle z-angle to be set |
761 |
< |
* @param snapshotNo |
762 |
< |
* @see #getZangle |
763 |
< |
*/ |
764 |
< |
void setZangle(double angle, int snapshotNo) { |
765 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] = angle; |
766 |
< |
} |
758 |
> |
/** |
759 |
> |
* Sets the z-angle of this stuntdouble in specified snapshot |
760 |
> |
* @param angle z-angle to be set |
761 |
> |
* @param snapshotNo |
762 |
> |
* @see #getZangle |
763 |
> |
*/ |
764 |
> |
void setZangle(RealType angle, int snapshotNo) { |
765 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] = angle; |
766 |
> |
} |
767 |
|
|
768 |
< |
/** |
769 |
< |
* Adds z-angle into the previous z-angle of this stuntdouble |
770 |
< |
* @param angle new z-angle |
771 |
< |
* @see #getZangle |
772 |
< |
*/ |
773 |
< |
void addPrevZangle(double angle) { |
774 |
< |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] += angle; |
775 |
< |
} |
768 |
> |
/** |
769 |
> |
* Adds z-angle into the previous z-angle of this stuntdouble |
770 |
> |
* @param angle new z-angle |
771 |
> |
* @see #getZangle |
772 |
> |
*/ |
773 |
> |
void addPrevZangle(RealType angle) { |
774 |
> |
((snapshotMan_->getPrevSnapshot())->*storage_).zAngle[localIndex_] += angle; |
775 |
> |
} |
776 |
|
|
777 |
< |
/** |
778 |
< |
* Adds z-angle into the current z-angle of this stuntdouble |
779 |
< |
* @param angle new z-angle |
780 |
< |
*/ |
781 |
< |
void addZangle(double angle) { |
782 |
< |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] += angle; |
783 |
< |
} |
777 |
> |
/** |
778 |
> |
* Adds z-angle into the current z-angle of this stuntdouble |
779 |
> |
* @param angle new z-angle |
780 |
> |
*/ |
781 |
> |
void addZangle(RealType angle) { |
782 |
> |
((snapshotMan_->getCurrentSnapshot())->*storage_).zAngle[localIndex_] += angle; |
783 |
> |
} |
784 |
|
|
785 |
< |
/** |
786 |
< |
* Adds z-angle into the z-angle of this stuntdouble in specified snapshot |
787 |
< |
* @param angle z-angle to be add |
788 |
< |
* @param snapshotNo |
789 |
< |
* @see #getZangle |
790 |
< |
*/ |
791 |
< |
void addZangle(double angle, int snapshotNo) { |
792 |
< |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle; |
793 |
< |
} |
785 |
> |
/** |
786 |
> |
* Adds z-angle into the z-angle of this stuntdouble in specified snapshot |
787 |
> |
* @param angle z-angle to be add |
788 |
> |
* @param snapshotNo |
789 |
> |
* @see #getZangle |
790 |
> |
*/ |
791 |
> |
void addZangle(RealType angle, int snapshotNo) { |
792 |
> |
((snapshotMan_->getSnapshot(snapshotNo))->*storage_).zAngle[localIndex_] += angle; |
793 |
> |
} |
794 |
|
|
795 |
< |
/** Set the force of this stuntdouble to zero */ |
796 |
< |
void zeroForcesAndTorques(); |
797 |
< |
/** |
798 |
< |
* Returns the inertia tensor of this stuntdouble |
799 |
< |
* @return the inertia tensor of this stuntdouble |
800 |
< |
*/ |
801 |
< |
virtual Mat3x3d getI() = 0; |
795 |
> |
/** Set the force of this stuntdouble to zero */ |
796 |
> |
void zeroForcesAndTorques(); |
797 |
> |
/** |
798 |
> |
* Returns the inertia tensor of this stuntdouble |
799 |
> |
* @return the inertia tensor of this stuntdouble |
800 |
> |
*/ |
801 |
> |
virtual Mat3x3d getI() = 0; |
802 |
|
|
803 |
< |
/** |
804 |
< |
* Returns the gradient of this stuntdouble |
805 |
< |
* @return the gradient of this stuntdouble |
806 |
< |
*/ |
807 |
< |
virtual std::vector<double> getGrad() = 0; |
803 |
> |
/** |
804 |
> |
* Returns the gradient of this stuntdouble |
805 |
> |
* @return the gradient of this stuntdouble |
806 |
> |
*/ |
807 |
> |
virtual std::vector<RealType> getGrad() = 0; |
808 |
|
|
809 |
< |
/** |
810 |
< |
* Tests the if this stuntdouble is a linear rigidbody |
811 |
< |
* |
812 |
< |
* @return true if this stuntdouble is a linear rigidbody, otherwise return false |
813 |
< |
* @note atom and directional atom will always return false |
814 |
< |
* |
815 |
< |
* @see #linearAxis |
816 |
< |
*/ |
817 |
< |
bool isLinear() { |
818 |
< |
return linear_; |
819 |
< |
} |
809 |
> |
/** |
810 |
> |
* Tests the if this stuntdouble is a linear rigidbody |
811 |
> |
* |
812 |
> |
* @return true if this stuntdouble is a linear rigidbody, otherwise return false |
813 |
> |
* @note atom and directional atom will always return false |
814 |
> |
* |
815 |
> |
* @see #linearAxis |
816 |
> |
*/ |
817 |
> |
bool isLinear() { |
818 |
> |
return linear_; |
819 |
> |
} |
820 |
|
|
821 |
< |
/** |
822 |
< |
* Returns the linear axis of the rigidbody, atom and directional atom will always return -1 |
823 |
< |
* |
824 |
< |
* @return the linear axis of the rigidbody |
825 |
< |
* |
826 |
< |
* @see #isLinear |
827 |
< |
*/ |
828 |
< |
int linearAxis() { |
829 |
< |
return linearAxis_; |
830 |
< |
} |
821 |
> |
/** |
822 |
> |
* Returns the linear axis of the rigidbody, atom and directional atom will always return -1 |
823 |
> |
* |
824 |
> |
* @return the linear axis of the rigidbody |
825 |
> |
* |
826 |
> |
* @see #isLinear |
827 |
> |
*/ |
828 |
> |
int linearAxis() { |
829 |
> |
return linearAxis_; |
830 |
> |
} |
831 |
|
|
832 |
< |
/** Returns the mass of this stuntdouble */ |
833 |
< |
double getMass() { |
834 |
< |
return mass_; |
835 |
< |
} |
832 |
> |
/** Returns the mass of this stuntdouble */ |
833 |
> |
RealType getMass() { |
834 |
> |
return mass_; |
835 |
> |
} |
836 |
|
|
837 |
< |
/** |
838 |
< |
* Sets the mass of this stuntdoulbe |
839 |
< |
* @param mass the mass to be set |
840 |
< |
*/ |
841 |
< |
void setMass(double mass) { |
842 |
< |
mass_ = mass; |
843 |
< |
} |
837 |
> |
/** |
838 |
> |
* Sets the mass of this stuntdoulbe |
839 |
> |
* @param mass the mass to be set |
840 |
> |
*/ |
841 |
> |
void setMass(RealType mass) { |
842 |
> |
mass_ = mass; |
843 |
> |
} |
844 |
|
|
845 |
< |
/** Returns the name of this stuntdouble */ |
846 |
< |
virtual std::string getType() = 0; |
845 |
> |
/** Returns the name of this stuntdouble */ |
846 |
> |
virtual std::string getType() = 0; |
847 |
|
|
848 |
< |
/** Sets the name of this stuntdouble*/ |
849 |
< |
virtual void setType(const std::string& name) {} |
848 |
> |
/** Sets the name of this stuntRealType*/ |
849 |
> |
virtual void setType(const std::string& name) {} |
850 |
|
|
851 |
< |
/** |
852 |
< |
* Converts a lab fixed vector to a body fixed vector. |
853 |
< |
* @return body fixed vector |
854 |
< |
* @param v lab fixed vector |
855 |
< |
*/ |
856 |
< |
Vector3d lab2Body(const Vector3d& v) { |
857 |
< |
return getA() * v; |
858 |
< |
} |
851 |
> |
/** |
852 |
> |
* Converts a lab fixed vector to a body fixed vector. |
853 |
> |
* @return body fixed vector |
854 |
> |
* @param v lab fixed vector |
855 |
> |
*/ |
856 |
> |
Vector3d lab2Body(const Vector3d& v) { |
857 |
> |
return getA() * v; |
858 |
> |
} |
859 |
|
|
860 |
< |
Vector3d lab2Body(const Vector3d& v, int frame) { |
861 |
< |
return getA(frame) * v; |
862 |
< |
} |
860 |
> |
Vector3d lab2Body(const Vector3d& v, int frame) { |
861 |
> |
return getA(frame) * v; |
862 |
> |
} |
863 |
|
|
864 |
< |
/** |
865 |
< |
* Converts a body fixed vector to a lab fixed vector. |
866 |
< |
* @return corresponding lab fixed vector |
867 |
< |
* @param v body fixed vector |
868 |
< |
*/ |
869 |
< |
Vector3d body2Lab(const Vector3d& v){ |
870 |
< |
return getA().transpose() * v; |
871 |
< |
} |
864 |
> |
/** |
865 |
> |
* Converts a body fixed vector to a lab fixed vector. |
866 |
> |
* @return corresponding lab fixed vector |
867 |
> |
* @param v body fixed vector |
868 |
> |
*/ |
869 |
> |
Vector3d body2Lab(const Vector3d& v){ |
870 |
> |
return getA().transpose() * v; |
871 |
> |
} |
872 |
|
|
873 |
< |
Vector3d body2Lab(const Vector3d& v, int frame){ |
874 |
< |
return getA(frame).transpose() * v; |
875 |
< |
} |
876 |
< |
/** |
877 |
< |
* <p> |
878 |
< |
* The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on |
879 |
< |
* the elements of a data structure. In this way, you can change the operation being performed |
880 |
< |
* on a structure without the need of changing the classes of the elements that you are operating |
881 |
< |
* on. Using a Visitor pattern allows you to decouple the classes for the data structure and the |
882 |
< |
* algorithms used upon them |
883 |
< |
* </p> |
884 |
< |
* @param v visitor |
885 |
< |
*/ |
886 |
< |
virtual void accept(BaseVisitor* v) = 0; |
873 |
> |
Vector3d body2Lab(const Vector3d& v, int frame){ |
874 |
> |
return getA(frame).transpose() * v; |
875 |
> |
} |
876 |
> |
/** |
877 |
> |
* <p> |
878 |
> |
* The purpose of the Visitor Pattern is to encapsulate an operation that you want to perform on |
879 |
> |
* the elements of a data structure. In this way, you can change the operation being performed |
880 |
> |
* on a structure without the need of changing the classes of the elements that you are operating |
881 |
> |
* on. Using a Visitor pattern allows you to decouple the classes for the data structure and the |
882 |
> |
* algorithms used upon them |
883 |
> |
* </p> |
884 |
> |
* @param v visitor |
885 |
> |
*/ |
886 |
> |
virtual void accept(BaseVisitor* v) = 0; |
887 |
|
|
888 |
< |
//below functions are just forward functions |
889 |
< |
/** |
890 |
< |
* Adds property into property map |
891 |
< |
* @param genData GenericData to be added into PropertyMap |
892 |
< |
*/ |
893 |
< |
void addProperty(GenericData* genData); |
888 |
> |
//below functions are just forward functions |
889 |
> |
/** |
890 |
> |
* Adds property into property map |
891 |
> |
* @param genData GenericData to be added into PropertyMap |
892 |
> |
*/ |
893 |
> |
void addProperty(GenericData* genData); |
894 |
|
|
895 |
< |
/** |
896 |
< |
* Removes property from PropertyMap by name |
897 |
< |
* @param propName the name of property to be removed |
898 |
< |
*/ |
899 |
< |
void removeProperty(const std::string& propName); |
895 |
> |
/** |
896 |
> |
* Removes property from PropertyMap by name |
897 |
> |
* @param propName the name of property to be removed |
898 |
> |
*/ |
899 |
> |
void removeProperty(const std::string& propName); |
900 |
|
|
901 |
< |
/** |
902 |
< |
* clear all of the properties |
903 |
< |
*/ |
904 |
< |
void clearProperties(); |
901 |
> |
/** |
902 |
> |
* clear all of the properties |
903 |
> |
*/ |
904 |
> |
void clearProperties(); |
905 |
|
|
906 |
< |
/** |
907 |
< |
* Returns all names of properties |
908 |
< |
* @return all names of properties |
909 |
< |
*/ |
910 |
< |
std::vector<std::string> getPropertyNames(); |
906 |
> |
/** |
907 |
> |
* Returns all names of properties |
908 |
> |
* @return all names of properties |
909 |
> |
*/ |
910 |
> |
std::vector<std::string> getPropertyNames(); |
911 |
|
|
912 |
< |
/** |
913 |
< |
* Returns all of the properties in PropertyMap |
914 |
< |
* @return all of the properties in PropertyMap |
915 |
< |
*/ |
916 |
< |
std::vector<GenericData*> getProperties(); |
912 |
> |
/** |
913 |
> |
* Returns all of the properties in PropertyMap |
914 |
> |
* @return all of the properties in PropertyMap |
915 |
> |
*/ |
916 |
> |
std::vector<GenericData*> getProperties(); |
917 |
|
|
918 |
< |
/** |
919 |
< |
* Returns property |
920 |
< |
* @param propName name of property |
921 |
< |
* @return a pointer point to property with propName. If no property named propName |
922 |
< |
* exists, return NULL |
923 |
< |
*/ |
924 |
< |
GenericData* getPropertyByName(const std::string& propName); |
918 |
> |
/** |
919 |
> |
* Returns property |
920 |
> |
* @param propName name of property |
921 |
> |
* @return a pointer point to property with propName. If no property named propName |
922 |
> |
* exists, return NULL |
923 |
> |
*/ |
924 |
> |
GenericData* getPropertyByName(const std::string& propName); |
925 |
|
|
926 |
< |
protected: |
926 |
> |
protected: |
927 |
|
|
928 |
< |
StuntDouble(ObjectType objType, DataStoragePointer storage); |
928 |
> |
StuntDouble(ObjectType objType, DataStoragePointer storage); |
929 |
|
|
930 |
< |
StuntDouble(const StuntDouble& sd); |
931 |
< |
StuntDouble& operator=(const StuntDouble& sd); |
930 |
> |
StuntDouble(const StuntDouble& sd); |
931 |
> |
StuntDouble& operator=(const StuntDouble& sd); |
932 |
|
|
933 |
< |
ObjectType objType_; |
934 |
< |
DataStoragePointer storage_; |
935 |
< |
SnapshotManager* snapshotMan_; |
933 |
> |
ObjectType objType_; |
934 |
> |
DataStoragePointer storage_; |
935 |
> |
SnapshotManager* snapshotMan_; |
936 |
|
|
937 |
< |
bool linear_; |
938 |
< |
int linearAxis_; |
937 |
> |
bool linear_; |
938 |
> |
int linearAxis_; |
939 |
|
|
940 |
|
|
941 |
< |
int globalIndex_; |
942 |
< |
int localIndex_; |
941 |
> |
int globalIndex_; |
942 |
> |
int globalIntegrableObjectIndex_; |
943 |
> |
int localIndex_; |
944 |
|
|
945 |
|
|
946 |
< |
double mass_; |
946 |
> |
RealType mass_; |
947 |
|
|
948 |
< |
private: |
948 |
> |
private: |
949 |
|
|
950 |
< |
PropertyMap properties_; |
951 |
< |
}; |
950 |
> |
PropertyMap properties_; |
951 |
> |
}; |
952 |
|
|
953 |
|
}//end namespace oopse |
954 |
|
#endif //PRIMITIVES_STUNTDOUBLE_HPP |