コード例 #1
0
ファイル: GraphBuilder.cs プロジェクト: roddickchen/NCDK
        /// <summary>
        /// Start building the extended geometric configuration of a set of cumulated
        /// double bonds between <paramref name="u"/> and <paramref name="v"/>.
        /// </summary>
        /// <param name="u"></param>
        /// <param name="v"></param>
        /// <returns></returns>
        public GeometricBuilder CreateExtendedGeometric(int u, int v)
        {
            var builder = new GeometricBuilder(this, u, v)
            {
                Extended = true
            };

            return(builder);
        }
コード例 #2
0
ファイル: GraphBuilder.cs プロジェクト: roddickchen/NCDK
        /// <summary>Start building the geometric configuration of the double bond '<paramref name="u"/>' / '<paramref name="v"/>'.</summary>
        public GeometricBuilder Geometric(int u, int v)
        {
            var builder = new GeometricBuilder(this, u, v)
            {
                Extended = false
            };

            return(builder);
        }
コード例 #3
0
ファイル: GraphBuilder.cs プロジェクト: roddickchen/NCDK
        // safety checks
        private void CheckGeometricBuilder(GeometricBuilder builder)
        {
            if (!g.Adjacent(builder.u, builder.X) ||
                !g.Adjacent(builder.u, builder.v) ||
                !g.Adjacent(builder.v, builder.Y))
            {
                throw new ArgumentException("cannot assign directional labels, vertices were not adjacent" +
                                            "where not adjacent - expected topology of" +
                                            " 'x-u=v-y' where x=" + builder.X
                                            + " u=" + builder.u
                                            + " v=" + builder.v
                                            + " y=" + builder.Y);
            }
            Edge db = g.CreateEdge(builder.u, builder.v);

            if (db.Bond != Bond.Double)
            {
                throw new ArgumentException("cannot assign double bond configuration to non-double bond");
            }
        }