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 1234 by tim, Fri Jun 4 03:15:31 2004 UTC vs.
Revision 1452 by tim, Mon Aug 23 15:11:36 2004 UTC

# Line 28 | Line 28 | StuntDouble::~StuntDouble(){
28   StuntDouble::~StuntDouble(){
29    map<string, GenericData*>::iterator iter;
30  
31 <  for(iter = properties.begin(); iter != properties.end(); ){
31 >  for(iter = properties.begin(); iter != properties.end(); ++iter ){
32      delete iter->second;
33 <    iter = properties.erase(iter);
33 >    properties.erase(iter);
34    }
35      
36   }
# 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 150 | Line 151 | void StuntDouble::setVel(double vel[3]){
151      default:
152        sprintf( painCave.errMsg,
153                 "Unrecognized ObjType (%d) in StuntDouble::setVel.\n",
154 +               objType );
155 +      painCave.isFatal = 1;
156 +      simError();    
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();    
# Line 366 | Line 387 | void StuntDouble::getTrq(double trq[3]){
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]){
416    switch (objType)
417      {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines