Ignore:
Timestamp:
Apr 13, 2010, 1:22:42 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
e7ea64
Parents:
0f55b2
Message:

Prepared interface of Vector Class for transition to VectorComposites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r0f55b2 r1f591b  
    18171817                    first = second;
    18181818                    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 ...
    18201820                      mol->RemoveAtom(first);
    18211821                  }
     
    20962096                    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
    20972097                    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 further
     2098                      x += y; // per factor one cell width further
    20992099                      for (int k=count;k--;) { // go through every atom of the original cell
    21002100                        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;
    21032102                        first->type = Elements[k];  // insert original element
    21042103                        mol->AddAtom(first);        // and add to the molecule (which increments ElementsInMolecule, AtomCount, ...)
     
    21102109                    // correct cell size
    21112110                    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;
    21152112                      mol->Translate(&x);
    21162113                    }
Note: See TracChangeset for help on using the changeset viewer.