Esempio n. 1
0
        /// <summary>
        /// Classifica o Monomero por Monomero, incluindo E se Ends, K se Kink e C se CrankShaft na propriedade classificationMotion do Point
        /// </summary>
        public static void PreClassificationOfMotion()
        {
            for (int i = 0; i < GCPS.chain.r.Count; i++)
            {
                Structs.BasicStructs.Point actualPoint = GCPS.chain.r[i];

                //Verifica se é END
                actualPoint.classificationMotion.ends = Ends.IsEnds(i);

                //Verifica se é KINK
                actualPoint.classificationMotion.kink = Kink.IsKink(i);


                //Verifica se é CRANKSHAFT
                actualPoint.classificationMotion.crankShaft__R0 = CrankShaft.IsCrankShaftLeft(i);
                actualPoint.classificationMotion.crankShaft__R1 = CrankShaft.IsCrankShaftLeftCenter(i);
                actualPoint.classificationMotion.crankShaft__R2 = CrankShaft.IsCrankShaftRightCenter(i);
                actualPoint.classificationMotion.crankShaft__R3 = CrankShaft.IsCrankShaftRight(i);

                //stretched
                actualPoint.classificationMotion.stretched = Straight.IsStraight(i);

                GCPS.chain.r[i] = actualPoint;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Verifica se existe movimento de Kink
        /// </summary>
        /// <param name="index">Monomero atual</param>
        /// <returns>True de existir</returns>
        public static bool IsKink(int index)
        {
            try
            {
                int len   = (GCPS.chain.r.Count) - 1;
                int idx01 = index - 1;
                int idx02 = index + 1;

                if ((idx01 < 0 || idx02 < 0) || (idx01 > len || idx02 > len))
                {
                    return(false);
                }

                Structs.BasicStructs.Point previousPos  = GCPS.chain.r[idx01];
                Structs.BasicStructs.Point actualPos    = GCPS.chain.r[index];
                Structs.BasicStructs.Point posteriorPos = GCPS.chain.r[idx02];

                return(Kink.ExistKick(previousPos, actualPos, posteriorPos));
            }
            catch (System.ArgumentOutOfRangeException ex)
            {
                new GridProteinFolding.Middle.Helpers.LoggingHelpers.Log().ArgumentOutOfRangeException(ex, Types.ErrorLevel.Warning, true);
                return(false);
            }
        }