Beispiel #1
0
        private bool createBondsWithRebondTool(IBioPolymer pol)
        {
            RebondTool tool = new RebondTool(2.0, 0.5, 0.5);

            try
            {
                //			 configure atoms
                AtomTypeFactory factory = AtomTypeFactory.getInstance("jmol_atomtypes.txt", pol.Builder);
                IAtom[]         atoms   = pol.Atoms;
                for (int i = 0; i < atoms.Length; i++)
                {
                    try
                    {
                        IAtomType[] types = factory.getAtomTypes(atoms[i].Symbol);
                        if (types.Length > 0)
                        {
                            // just pick the first one
                            AtomTypeManipulator.configure(atoms[i], types[0]);
                        }
                        else
                        {
                            System.Console.Out.WriteLine("Could not configure atom with symbol: " + atoms[i].Symbol);
                        }
                    }
                    catch (System.Exception e)
                    {
                        //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                        System.Console.Out.WriteLine("Could not configure atom (but don't care): " + e.Message);
                        //logger.debug(e);
                    }
                }
                tool.rebond(pol);
            }
            catch (System.Exception e)
            {
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                //logger.error("Could not rebond the polymer: " + e.Message);
                //logger.debug(e);
            }
            return(true);
        }