public void AddVectors(Dictionary<GeoXYPoint, GeoPointStyle> points, Dictionary<GeoXYLine, GeoLineStyle> lines, Dictionary<GeoPolygonRegion, GeoPolygonStyle> polygons) { if (points != null) { foreach (KeyValuePair<GeoXYPoint, GeoPointStyle> pair in points) { GeoDisplayPoint item = new GeoDisplayPoint(pair.Key, pair.Value); this.m_PointList.Add(item); this.m_IsDataChangedWhenUpdating = true; } } if (lines != null) { foreach (KeyValuePair<GeoXYLine, GeoLineStyle> pair2 in lines) { GeoDisplayLine line = new GeoDisplayLine(pair2.Key, pair2.Value); this.m_LineList.Add(line); this.m_IsDataChangedWhenUpdating = true; } } if (polygons != null) { foreach (KeyValuePair<GeoPolygonRegion, GeoPolygonStyle> pair3 in polygons) { GeoDisplayPolygonRegion region = new GeoDisplayPolygonRegion(pair3.Key, pair3.Value); this.m_PolygonRegionList.Add(region); this.m_IsDataChangedWhenUpdating = true; } } this.RaiseDataChangedEvent(this, new EventArgs()); }
private void AddVectorLines(StreamReader sr, List<GeoDisplayLine> tmpLines, string[] delimiter) { while (!sr.EndOfStream) { GeoXYLine line = new GeoXYLine(); List<GeoXYPoint> geoPointFs = new List<GeoXYPoint>(); string curLine = sr.ReadLine(); int tmpPointsCount = this.CalcPoints(curLine); this.ReadXYPoints(tmpPointsCount, sr, delimiter, geoPointFs); line.Points = geoPointFs; if (line.PointsCount > 1) { GeoDisplayLine item = new GeoDisplayLine(line, this.m_DefaultLineStyle); item.AddFeature("PlanetVectorLineType", this.m_VectorType); tmpLines.Add(item); GeoXYRect miniEnclosingRect = line.GetMiniEnclosingRect(); this.m_VectorBound.Left = Math.Min(this.m_VectorBound.Left, miniEnclosingRect.Left); this.m_VectorBound.Right = Math.Max(this.m_VectorBound.Right, miniEnclosingRect.Right); this.m_VectorBound.Top = Math.Max(this.m_VectorBound.Top, miniEnclosingRect.Top); this.m_VectorBound.Bottom = Math.Min(this.m_VectorBound.Bottom, miniEnclosingRect.Bottom); } } }
private void ReadPolyLine(int numParts, int numPoints) { int[] numArray = new int[numParts]; for (int i = 0; i < numParts; i++) { numArray[i] = this.ReadInteger(ByteOrder.LittleEndian); } int index = 1; GeoXYLine line = new GeoXYLine(); for (int j = 0; j < numPoints; j++) { double x = this.ReadDouble(ByteOrder.LittleEndian); double y = this.ReadDouble(ByteOrder.LittleEndian); GeoXYPoint point = new GeoXYPoint(x, y); if (index < numParts) { if (j < numArray[index]) { line.Points.Add(point); } else { GeoDisplayLine line2 = new GeoDisplayLine(line, this.m_DefaultLineStyle); index++; } } else { line.Points.Add(point); } } GeoDisplayLine item = new GeoDisplayLine(line, this.m_DefaultLineStyle); item.AddFeature("ID", this.CreateMapUnitId()); this.m_PolyLineList.Add(item); }
private void ReadSingleLine(string[] contents) { double x = double.Parse(contents[1]); double y = double.Parse(contents[2]); double num3 = double.Parse(contents[3]); double num4 = double.Parse(contents[4]); GeoXYLine line = new GeoXYLine(new GeoXYPoint(x, y), new GeoXYPoint(num3, num4)); BrushStyle brushStyle = null; PenStyle penStyle = null; this.BuildStyle(ref penStyle, ref brushStyle); GeoDisplayLine item = new GeoDisplayLine(line); this.m_PolyLineList.Add(item); }
private void ReadPolyLine(int linesCount) { string[] separator = new string[] { "\t", " " }; string[] strArray2 = null; int num = 0; GeoXYLine line = new GeoXYLine(); while (num < linesCount) { strArray2 = this.ReadValidLine().Split(separator, StringSplitOptions.RemoveEmptyEntries); double x = double.Parse(strArray2[0]); double y = double.Parse(strArray2[1]); GeoXYPoint point = new GeoXYPoint(x, y); line.AddPoint(point); num++; } BrushStyle brushStyle = null; PenStyle penStyle = null; this.BuildStyle(ref penStyle, ref brushStyle); GeoLineStyle style = this.BuildLineStyle(brushStyle, penStyle); GeoDisplayLine item = new GeoDisplayLine(line, style); this.m_PolyLineList.Add(item); }