当前位置: 首页>>代码示例>>C#>>正文


C# IAtomContainer.getElectronContainerAt方法代码示例

本文整理汇总了C#中IAtomContainer.getElectronContainerAt方法的典型用法代码示例。如果您正苦于以下问题:C# IAtomContainer.getElectronContainerAt方法的具体用法?C# IAtomContainer.getElectronContainerAt怎么用?C# IAtomContainer.getElectronContainerAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAtomContainer的用法示例。


在下文中一共展示了IAtomContainer.getElectronContainerAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getMatrix

 /// <summary> Returns the adjacency matrix for the given AtomContainer.
 /// 
 /// </summary>
 /// <param name="container">The AtomContainer for which the matrix is calculated
 /// </param>
 /// <returns>           A adjacency matrix representating this AtomContainer
 /// </returns>
 public static int[][] getMatrix(IAtomContainer container)
 {
     IElectronContainer electronContainer = null;
     int indexAtom1;
     int indexAtom2;
     int[][] conMat = new int[container.AtomCount][];
     for (int i = 0; i < container.AtomCount; i++)
     {
         conMat[i] = new int[container.AtomCount];
     }
     for (int f = 0; f < container.ElectronContainerCount; f++)
     {
         electronContainer = container.getElectronContainerAt(f);
         if (electronContainer is IBond)
         {
             IBond bond = (IBond)electronContainer;
             indexAtom1 = container.getAtomNumber(bond.getAtomAt(0));
             indexAtom2 = container.getAtomNumber(bond.getAtomAt(1));
             conMat[indexAtom1][indexAtom2] = 1;
             conMat[indexAtom2][indexAtom1] = 1;
         }
     }
     return conMat;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:31,代码来源:AdjacencyMatrix.cs

示例2: detectAromaticity

        /// <summary>  Uses precomputed set of ALL rings and performs an aromaticity detection
        /// based on Hueckels 4n + 2 rule.
        /// 
        /// </summary>
        /// <param name="ringSet">                set of ALL rings
        /// </param>
        /// <param name="removeAromaticityFlags"> Leaves ChemObjects that are already marked as
        /// aromatic as they are
        /// </param>
        /// <param name="atomContainer">          AtomContainer to be searched for rings
        /// </param>
        /// <returns>                         True, if molecules contains an
        /// aromatic feature
        /// </returns>
        public static bool detectAromaticity(IAtomContainer atomContainer, IRingSet ringSet, bool removeAromaticityFlags)
        {
            bool foundSomething = false;
            if (removeAromaticityFlags)
            {
                for (int f = 0; f < atomContainer.AtomCount; f++)
                {
                    atomContainer.getAtomAt(f).setFlag(CDKConstants.ISAROMATIC, false);
                }
                for (int f = 0; f < atomContainer.ElectronContainerCount; f++)
                {
                    IElectronContainer electronContainer = atomContainer.getElectronContainerAt(f);
                    if (electronContainer is IBond)
                    {
                        electronContainer.setFlag(CDKConstants.ISAROMATIC, false);
                    }
                }
                for (int f = 0; f < ringSet.AtomContainerCount; f++)
                {
                    ((IRing)ringSet.getAtomContainer(f)).setFlag(CDKConstants.ISAROMATIC, false);
                }
            }

            IRing ring = null;
            RingSetManipulator.sort(ringSet);
            for (int f = 0; f < ringSet.AtomContainerCount; f++)
            {
                ring = (IRing)ringSet.getAtomContainer(f);
                //logger.debug("Testing for aromaticity in ring no ", f);
                if (AromaticityCalculator.isAromatic(ring, atomContainer))
                {
                    ring.setFlag(CDKConstants.ISAROMATIC, true);

                    for (int g = 0; g < ring.AtomCount; g++)
                    {
                        ring.getAtomAt(g).setFlag(CDKConstants.ISAROMATIC, true);
                    }

                    for (int g = 0; g < ring.ElectronContainerCount; g++)
                    {
                        IElectronContainer electronContainer = ring.getElectronContainerAt(g);
                        if (electronContainer is IBond)
                        {
                            electronContainer.setFlag(CDKConstants.ISAROMATIC, true);
                        }
                    }

                    foundSomething = true;
                    //logger.debug("This ring is aromatic: ", f);
                }
                else
                {
                    //logger.debug("This ring is *not* aromatic: ", f);
                }
            }
            return foundSomething;
        }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:71,代码来源:HueckelAromaticityDetector.cs

示例3: resetFlags

 public static void resetFlags(IAtomContainer ac)
 {
     for (int f = 0; f < ac.AtomCount; f++)
     {
         ac.getAtomAt(f).setFlag(CDKConstants.VISITED, false);
     }
     for (int f = 0; f < ac.ElectronContainerCount; f++)
     {
         ac.getElectronContainerAt(f).setFlag(CDKConstants.VISITED, false);
     }
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:11,代码来源:SpanningTree.cs

示例4: unregisterElectronContainerListeners

 /// <summary>  A method to remove ElectronContainerListeners. 
 /// ElectronContainerListeners are used to detect changes 
 /// in ElectronContainers (like bonds) and to notifiy
 /// registered Listeners in the event of a change.
 /// If an object looses interest in such changes, it should 
 /// unregister with this AtomContainer in order to improve 
 /// performance of this class.
 /// </summary>
 public static void unregisterElectronContainerListeners(IAtomContainer container)
 {
     for (int f = 0; f < container.ElectronContainerCount; f++)
     {
         container.getElectronContainerAt(f).removeListener(container);
     }
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:15,代码来源:AtomContainerManipulator.cs


注:本文中的IAtomContainer.getElectronContainerAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。