public PolygonPropertyForm(GeoDisplayPolygonRegion dispPolygonRegion, IGeoSelectionHelper helper, GeoUserVectorData userShapes, GeoCoordinateOfMouse GeoCoordinateOfMouse, CoordinateDisplayStyle style) { this.m_CurrentDisplayRegion = dispPolygonRegion; this.m_Helper = helper; this.m_BaseData = userShapes; this.m_RegionList = this.m_BaseData.GetAllPolygons(); this.SetPropertyDisplayStyle(GeoCoordinateOfMouse, style); this.InitializeComponent(); this.Initial(); }
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 ReadPolygon(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; GeoPolygon geoPolygon = new GeoPolygon(); 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]) { geoPolygon.Points.Add(point); } else { GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); GeoDisplayPolygonRegion region2 = new GeoDisplayPolygonRegion(region, this.m_DefaultPolygonStyle); index++; } } else { geoPolygon.Points.Add(point); } } GeoPolygonRegion region3 = new GeoPolygonRegion(); region3.AddGeoPolygon(geoPolygon); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region3, this.m_DefaultPolygonStyle); item.AddFeature("ID", this.CreateMapUnitId()); this.m_RegionList.Add(item); }
private void ReadRegion(string[] contents) { int num = int.Parse(contents[1]); int num2 = 0; GeoPolygonRegion region = new GeoPolygonRegion(); while (num2 < num) { GeoPolygon geoPolygon = new GeoPolygon(); int num3 = int.Parse(this.ReadValidLine()); int num4 = 0; string[] strArray = null; string[] separator = new string[] { " ", "\t" }; while (num4 < num3) { num4++; strArray = this.ReadValidLine().Split(separator, StringSplitOptions.RemoveEmptyEntries); double x = double.Parse(strArray[0]); double y = double.Parse(strArray[1]); geoPolygon.Points.Add(new GeoXYPoint(x, y)); } num2++; num2++; region.AddGeoPolygon(geoPolygon); } BrushStyle brushStyle = null; PenStyle penStyle = null; this.BuildStyle(ref penStyle, ref brushStyle); GeoPolygonStyle style = this.BuildPolygonStyle(brushStyle, penStyle); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region, style); this.m_RegionList.Add(item); }
private void ReadRectangle(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]); GeoPolygon geoPolygon = new GeoPolygon(); geoPolygon.Points.Add(new GeoXYPoint(x, y)); geoPolygon.Points.Add(new GeoXYPoint(num3, y)); geoPolygon.Points.Add(new GeoXYPoint(num3, num4)); geoPolygon.Points.Add(new GeoXYPoint(x, num4)); GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); try { BrushStyle brushStyle = null; PenStyle penStyle = null; this.BuildStyle(ref penStyle, ref brushStyle); GeoPolygonStyle style = this.BuildPolygonStyle(brushStyle, penStyle); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region, style); this.m_RegionList.Add(item); } catch { } }