Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp

    rbe21fa rf10b0c  
    4848  BOOST_FOREACH(molecule *mol, selectedMolecules) {
    4949    // check whether Axis is valid
    50     if (params.Axis.IsZero())
     50    if (params.Axis.get().IsZero())
    5151      return Action::failure;
    5252
    5353    // convert from degrees to radian
    54     params.angle *= M_PI/180.;
     54    params.angle.set(params.angle.get() * M_PI/180.);
    5555
    5656    // Creation Line that is the rotation axis
    5757    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
    5858    LOG(0,  "Center of gravity is " << *CenterOfGravity << ".");
    59     Line RotationAxis(*CenterOfGravity, params.Axis);
     59    Line RotationAxis(*CenterOfGravity, params.Axis.get());
    6060    delete(CenterOfGravity);
    61     LOG(0, "Rotate " << mol->getName() << " around self by " << params.angle << " radian around axis " << RotationAxis << ".");
     61    LOG(0, "Rotate " << mol->getName() << " around self by " << params.angle.get() << " radian around axis " << RotationAxis << ".");
    6262
    6363    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    64       (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), params.angle));
     64      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), params.angle.get()));
    6565    }
    6666    LOG(0, "done.");
     
    7676    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
    7777    LOG(0,  "Center of gravity is " << *CenterOfGravity << ".");
    78     Line RotationAxis(*CenterOfGravity, state->params.Axis);
     78    Line RotationAxis(*CenterOfGravity, state->params.Axis.get());
    7979    delete(CenterOfGravity);
    80     LOG(0, "Rotate " << mol->getName() << " around self by " << -state->params.angle << " radian around axis " << RotationAxis << ".");
     80    LOG(0, "Rotate " << mol->getName() << " around self by " << -state->params.angle.get() << " radian around axis " << RotationAxis << ".");
    8181
    8282    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    83       (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->params.angle));
     83      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->params.angle.get()));
    8484    }
    8585  }
     
    9494    Vector *CenterOfGravity = mol->DetermineCenterOfGravity();
    9595    LOG(0,  "Center of gravity is " << *CenterOfGravity << ".");
    96     Line RotationAxis(*CenterOfGravity, state->params.Axis);
     96    Line RotationAxis(*CenterOfGravity, state->params.Axis.get());
    9797    delete(CenterOfGravity);
    98     LOG(0, "Rotate " << mol->getName() << " around self by " << state->params.angle << " radian around axis " << RotationAxis << ".");
     98    LOG(0, "Rotate " << mol->getName() << " around self by " << state->params.angle.get() << " radian around axis " << RotationAxis << ".");
    9999
    100100    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    101       (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->params.angle));
     101      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->params.angle.get()));
    102102    }
    103103  }
Note: See TracChangeset for help on using the changeset viewer.