Changes in / [3fa16b:08d042]


Ignore:
Location:
src
Files:
4 edited

Legend:

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

    r3fa16b r08d042  
    6262  }
    6363
    64   // check whether Axis is valid
    65   if (params.Axis.get().IsZero()) {
    66     STATUS("Rotation Axis must not be zero.");
    67     return Action::failure;
    68   }
    69 
    70   // convert from degrees to radian
    71   const double angle_radian = params.angle.get() * M_PI/180.;
    72 
    7364  // go through all selected molecules
    7465  BOOST_FOREACH(molecule *mol, selectedMolecules) {
     66    // check whether Axis is valid
     67    if (params.Axis.get().IsZero()) {
     68      STATUS("Rotation Axis must not be zero.");
     69      return Action::failure;
     70    }
     71
     72    // convert from degrees to radian
     73    params.angle.set(params.angle.get() * M_PI/180.);
     74
    7575    // Creation Line that is the rotation axis
    7676    const Vector CenterOfGravity = mol->DetermineCenterOfGravity();
    77     LOG(3, "DEBUG: Center of gravity is " << CenterOfGravity << ".");
     77    LOG(0,  "Center of gravity is " << CenterOfGravity << ".");
    7878    Line RotationAxis(CenterOfGravity, params.Axis.get());
    79     LOG(2, "DEBUG: Rotate " << mol->getName() << " around self by " << angle_radian << " radian around axis " << RotationAxis << ".");
     79    LOG(0, "Rotate " << mol->getName() << " around self by " << params.angle.get() << " radian around axis " << RotationAxis << ".");
    8080
    8181    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
    82       (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), angle_radian));
     82      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), params.angle.get()));
    8383    }
    84     LOG(2, "DEBUG: Rotatating of " << mol->getName() << " done.");
     84    LOG(0, "done.");
    8585  }
    8686
     
    9191  MoleculeRotateAroundSelfByAngleState *state = assert_cast<MoleculeRotateAroundSelfByAngleState*>(_state.get());
    9292
    93   // convert from degrees to radian
    94   const double angle_radian = -state->params.angle.get() * M_PI/180.;
    95 
    9693  BOOST_FOREACH(molecule *mol, state->selectedMolecules) {
    9794    const Vector CenterOfGravity = mol->DetermineCenterOfGravity();
    9895    LOG(0,  "Center of gravity is " <<CenterOfGravity << ".");
    9996    Line RotationAxis(CenterOfGravity, state->params.Axis.get());
    100     LOG(0, "Rotate " << mol->getName() << " around self by " << angle_radian << " radian around axis " << RotationAxis << ".");
     97    LOG(0, "Rotate " << mol->getName() << " around self by " << -state->params.angle.get() << " radian around axis " << RotationAxis << ".");
    10198
    102     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter)
    103       (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), angle_radian));
     99    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     100      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), -state->params.angle.get()));
     101    }
    104102  }
    105103
     
    110108  MoleculeRotateAroundSelfByAngleState *state = assert_cast<MoleculeRotateAroundSelfByAngleState*>(_state.get());
    111109
    112   // convert from degrees to radian
    113   const double angle_radian = state->params.angle.get() * M_PI/180.;
    114 
    115110  BOOST_FOREACH(molecule *mol, state->selectedMolecules) {
    116111    const Vector CenterOfGravity = mol->DetermineCenterOfGravity();
    117112    LOG(0,  "Center of gravity is " << CenterOfGravity << ".");
    118113    Line RotationAxis(CenterOfGravity, state->params.Axis.get());
    119     LOG(0, "Rotate " << mol->getName() << " around self by " << angle_radian << " radian around axis " << RotationAxis << ".");
     114    LOG(0, "Rotate " << mol->getName() << " around self by " << state->params.angle.get() << " radian around axis " << RotationAxis << ".");
    120115
    121     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter)
    122       (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), angle_radian));
     116    for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
     117      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), state->params.angle.get()));
     118    }
    123119  }
    124120
  • src/UIElements/Views/Qt4/MoleculeList/QtMoleculeList.cpp

    r3fa16b r08d042  
    464464      +" does not have a groupitem?");
    465465  QList<QStandardItem *> mol_row = _molitem->parent()->takeRow(_molitem->index().row());
    466   // call setOccurrence on the old group later, if it's not a removal candidate
    467   if (groupitem->rowCount() != 0)
    468     addToBeSetOccurrence(groupitem);
     466  // call setOccurrence on the old group later
     467  addToBeSetOccurrence(groupitem);
    469468  // ..  and re-add where new formula fits
    470469  const std::string molecule_formula = _molitem->getMolecule()->getFormula().toString();
  • src/UIElements/Views/Qt4/QtInfoBox.cpp

    r3fa16b r08d042  
    5757
    5858  setMinimumWidth(200);
    59   setMinimumHeight(220);
     59  setMinimumHeight(200);
    6060  currentPage = 0;
    6161
     
    178178  addInfo(this, "Mass", QString("%1").arg(atomRef->getMass()));
    179179  addInfo(this, "Charge", QString("%1").arg(atomRef->getCharge()));
     180  addInfo(this, "Position", QString(toString(atomRef->getPosition()).c_str()));
    180181  addInfo(this, "Bonds", QString("%1").arg(atomRef->getListOfBonds().size()));
    181   addInfo(this, "Position x", QString(toString(atomRef->getPosition()[0]).c_str()));
    182   addInfo(this, "Position y", QString(toString(atomRef->getPosition()[1]).c_str()));
    183   addInfo(this, "Position z", QString(toString(atomRef->getPosition()[2]).c_str()));
    184182}
    185183
     
    220218  addInfo(this, "Formula", QString(mol->getFormula().toString().c_str()));
    221219  addInfo(this, "Atoms", QString("%1").arg(mol->getAtomCount()));
    222   addInfo(this, "NonHydrogens", QString("%1").arg(mol->getNoNonHydrogen()));
    223220  addInfo(this, "Bonds", QString("%1").arg(mol->getBondCount()));
    224   const Vector molCenter = mol->DetermineCenterOfAll();
    225   addInfo(this, "Center x", QString("%1").arg(molCenter[0]));
    226   addInfo(this, "Center y", QString("%1").arg(molCenter[1]));
    227   addInfo(this, "Center z", QString("%1").arg(molCenter[2]));
    228221}
    229222
  • src/UIElements/Views/Qt4/QtStatusBar.cpp

    r3fa16b r08d042  
    6565  StatusList_signedOn(false),
    6666  timer(NULL),
    67   timer_interval(4000)
     67  timer_interval(1500)
    6868{
    6969  World::getInstance().signOn(this);
Note: See TracChangeset for help on using the changeset viewer.