Ignore:
Timestamp:
May 18, 2017, 8:05:20 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_goodresults, ForceAnnealing_tocheck
Children:
ffd7cd
Parents:
d5c1c8
git-author:
Frederik Heber <frederik.heber@…> (05/18/17 19:33:25)
git-committer:
Frederik Heber <frederik.heber@…> (05/18/17 20:05:20)
Message:

tempcommit: Also SelectionAtomByOrder and unselect actions allow for multiple orders. Merge with d2a077a13.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/SelectionAction/Molecules/MoleculeByOrderAction.cpp

    rd5c1c8 rc5bd60c  
    5757  const std::vector<int> &indices = params.molindices.get();
    5858  std::vector<const molecule *> mols;
     59  const World &const_world = World::getConstInstance();
     60  World &world = World::getInstance();
    5961  for( std::vector<int>::const_iterator iter = indices.begin();
    6062      iter != indices.end(); ++iter) {
    61     const molecule *mol = const_cast<const World &>(World::getInstance()).
    62         getMolecule(MoleculeByOrder(*iter));
     63    const molecule *mol = const_world.getMolecule(MoleculeByOrder(*iter));
    6364
    6465    if (mol != NULL) {
    65       if (!World::getInstance().isSelected(mol)) {
     66      if (!const_world.isSelected(mol)) {
    6667        //LOG(1, "Selecting molecule " << mol->name);
    67         World::getInstance().selectMolecule(mol);
     68        world.selectMolecule(mol);
    6869        mols.push_back(mol);
     70        ++no_selected;
    6971      }
    7072    } else {
     
    8587  SelectionMoleculeByOrderState *state = assert_cast<SelectionMoleculeByOrderState*>(_state.get());
    8688
     89  World &world = World::getInstance();
    8790  for (std::vector<const molecule *>::const_iterator iter = state->mols.begin();
    8891      iter != state->mols.end(); ++iter)
    89     World::getInstance().unselectMolecule(*iter);
     92    world.unselectMolecule(*iter);
     93
    9094  return ActionState::ptr(_state);
    9195}
     
    9498  SelectionMoleculeByOrderState *state = assert_cast<SelectionMoleculeByOrderState*>(_state.get());
    9599
     100  World &world = World::getInstance();
    96101  for (std::vector<const molecule *>::const_iterator iter = state->mols.begin();
    97102      iter != state->mols.end(); ++iter)
    98     World::getInstance().selectMolecule(*iter);
     103    world.selectMolecule(*iter);
    99104  return ActionState::ptr(_state);
    100105}
Note: See TracChangeset for help on using the changeset viewer.