Package org.jmol.modelset

Examples of org.jmol.modelset.Atom


    return null;
  }

  private static void addHbond(List vHBonds, Monomer donor,
                               Monomer acceptor, int iEnergy, int type, Map htTemp) {
    Atom nitrogen = ((AminoMonomer)donor).getNitrogenAtom();
    Atom oxygen = ((AminoMonomer) acceptor).getCarbonylOxygenAtom();
    if (htTemp != null) {
      String key = nitrogen.index + " " + oxygen.index;
      if (htTemp.containsKey(key))
        return;
      htTemp.put(key, Boolean.TRUE);
View Full Code Here


    Vector3f vAC = new Vector3f();
    for (int i = monomerCount; --i >= 0;) {
      NucleicMonomer myNucleotide = (NucleicMonomer) monomers[i];
      if (!myNucleotide.isPurine())
        continue;
      Atom myN3 = myNucleotide.getN3();
      boolean isInA = bsA.get(myN3.index);
      if (!isInA && !bsB.get(myN3.index))
        continue;
      Atom myN1 = myNucleotide.getN1();
      Atom myN9 = myNucleotide.getN0();
      Point4f plane = Measure.getPlaneThroughPoints(myN3, myN1, myN9, vNorm,
          vAB, vAC);
      Atom bestN3 = null;
      float minDist2 = 25;
      NucleicMonomer bestNucleotide = null;
      for (int j = other.monomerCount; --j >= 0;) {
        NucleicMonomer otherNucleotide = (NucleicMonomer) other.monomers[j];
        if (!otherNucleotide.isPyrimidine())
          continue;
        Atom otherN3 = otherNucleotide.getN3();
        if (isInA ? !bsB.get(otherN3.index) : !bsA.get(otherN3.index))
          continue;
        Atom otherN1 = otherNucleotide.getN0();
        float dist2 = myN1.distanceSquared(otherN3);
        if (dist2 < minDist2 && myN9.distanceSquared(otherN1) > 50 // not stacked
            && Math.abs(Measure.distanceToPlane(plane, otherN3)) < 1 // in plane
        ) {
          bestNucleotide = otherNucleotide;
View Full Code Here

  boolean isConnectedAfter(Monomer possiblyPreviousMonomer) {
    if (possiblyPreviousMonomer == null)
      return true;
    if (! (possiblyPreviousMonomer instanceof AlphaMonomer))
      return false;
    Atom atom1 = getLeadAtom();
    Atom atom2 = possiblyPreviousMonomer.getLeadAtom();
    return atom1.isBonded(atom2) || atom1.distance(atom2) <= 4.2f;
    // jan reichert in email to miguel on 10 May 2004 said 4.2 looked good
  }
View Full Code Here

    Bond[] bonds = modelSet.getBonds();
    for (int i = modelSet.getBondCount(); --i >= 0;) {
      Bond bond = bonds[i];
      if (bond.getShapeVisibilityFlags() == 0)
        continue;
      Atom atom1 = bond.getAtom1();
      Atom atom2 = bond.getAtom2();
      if (!atom1.isVisible(0) || !atom2.isVisible(0))
        continue;
      v.set(atom1);
      v.add(atom2);
      v.scale(0.5f);
      int d2 = coordinateInRange(x, y, v, dmin2, ptXY);
View Full Code Here

    Stars stars = (Stars) shape;
    if (stars.mads == null)
      return;
    Atom[] atoms = modelSet.atoms;
    for (int i = modelSet.getAtomCount(); --i >= 0;) {
      Atom atom = atoms[i];
      if (!atom.isVisible(myVisibilityFlag))
        continue;
      colix = Shape.getColix(stars.colixes, i, atom);
      if (!g3d.setColix(colix))
        continue;
      render1(atom, stars.mads[i]);
View Full Code Here

      bioShape.falsifyMesh();
    for (int i = monomerCount; --i >= 0;) {
      if ((monomers[i].shapeVisibilityFlags & myVisibilityFlag) == 0
          || modelSet.isAtomHidden(leadAtomIndices[i]))
        continue;
      Atom lead = modelSet.atoms[leadAtomIndices[i]];
      if (!g3d.isInDisplayRange(lead.screenX, lead.screenY))
        continue;
      bsVisible.set(i);
      haveVisible = true;
    }
View Full Code Here

public class BackboneRenderer extends BioShapeRenderer {

  protected void renderBioShape(BioShape bioShape) {
    boolean isDataFrame = viewer.isJmolDataFrame(bioShape.modelIndex);
    for (int i = bsVisible.nextSetBit(0); i >= 0; i = bsVisible.nextSetBit(i + 1)) {
      Atom atomA = modelSet.atoms[leadAtomIndices[i]];
      Atom atomB = modelSet.atoms[leadAtomIndices[i + 1]];
      if (atomA.getNBackbonesDisplayed() == 0 || atomB.getNBackbonesDisplayed() == 0
          || modelSet.isAtomHidden(atomB.getIndex()))
        continue;
      if (!isDataFrame && atomA.distance(atomB) > 10)
        continue;
      int xA = atomA.screenX, yA = atomA.screenY, zA = atomA
          .screenZ;
      int xB = atomB.screenX, yB = atomB.screenY, zB = atomB
          .screenZ;
      short colixA = Graphics3D.getColixInherited(colixes[i], atomA.getColix());
      short colixB = Graphics3D.getColixInherited(colixes[i + 1], atomB.getColix());
      mad = mads[i];
      if (mad < 0) {
        g3d.drawLine(colixA, colixB, xA, yA, zA, xB, yB, zB);
      } else {
        int width = (exportType == Graphics3D.EXPORT_CARTESIAN ? mad
View Full Code Here

      }
    case -3: // trace temperature
      {
        if (! hasBfactorRange)
          calcBfactorRange();
        Atom atom = monomers[groupIndex].getLeadAtom();
        int bfactor100 = atom.getBfactor100(); // scaled by 1000
        int scaled = bfactor100 - bfactorMin;
        if (range == 0)
          return (short)0;
        float percentile = scaled / floatRange;
        if (percentile < 0 || percentile > 1)
          Logger.error("Que ha ocurrido? " + percentile);
        return (short)((1750 * percentile) + 250);
      }
    case -4: // trace displacement
      {
        Atom atom = monomers[groupIndex].getLeadAtom();
        return // double it ... we are returning a diameter
          (short)(2 * calcMeanPositionalDisplacement(atom.getBfactor100()));
      }
    }
    Logger.error("unrecognized setMad(" + mad + ")");
    return 0;
  }
View Full Code Here

        boolean isAtom2 = bsSelected.get(index2);
        if (isAtom1 && isAtom2
            || useThisBsSelected && isAtom1
            || bondSelectionModeOr && (isAtom1 || isAtom2)) {
          bioShape.monomers[i].setShapeVisibility(myVisibilityFlag, isVisible);
          Atom atomA = modelSet.atoms[index1];
          if (rd != null) {
            if (Float.isNaN(rd.values[i]))
              continue;
            mad = (short) (rd.values[i] * 2000);
          }
          Atom atomB = modelSet.atoms[index2];
          boolean wasVisible = (bioShape.mads[i] != 0);
          if (wasVisible != isVisible) {
            atomA.addDisplayedBackbone(myVisibilityFlag, isVisible);
            atomB.addDisplayedBackbone(myVisibilityFlag, isVisible);
          }
          bioShape.mads[i] = mad;
          bioShape.bsSizeSet.set(i, isVisible);
          bioShape.bsSizeDefault.set(i, mad == -1);
        }
View Full Code Here

      return;
    for (int iShape = bioShapes.length; --iShape >= 0; ) {
      BioShape bioShape = bioShapes[iShape];
      int[] atomIndices = bioShape.bioPolymer.getLeadAtomIndices();
      for (int i = bioShape.monomerCount; --i >= 0; ) {
        Atom atom = modelSet.atoms[atomIndices[i]];
        if (atom.getNBackbonesDisplayed() > 0 && !modelSet.isAtomHidden(i))
          atom.setClickable(myVisibilityFlag);
      }
    }
  } 
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.