Example #1
0
        /// <summary>
        /// Sets the structure from the last 3 elements if lastElements==true and from the first 3 elements if lastElements==false. Throws an exception if the Number of elements in coordinates is less than 3.
        /// </summary>
        /// <param mainFile="coordinates"></param>
        /// <param mainFile="lastElements"></param>
        public MyPointDouble(List <string> coordinates, bool lastElements)
        {
            const int Dimension = 3;

            #region CheckOfArgument
#if DEBUG
            GeneralClass.CheckNotLess(coordinates.Count, Dimension);
#endif
            #endregion
            if (lastElements)
            {
                int Iterator = coordinates.Count;
                z = Convert.ToDouble(coordinates[Iterator - 1]);
                Iterator--;
                y = Convert.ToDouble(coordinates[Iterator - 1]);
                Iterator--;
                x = Convert.ToDouble(coordinates[Iterator - 1]);
            }
            else
            {
                int Iterator = 1;
                x = Convert.ToDouble(coordinates[Iterator - 1]);
                Iterator++;
                y = Convert.ToDouble(coordinates[Iterator - 1]);
                Iterator++;
                z = Convert.ToDouble(coordinates[Iterator - 1]);
            }
        }