/// <summary> /// Обновление шкалы глубин. /// </summary> private void RefreshDepthScalePanel() { DrawingObjects.DepthScale depthScale = new DrawingObjects.DepthScale(_graphicMap.MaxDepth); double[] depths = depthScale.GetDepthScale(); if (depths.Length != 0) { LabelDScale0.Content = "0"; LabelDScale1.Content = depths[0]; LabelDScale2.Content = depths[1]; LabelDScale3.Content = depths[2]; LabelDScale4.Content = depths[3]; LabelDScale5.Content = depths[4]; LabelDScale6.Content = depths[5]; LabelDScale7.Content = depths[6]; LabelDScale8.Content = "глубже"; } }
/// <summary> /// Конвертация регулярной матрицы в карту для отрисовки. /// </summary> /// <param name="regMatrix">Регулярная матрица Model.</param> /// <param name="longitude">Долгота.</param> /// <param name="scale">Масштаб карты (1 : scale).</param> /// <param name="name">Имя карты.</param> /// <param name="latitude">Широта.</param> /// <returns>Карта для отрисовки.</returns> public static GraphicMap ToGraphicMap(RegMatrix regMatrix, string name, string latitude, string longitude, long scale) { GraphicMap graphicMap = new GraphicMap { Name = name, Latitude = latitude, Longitude = longitude, Scale = scale, Width = regMatrix.Width, Length = regMatrix.Length, MaxDepth = regMatrix.MaxDepth, Points = new Point3DColor[regMatrix.Points.Length], WidthEdgeOfMap = regMatrix.Step / 4, WidthEndOfLine = regMatrix.Step / 8, PointSize = 8.0f }; DrawingObjects.DepthScale depthScale = new DrawingObjects.DepthScale(graphicMap.MaxDepth); int countSourcePoints = 0; for (int i = 0; i < regMatrix.Length; ++i) { for (int j = 0; j < regMatrix.Width; ++j) { var point = regMatrix.Points[i * regMatrix.Width + j]; graphicMap.Points[i * regMatrix.Width + j] = new Point3DColor { IsSource = point.IsSource, X = regMatrix.Step * j, Y = regMatrix.Step * i, Depth = point.Depth, Color = depthScale.GetColorDepth(point.Depth) }; countSourcePoints = point.IsSource ? countSourcePoints + 1 : countSourcePoints; } } graphicMap.CountSourcePoints = countSourcePoints; return(graphicMap); }