--- trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2004/04/12 20:32:20 1097 +++ trunk/OOPSE/libmdtools/DirectionalAtom.cpp 2004/08/23 15:11:36 1452 @@ -35,7 +35,8 @@ void DirectionalAtom::setCoords(void){ &trq, &Amat, &mu, - &ul ); + &ul, + &quat); } else{ sprintf( painCave.errMsg, @@ -431,6 +432,23 @@ void DirectionalAtom::getTrq( double theT[3] ){ sprintf( painCave.errMsg, "Attempt to get Trq for atom %d before coords set.\n", + index ); + painCave.isFatal = 1; + simError(); + } +} + +void DirectionalAtom::setTrq( double theT[3] ){ + + if( hasCoords ){ + trq[offsetX] = theT[0]; + trq[offsetY] = theT[1]; + trq[offsetZ] = theT[2]; + } + else{ + + sprintf( painCave.errMsg, + "Attempt to add Trq for atom %d before coords set.\n", index ); painCave.isFatal = 1; simError(); @@ -539,11 +557,7 @@ void DirectionalAtom::getEulerAngles(double myEuler[3] double phi,theta,psi,eps; - double pi; - double cphi,ctheta,cpsi; - double sphi,stheta,spsi; - double b[3]; - int flip[3]; + double ctheta,stheta; // set the tolerance for Euler angles and rotation elements @@ -583,8 +597,54 @@ void DirectionalAtom::getEulerAngles(double myEuler[3] myEuler[2] = psi; return; +} + +double DirectionalAtom::getZangle( ){ + + if( hasCoords ){ + return zAngle; + } + else{ + + sprintf( painCave.errMsg, + "Attempt to get zAngle for atom %d before coords set.\n", + index ); + painCave.isFatal = 1; + simError(); + return 0; + } } +void DirectionalAtom::setZangle( double zAng ){ + + if( hasCoords ){ + zAngle = zAng; + } + else{ + + sprintf( painCave.errMsg, + "Attempt to set zAngle for atom %d before coords set.\n", + index ); + painCave.isFatal = 1; + simError(); + } +} + +void DirectionalAtom::addZangle( double zAng ){ + + if( hasCoords ){ + zAngle += zAng; + } + else{ + + sprintf( painCave.errMsg, + "Attempt to add zAngle to atom %d before coords set.\n", + index ); + painCave.isFatal = 1; + simError(); + } +} + double DirectionalAtom::max(double x, double y) { return (x > y) ? x : y; }