Ejemplo n.º 1
0
        // modify the Z value of [index] and
        // update the value of all subsequent Z values
        // by maintaining the original delta
        private bool AdjustZ(int index, double deltaZ)
        {
            if (index > Tpts3.IndexOfEndPoint ||
                index < 1 ||
                double.IsNaN(deltaZ))
            {
                return(false);
            }

            Tpts3.BatchBegin();

            // change the Z value of the indexed point
            // based on the Z value of the prior point
            // plus the new delta
            Tpts3[index].Z = Tpts3[index - 1].Z + deltaZ;

            // update the Z value of all subsequent points
            // based on the Z value of the prior point
            // plus the original delta
            for (int i = ++index; i < Tpts3.Count; i++)
            {
                Tpts3[i].Z = Tpts3[i - 1].Z + Tpts3[i].ZΔ;
            }

            Tpts3.BatchFinalize();

            return(true);
        }
Ejemplo n.º 2
0
        public void BtnBatchAddAmtToYfrom3On_Click()
        {
            if (!Tpts3Mgr.DataLoaded)
            {
                DataNotLoaded();
                return;
            }

            int seed = 2;

            Tpts3.Append = "\n*** run test: batch Add Amt to [3+]Y ***\n";

            Tpts3.BatchBegin();

            for (int i = 3; i < Tpts3.Count; i++)
            {
                seed = (i * 3) + seed;

                Tpts3[i].Y += seed;
            }

            Tpts3.BatchFinalize();

            Tpts3.Append = "\n*** run test: Complete ***\n\n";
        }
        public void BatchIncreaseEachXyxByAmount(int startIdx, string which, double amount)
        {
            if (startIdx > Tpts3.IndexOfEndPoint || startIdx < 1 ||
                double.IsNaN(amount)
                )
            {
                return;
            }

            Tpts3.BatchBegin();

            for (int i = startIdx; i < Tpts3.Count; i++)
            {
                Tpts3[i][which] += amount;
            }

            Tpts3.BatchFinalize();
        }