Package org.jmol.modelset

Examples of org.jmol.modelset.Atom


 
  void findNearestAtomIndex(int x, int y, Atom[] closest,
                            short madBegin, short madEnd) {
   
    Atom competitor = closest[0];
    Atom nitrogen = getNitrogenAtom();
    short marBegin = (short) (madBegin / 2);
    if (marBegin < 1200)
      marBegin = 1200;
    if (nitrogen.screenZ == 0)
      return;
    int radiusBegin = scaleToScreen(nitrogen.screenZ, marBegin);
    if (radiusBegin < 4)
      radiusBegin = 4;
    Atom ccarbon = getCarbonylCarbonAtom();
    short marEnd = (short) (madEnd / 2);
    if (marEnd < 1200)
      marEnd = 1200;
    int radiusEnd = scaleToScreen(nitrogen.screenZ, marEnd);
    if (radiusEnd < 4)
      radiusEnd = 4;
    Atom alpha = getLeadAtom();
    if (isCursorOnTopOf(alpha, x, y, (radiusBegin + radiusEnd) / 2,
        competitor)
        || isCursorOnTopOf(nitrogen, x, y, radiusBegin, competitor)
        || isCursorOnTopOf(ccarbon, x, y, radiusEnd, competitor))
      closest[0] = alpha;
View Full Code Here


    }
    return nitrogenHydrogenPoint;
  }
 
  Point3f getExplicitNH() {
    Atom nitrogen = getNitrogenAtom();
    Atom h = null;
    Bond[] bonds = nitrogen.getBonds();
    if (bonds == null)
      return null;
    for (int i = 0; i < bonds.length; i++)
      if ((h = bonds[i].getOtherAtom(nitrogen)).getElementNumber() == 1)
View Full Code Here

  public boolean getNHPoint(Point3f aminoHydrogenPoint, Vector3f vNH,
                            boolean jmolHPoint, boolean dsspIgnoreHydrogens) {
    if (monomerIndex == 0 || groupID == JmolConstants.GROUPID_PROLINE)
      return false;
    Atom nitrogenPoint = getNitrogenAtom();
    Point3f nhPoint = getNitrogenHydrogenPoint();
    if (nhPoint != null && !dsspIgnoreHydrogens) {
      vNH.sub(nhPoint, nitrogenPoint);
      aminoHydrogenPoint.set(nhPoint);
      return true;
View Full Code Here

  }

 
  void findNearestAtomIndex(int x, int y, Atom[] closest,
                            short madBegin, short madEnd) {   
    Atom competitor = closest[0];
    Atom anomericO = getLeadAtom();
    short marBegin = (short) (madBegin / 2);
    if (marBegin < 1200)
      marBegin = 1200;
    if (anomericO.screenZ == 0)
      return;
View Full Code Here

        .getScalePixelsPerAngstrom(false) * 10000f : 0);
    setLabel(strLabel, i, isScaled, scalePixelsPerMicron);
  }
 
  private void setLabel(String strLabel, int i, boolean isScaled, float scalePixelsPerMicron) {
      Atom atom = atoms[i];
      String label = LabelToken.formatLabel(viewer, atom, strLabel);
      atom.setShapeVisibility(myVisibilityFlag, label != null);
      if (strings == null || i >= strings.length)
        strings = ArrayUtil.ensureLength(strings, i + 1);
      if (formats == null || i >= formats.length)
        formats = ArrayUtil.ensureLength(formats, i + 1);
      strings[i] = label;
View Full Code Here

  private void move2D(int pickedAtom, int x, int y) {
    if (g3d.isAntialiased()) {
      x <<= 1;
      y <<= 1;
    }
    Atom atom = atoms[pickedAtom];
    int xOffset = Object2d.getXOffset(pickedOffset);
    int yOffset = -Object2d.getYOffset(pickedOffset);
    xOffset += x - atom.screenX;
    yOffset += atom.screenY - y;
    int offset = Object2d.getOffset(xOffset, yOffset);
View Full Code Here

    boolean isAll = (bsSelected == null);
    int i0 = (isAll ? atomCount - 1 : bsSelected.nextSetBit(0));
    if (mads == null && i0 >= 0)
      mads = new short[atomCount];
    for (int i = i0; i >= 0; i = (isAll ? i - 1 : bsSelected.nextSetBit(i + 1))) {
      Atom atom = atoms[i];
      mads[i] = atom.calculateMad(viewer, rd);
//      System.out.println("atomSHape " + atom + " mad=" + mads[i]);
      bsSizeSet.set(i, isVisible);
      atom.setShapeVisibility(myVisibilityFlag, isVisible);
    }
  }
View Full Code Here

  public void setModelClickability() {
    if (!isActive)
      return;
    for (int i = atomCount; --i >= 0;) {
      Atom atom = atoms[i];
      if ((atom.getShapeVisibilityFlags() & myVisibilityFlag) == 0
          || modelSet.isAtomHidden(i))
        continue;
      atom.setClickable(myVisibilityFlag);
    }
  }
View Full Code Here

          }
        }
      }
    }
    for (int i = bsOK.nextSetBit(0); i >= 0; i = bsOK.nextSetBit(i + 1)) {
      Atom atom = atoms[i];
      if (firstPass && slabbing) {
        if (g3d.isClippedZ(atom.screenZ
            - (slabByAtom ? atoms[i].screenDiameter >> 1 : 0))) {
          atom.setClickable(0);
          // note that in the case of navigation,
          // maxZ is set to Integer.MAX_VALUE.
          int r = (slabByAtom ? -1 : 1) * atom.screenDiameter / 2;
          if (atom.screenZ + r < minZ || atom.screenZ - r > maxZ
              || !g3d.isInDisplayRange(atom.screenX, atom.screenY)) {
            bsOK.clear(i);
            continue;
          }
        }
      }
      // note: above transform is required for all other renderings

      if (renderBalls && atom.screenDiameter > 0
          && (atom.getShapeVisibilityFlags() & myVisibilityFlag) != 0
          && g3d.setColix(atom.getColix())) {
        if (renderCrosshairs) {
          if (atom.screenX < minX)
            minX = atom.screenX;
          if (atom.screenX > maxX)
            maxX = atom.screenX;
View Full Code Here

    BitSet bsNearbyResidues = new BitSet(); // [ipt]
   
    // check for a strut. We are going to set struts within 3 residues
    // of the ends of biopolymers, so we track those positions as well.
   
    Atom a1 = (Atom) vCA.get(0);
    Atom a2;
    int nBiopolymers = modelSet.getBioPolymerCountInModel(a1.modelIndex);
    int[][] biopolymerStartsEnds = new int[nBiopolymers][nEndMin * 2];
    for (int i = 0; i < n; i++) {
      a1 = (Atom) vCA.get(i);
      int polymerIndex = a1.getPolymerIndexInModel();
      int monomerIndex = a1.getMonomerIndex();
      int bpt = monomerIndex;
      if (bpt < nEndMin)
        biopolymerStartsEnds[polymerIndex][bpt] = i + 1;
      bpt = ((Monomer) a1.getGroup()).getBioPolymerLength() - monomerIndex - 1;
      if (bpt < nEndMin)
        biopolymerStartsEnds[polymerIndex][nEndMin + bpt] = i + 1;
    }

    // Get all distances.
    // For n CA positions, there will be n(n-1)/2 distances needed.
    // There is no need for a full matrix X[i][j]. Instead, we just count
    // carefully using the variable ipt:
    //
    // ipt = i * (2 * n - i - 1) / 2 + j - i - 1

    float[] d2 = new float[n * (n - 1) / 2];
    for (int i = 0; i < n; i++) {
      a1 = (Atom) vCA.get(i);
      for (int j = i + 1; j < n; j++) {
        int ipt = strutPoint(i, j, n);
        a2 = (Atom) vCA.get(j);
        int resno1 = a1.getResno();
        int polymerIndex1 = a1.getPolymerIndexInModel();
        int resno2 = a2.getResno();
        int polymerIndex2 = a2.getPolymerIndexInModel();
        if (polymerIndex1 == polymerIndex2 && Math.abs(resno2 - resno1) < delta)
          bsNearbyResidues.set(ipt);
        float d = d2[ipt] = a1.distanceSquared(a2);
        if (d >= thresh2)
          bsNotAvailable.set(ipt);
View Full Code Here

TOP

Related Classes of org.jmol.modelset.Atom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.