Пример #1
0
        private int GetTotalDistance(GTActiveStreetLight objSL)
        {
            int iTotalDistance = 0;

            try
            {
                int icounter = 0;
                for (int i = 0; i < objSL.GeometrySource.Count; i++)
                {
                    if (icounter == objSL.GeometrySource.Count - 1)
                    {
                        break;
                    }

                    CommandUtilities.LogDistanceCalculationPoints(icounter, objSL, oDiag);
                    iTotalDistance = iTotalDistance + CommandUtilities.GetDistance(objSL.GeometrySource[i].OGG_X1, objSL.GeometrySource[i].OGG_Y1, objSL.GeometrySource[i].OGG_Z1,
                                                                                   objSL.GeometrySource[i + 1].OGG_X1, objSL.GeometrySource[i + 1].OGG_Y1, objSL.GeometrySource[i + 1].OGG_Z1, oDiag);

                    icounter += 1;
                }
            }
            catch (Exception ex)
            {
                CommandUtilities.LogException(oDiag, "GetTotalDistance", ex);
                throw ex;
            }

            return(iTotalDistance);
        }