Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/WorldAction/CenterOnEdgeAction.cpp

    r952f38 rbcf653  
     1/*
     2 * Project: MoleCuilder
     3 * Description: creates and alters molecular systems
     4 * Copyright (C)  2010 University of Bonn. All rights reserved.
     5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
     6 */
     7
    18/*
    29 * CenterOnEdgeAction.cpp
     
    512 *      Author: heber
    613 */
     14
     15// include config.h
     16#ifdef HAVE_CONFIG_H
     17#include <config.h>
     18#endif
    719
    820#include "Helpers/MemDebug.hpp"
     
    5567  ASSERT(AllAtoms.size() > 0, "For CenteronEdge atoms must be present.");
    5668  vector<atom *>::iterator AtomRunner = AllAtoms.begin();
    57   Min = (*AtomRunner)->x;
    58   Max = (*AtomRunner)->x;
     69  Min = (*AtomRunner)->getPosition();
     70  Max = (*AtomRunner)->getPosition();
    5971  for (; AtomRunner != AllAtoms.end(); ++AtomRunner) {
    6072    for (int i=0;i<NDIM;i++) {
    61       if ((*AtomRunner)->x[i] > Max[i])
    62         Max[i] = (*AtomRunner)->x[i];
    63       if ((*AtomRunner)->x[i] < Min[i])
    64         Min[i] = (*AtomRunner)->x[i];
     73      if ((*AtomRunner)->at(i) > Max[i])
     74        Max[i] = (*AtomRunner)->at(i);
     75      if ((*AtomRunner)->at(i) < Min[i])
     76        Min[i] = (*AtomRunner)->at(i);
    6577    }
    6678  }
     
    7587  // translate all atoms, such that Min is aty (0,0,0)
    7688  for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner)
    77     (*AtomRunner)->x -= Min;
     89    *(*AtomRunner) -= Min;
    7890
    7991  return Action::success;
Note: See TracChangeset for help on using the changeset viewer.