Changeset 8c6b68 for src/Actions


Ignore:
Timestamp:
Apr 10, 2018, 6:43:12 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
6145577
Parents:
efd020
git-author:
Frederik Heber <frederik.heber@…> (08/03/17 10:46:48)
git-committer:
Frederik Heber <frederik.heber@…> (04/10/18 06:43:12)
Message:

atom::removeStep() extended to removing interval of steps.

  • AtomInfo::removeTrajectorySteps() and BondedParticle::removeTrajectorySteps() changed and all calls adapted.
Location:
src/Actions
Files:
3 edited

Legend:

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

    refd020 r8c6b68  
    134134
    135135  // remove current step for all modified atoms
    136   removeLastStep(getIdsFromAtomicInfo(state->UndoInfo), CurrentStep+1);
     136  removeSteps(getIdsFromAtomicInfo(state->UndoInfo), CurrentStep+1, CurrentStep+1);
    137137
    138138  // and set back the old step (forces have been changed)
  • src/Actions/UndoRedoHelpers.cpp

    refd020 r8c6b68  
    219219}
    220220
    221 void MoleCuilder::removeLastStep(const std::vector<atomId_t> &_atoms, const unsigned int _step)
    222 {
    223   for (size_t i=0; i<_atoms.size(); ++i) {
    224     atom * const _atom = World::getInstance().getAtom(AtomById(_atoms[i]));
    225     _atom->removeStep(_step);
     221void MoleCuilder::removeSteps(
     222    const std::vector<atomId_t> &movedatoms,
     223    const unsigned int _firststep,
     224    const unsigned int _laststep)
     225{
     226  for (std::vector<atomId_t>::const_iterator iter = movedatoms.begin();
     227      iter != movedatoms.end(); ++iter) {
     228    atom * const _atom = World::getInstance().getAtom(AtomById(*iter));
     229    _atom->removeSteps(_firststep, _laststep);
    226230  }
    227231}
  • src/Actions/UndoRedoHelpers.hpp

    refd020 r8c6b68  
    111111  void RemoveMoleculesWithAtomsByIds(const std::vector<moleculeId_t> &ids);
    112112
    113   /** Removes the last time step for all \a movedatoms
     113  /** Removes the time steps in given interval for all \a movedatoms.
    114114   *
    115    * @param movedatoms atoms whose last step in time to remove
    116    * @param _step which trajectory to remove
     115   * @param movedatoms atoms whose steps in [\a _firststep, \a _laststep] in time to remove
     116   * @param _firststep first step in interval to be removed
     117   * @param _laststep last step in interval to be removed
    117118   */
    118   void removeLastStep(const std::vector<atomId_t> &movedatoms, const unsigned int _step);
     119  void removeSteps(
     120      const std::vector<atomId_t> &movedatoms,
     121      const unsigned int _firststep,
     122      const unsigned int _laststep);
    119123
    120124  /** Adds another time step to all \a movedatoms.
Note: See TracChangeset for help on using the changeset viewer.