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 1250 by gezelter, Fri Jun 4 21:00:20 2004 UTC vs.
Revision 1452 by tim, Mon Aug 23 15:11:36 2004 UTC

# Line 138 | Line 138 | void StuntDouble::setVel(double vel[3]){
138   }
139  
140   void StuntDouble::setVel(double vel[3]){
141 +
142    switch (objType)
143      {
144      case OT_ATOM :
# Line 156 | Line 157 | void StuntDouble::setVel(double vel[3]){
157      }  
158   }
159  
160 + void StuntDouble::setFrc(double frc[3]){
161 +
162 +  switch (objType)
163 +    {
164 +    case OT_ATOM :
165 +    case OT_DATOM:      
166 +      ((Atom*)this)->setFrc(frc);
167 +      break;
168 +    case OT_RIGIDBODY:
169 +      ((RigidBody*)this)->setFrc(frc);
170 +      break;      
171 +    default:
172 +      sprintf( painCave.errMsg,
173 +               "Unrecognized ObjType (%d) in StuntDouble::setFrc.\n",
174 +               objType );
175 +      painCave.isFatal = 1;
176 +      simError();    
177 +    }  
178 + }
179 +
180   void StuntDouble::addFrc(double frc[3]){
181    switch (objType)
182      {
# Line 364 | Line 385 | void StuntDouble::getTrq(double trq[3]){
385        painCave.isFatal = 1;
386        simError();    
387    }
388 + }
389 +
390 + void StuntDouble::setTrq(double trq[3]){
391 +  switch (objType)
392 +    {
393 +    case OT_ATOM:
394 +      sprintf( painCave.errMsg,
395 +               "StuntDouble::setTrq was called for a regular atom.\n"
396 +               "\tRegular Atoms don't have torques.  Be smarter.\n");
397 +      painCave.isFatal = 1;
398 +      simError();
399 +      break;
400 +    case OT_DATOM:
401 +      ((DirectionalAtom*)this)->setTrq(trq);
402 +    break;
403 +    case OT_RIGIDBODY:
404 +      ((RigidBody*)this)->setTrq(trq);
405 +    break;
406 +    default:
407 +      sprintf( painCave.errMsg,
408 +               "Unrecognized ObjType (%d) in StuntDouble::addTrq.\n",
409 +               objType );
410 +      painCave.isFatal = 1;
411 +      simError();    
412 +    }
413   }
414  
415   void StuntDouble::addTrq(double trq[3]){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines