- 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 1 8 /* 2 9 * CenterOnEdgeAction.cpp … … 5 12 * Author: heber 6 13 */ 14 15 // include config.h 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 7 19 8 20 #include "Helpers/MemDebug.hpp" … … 55 67 ASSERT(AllAtoms.size() > 0, "For CenteronEdge atoms must be present."); 56 68 vector<atom *>::iterator AtomRunner = AllAtoms.begin(); 57 Min = (*AtomRunner)-> x;58 Max = (*AtomRunner)-> x;69 Min = (*AtomRunner)->getPosition(); 70 Max = (*AtomRunner)->getPosition(); 59 71 for (; AtomRunner != AllAtoms.end(); ++AtomRunner) { 60 72 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); 65 77 } 66 78 } … … 75 87 // translate all atoms, such that Min is aty (0,0,0) 76 88 for (vector<atom*>::iterator AtomRunner = AllAtoms.begin(); AtomRunner != AllAtoms.end(); ++AtomRunner) 77 (*AtomRunner)->x-= Min;89 *(*AtomRunner) -= Min; 78 90 79 91 return Action::success;
Note:
See TracChangeset
for help on using the changeset viewer.