/// <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); } }
public RebondTool(double maxCovalentRadius, double minBondDistance, double bondTolerance) { this.maxCovalentRadius = maxCovalentRadius; this.bondTolerance = bondTolerance; this.minBondDistance = minBondDistance; this.bspt = null; }
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; }
public Leaf(Bspt bspt) { this.bspt = bspt; count = 0; tuples = new Tuple[Bspt.leafCountMax]; }
public SphereIterator(Bspt bspt) { this.bspt = bspt; centerValues = new float[bspt.dimMax]; stack = new Element[bspt.treeDepth]; }