Changeset 1f591b for molecuilder/src/builder.cpp
- Timestamp:
- Apr 13, 2010, 1:22:42 PM (15 years ago)
- Children:
- e7ea64
- Parents:
- 0f55b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r0f55b2 r1f591b 1817 1817 first = second; 1818 1818 second = first->next; 1819 if (first->x.DistanceSquared( (const Vector *)&third->x) > tmp1*tmp1) // distance to first above radius ...1819 if (first->x.DistanceSquared(third->x) > tmp1*tmp1) // distance to first above radius ... 1820 1820 mol->RemoveAtom(first); 1821 1821 } … … 2096 2096 y[abs(axis)-1] = mol->cell_size[(abs(axis) == 2) ? 2 : ((abs(axis) == 3) ? 5 : 0)] * abs(axis)/axis; // last term is for sign, first is for magnitude 2097 2097 for (int i=1;i<faktor;i++) { // then add this list with respective translation factor times 2098 x .AddVector(&y); // per factor one cell width further2098 x += y; // per factor one cell width further 2099 2099 for (int k=count;k--;) { // go through every atom of the original cell 2100 2100 first = World::getInstance().createAtom(); // create a new body 2101 first->x.CopyVector(vectors[k]); // use coordinate of original atom 2102 first->x.AddVector(&x); // translate the coordinates 2101 first->x = (*vectors[k]) + x; 2103 2102 first->type = Elements[k]; // insert original element 2104 2103 mol->AddAtom(first); // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...) … … 2110 2109 // correct cell size 2111 2110 if (axis < 0) { // if sign was negative, we have to translate everything 2112 x.Zero(); 2113 x.AddVector(&y); 2114 x.Scale(-(faktor-1)); 2111 x =(-(faktor-1)) * y; 2115 2112 mol->Translate(&x); 2116 2113 }
Note:
See TracChangeset
for help on using the changeset viewer.