ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/StuntDouble.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/StuntDouble.cpp (file contents):
Revision 1097 by gezelter, Mon Apr 12 20:32:20 2004 UTC vs.
Revision 1108 by tim, Wed Apr 14 15:37:41 2004 UTC

# Line 271 | Line 271 | void StuntDouble::setJ(double j[3]){
271        painCave.isFatal = 1;
272        simError();    
273      }
274 + }
275 +
276 + void StuntDouble::getQ(double q[4] ){
277 +  switch (objType)
278 +    {
279 +    case OT_ATOM:
280 +      sprintf( painCave.errMsg,
281 +               "StuntDouble::getJ was called for a regular atom.\n"
282 +               "\tRegular Atoms don't have angular momentum.  Be smarter.\n");
283 +      painCave.isFatal = 0;
284 +      simError();
285 +      // Return zeros.
286 +      q[0] = 0;
287 +      q[1] = 0;
288 +      q[2] = 0;
289 +      q[3] = 0;
290 +      break;
291 +    case OT_DATOM:
292 +      ((DirectionalAtom*)this)->getQ(q);
293 +    break;
294 +    case OT_RIGIDBODY:
295 +      ((RigidBody*)this)->getQ(q);
296 +    break;
297 +    default:
298 +      sprintf( painCave.errMsg,
299 +               "Unrecognized ObjType (%d) in StuntDouble::getJ.\n",
300 +               objType );
301 +      painCave.isFatal = 1;
302 +      simError();    
303 +  }
304   }
305  
306 + void StuntDouble::setQ(double q[4] ){
307 +  switch (objType)
308 +    {
309 +    case OT_ATOM:
310 +      sprintf( painCave.errMsg,
311 +               "StuntDouble::setJ was called for a regular atom.\n"
312 +               "\tRegular Atoms don't have angular momentum.  Be smarter.\n");
313 +      painCave.isFatal = 1;
314 +      simError();
315 +      break;
316 +    case OT_DATOM:
317 +      ((DirectionalAtom*)this)->setJ(q);
318 +    break;
319 +    case OT_RIGIDBODY:
320 +      ((RigidBody*)this)->setJ(q);
321 +    break;
322 +    default:
323 +      sprintf( painCave.errMsg,
324 +               "Unrecognized ObjType (%d) in StuntDouble::setJ.\n",
325 +               objType );
326 +      painCave.isFatal = 1;
327 +      simError();    
328 +    }
329 + }
330   void StuntDouble::getTrq(double trq[3]){
331    switch (objType)
332      {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines