This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.openscience.cdk.tools; | |
import javax.vecmath.Point3d; | |
import javax.vecmath.Vector3d; | |
import org.openscience.cdk.interfaces.IAtom; | |
/** | |
* Methods 'borrowed' (stolen) from Jmol to determine or check the stereo | |
* class of a set of atoms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
/** | |
* General permutation generator, that uses orderly generation by ranking and | |
* unranking. The basic idea is that all permutations of length N can be ordered | |
* (lexicographically) like: | |
* <pre> | |
* 0 [0, 1, 2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
import org.openscience.cdk.Atom; | |
import org.openscience.cdk.Molecule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import org.openscience.cdk.Atom; | |
import org.openscience.cdk.AtomContainer; | |
import org.openscience.cdk.CDKConstants; | |
import org.openscience.cdk.interfaces.IAtomContainer; | |
import org.openscience.cdk.interfaces.IBond; | |
import signature.chemistry.MoleculeSignature; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openscience.cdk.CDKConstants; | |
import org.openscience.cdk.interfaces.IAtom; | |
import org.openscience.cdk.interfaces.IAtomContainer; | |
import org.openscience.cdk.interfaces.IBond; | |
import signature.chemistry.Molecule.BondOrder; | |
/** | |
* Adapts a CDK IAtomContainer class to a signature.chemistry.Molecule class, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.ArrayList; | |
import java.util.List; | |
import tmp.IGenerator; | |
import tmp.Model; | |
import tmp.MyGenerator; | |
import static tmp.MyGenerator.BOND_DISTANCE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tmp; | |
public class MyGenerator extends BaseGenerator { | |
public static final String BOND_DISTANCE = "BondDistance"; | |
public MyGenerator() { | |
super.register(BOND_DISTANCE, Double.class, 5.0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tmp; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
public class BaseGenerator implements IGenerator { | |
public Map<String, Class> parameterTypes; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tmp; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
public class Model { | |
public Map<String, Class> parameterTypes; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IChemObjectBuilder builder = | |
NoNotificationChemObjectBuilder.getInstance(); | |
public IMolecule makeCHXFragment(int hCount) { | |
IMolecule mol = builder.newMolecule(); | |
mol.addAtom(builder.newAtom("C")); | |
mol.getAtom(0).setHydrogenCount(hCount); | |
return mol; | |
} | |