Logo Search packages:      
Sourcecode: wims version File versions  Download package

int XYZLatModel::addVert ( String  name,
float  x,
float  y,
float  z 
) [inline, package]

Add a vertex to this model

Definition at line 252 of file LatticeViewer.java.

Referenced by XYZLatModel().

                                                        {
      int i = nvert;
      if (i >= maxvert)
          if (vert == null) {
            maxvert = 100;
            vert = new float[maxvert * 3];
            atoms = new ScaleableAtom[maxvert];
          } else {
            maxvert *= 2;
            float nv[] = new float[maxvert * 3];
            System.arraycopy(vert, 0, nv, 0, vert.length);
            vert = nv;
            ScaleableAtom na[] = new ScaleableAtom[maxvert];
            System.arraycopy(atoms, 0, na, 0, atoms.length);
            atoms = na;
          }
      ScaleableAtom a = (ScaleableAtom) atomTable.get(name.toLowerCase());
      if (a == null) a = defaultAtom;
      atoms[i] = a;
      i *= 3;
      vert[i] = x;
      vert[i + 1] = y;
      vert[i + 2] = z;
      return nvert++;
    }


Generated by  Doxygen 1.6.0   Back to index