コード例 #1
0
ファイル: TetrahedralStereo.cs プロジェクト: roddickchen/NCDK
        public static TetrahedralStereo ToStereo(this StereoConfigurations configure)
        {
            switch (configure)
            {
            case StereoConfigurations.Left:
                return(AntiClockwise);

            case StereoConfigurations.Right:
                return(Clockwise);

            default:
                throw new System.ArgumentException("Cannot map to enum value: " + configure);
            }
        }
コード例 #2
0
        /// <summary>
        /// Access the parity (odd/even) parity of the double bond configuration (together/opposite).
        /// </summary>
        /// <param name="config">double bond element</param>
        /// <returns>together = -1, opposite = +1</returns>
        private static int Parity(StereoConfigurations config)
        {
            switch (config)
            {
            case StereoConfigurations.Together:
                return(-1);

            case StereoConfigurations.Opposite:
                return(+1);

            default:
                return(0);
            }
        }
コード例 #3
0
        public static DoubleBondConformation ToConformation(this StereoConfigurations configure)
        {
            switch (configure)
            {
            case StereoConfigurations.Unset:
                return(DoubleBondConformation.Unset);

            case StereoConfigurations.Together:
                return(DoubleBondConformation.Together);

            case StereoConfigurations.Opposite:
                return(DoubleBondConformation.Opposite);

            default:
                throw new ArgumentException($"Cannot map enum to config: {configure}");
            }
        }
コード例 #4
0
 public ExtendedCisTrans(IBond focus, IReadOnlyList <IBond> peripherals, StereoConfigurations config)
     : base(focus, peripherals, new StereoElement(StereoClass.Cumulene, config))
 {
 }
コード例 #5
0
 public ExtendedTetrahedral(IAtom focus, IEnumerable <IAtom> peripherals, StereoConfigurations configure)
     : base(focus, peripherals.ToReadOnlyList(), new StereoElement(StereoClass.Allenal, configure))
 {
 }
コード例 #6
0
 public DoubleBondStereochemistry(IBond stereoBond, IEnumerable <IBond> ligandBonds, StereoConfigurations configure)
     : base(stereoBond, ligandBonds.ToReadOnlyList(), new StereoElement(StereoClass.CisTrans, configure))
 {
 }
コード例 #7
0
 /// <summary>
 /// Define a new atropisomer using the focus bond and the carrier atoms.
 /// </summary>
 /// <param name="focus">the focus bond</param>
 /// <param name="carriers">the carriers</param>
 /// <param name="value">the configuration <see cref="StereoConfigurations.Left"/> or <see cref="StereoConfigurations.Right"/></param>
 public Atropisomeric(IBond focus, IEnumerable <IAtom> carriers, StereoConfigurations value)
     : base(focus, carriers.ToReadOnlyList(), new StereoElement(StereoClass.Atropisomeric, value))
 {
 }
コード例 #8
0
 public TetrahedralChirality(IAtom chiralAtom, IReadOnlyList <IAtom> ligands, StereoConfigurations configure)
     : base(chiralAtom, ligands.ToReadOnlyList(), new StereoElement(StereoClass.Tetrahedral, configure))
 {
 }
コード例 #9
0
 public static StereoConfigurations Flip(this StereoConfigurations value)
 {
     return((StereoConfigurations)((int)value ^ 0x3));
 }
コード例 #10
0
 /// <summary>
 /// The configuration order of the stereochemistry.
 /// </summary>
 public static short Order(this StereoConfigurations value)
 => (short)value;
コード例 #11
0
 public StereoElement(StereoClass cls, StereoConfigurations configure)
 {
     this.Class         = cls;
     this.Configuration = configure;
 }
コード例 #12
0
 public StereoElement(StereoConfigurations configure)
 {
     this.Class         = StereoClass.Unset;
     this.Configuration = configure;
 }
コード例 #13
0
 public StereoElement(StereoClass cls)
 {
     this.Class         = cls;
     this.Configuration = StereoConfigurations.Unset;
 }