Ejemplo n.º 1
0
 /// <summary>
 /// Rebonding using a Binary Space Partition Tree. Note, that any bonds
 /// defined will be deleted first. It assumes the unit of 3D space to
 /// be 1 Å.
 /// </summary>
 public void Rebond(IAtomContainer container)
 {
     container.Bonds.Clear();
     maxCovalentRadius = 0.0;
     // construct a new binary space partition tree
     bspt = new Bspt <ITupleAtom>(3);
     foreach (var atom in container.Atoms)
     {
         double myCovalentRadius = atom.CovalentRadius.Value;
         if (myCovalentRadius == 0.0)
         {
             throw new CDKException("Atom(s) does not have covalentRadius defined.");
         }
         if (myCovalentRadius > maxCovalentRadius)
         {
             maxCovalentRadius = myCovalentRadius;
         }
         TupleAtom tupleAtom = new TupleAtom(atom);
         bspt.AddTuple(tupleAtom);
     }
     // rebond all atoms
     foreach (var atom in container.Atoms)
     {
         BondAtom(container, atom);
     }
 }
Ejemplo n.º 2
0
 public RebondTool(double maxCovalentRadius, double minBondDistance, double bondTolerance)
 {
     this.maxCovalentRadius = maxCovalentRadius;
     this.bondTolerance     = bondTolerance;
     this.minBondDistance   = minBondDistance;
     this.bspt = null;
 }
Ejemplo n.º 3
0
 public Leaf(Bspt bspt, Leaf leaf, int countToKeep)
     : this(bspt)
 {
     for (int i = countToKeep; i < Bspt.leafCountMax; ++i)
     {
         tuples[count++] = leaf.tuples[i];
         leaf.tuples[i]  = null;
     }
     leaf.count = countToKeep;
 }
Ejemplo n.º 4
0
 public Leaf(Bspt bspt, Leaf leaf, int countToKeep)
     : this(bspt)
 {
     for (int i = countToKeep; i < Bspt.leafCountMax; ++i)
     {
         tuples[count++] = leaf.tuples[i];
         leaf.tuples[i] = null;
     }
     leaf.count = countToKeep;
 }
Ejemplo n.º 5
0
 public Leaf(Bspt bspt)
 {
     this.bspt = bspt;
     count     = 0;
     tuples    = new Tuple[Bspt.leafCountMax];
 }
Ejemplo n.º 6
0
 public SphereIterator(Bspt bspt)
 {
     this.bspt = bspt;
     centerValues = new float[bspt.dimMax];
     stack = new Element[bspt.treeDepth];
 }
Ejemplo n.º 7
0
 public Leaf(Bspt bspt)
 {
     this.bspt = bspt;
     count = 0;
     tuples = new Tuple[Bspt.leafCountMax];
 }
Ejemplo n.º 8
0
 public SphereIterator(Bspt bspt)
 {
     this.bspt    = bspt;
     centerValues = new float[bspt.dimMax];
     stack        = new Element[bspt.treeDepth];
 }