public void DeselectAll() { this.SelectedPoint = new GISMapPoint(); GISMapPoint Dummy = new GISMapPoint(); UpdateColors(Dummy.pointrect); }
/* * this was used to take the Points from the SelectedPolygon and say that that are indeed connected to the SelectedPolygon, and nothing else. * it also is suppose to allow you to move a selected point if that point is connected to the polygon. */ internal static void FindPoint(GISMapPoint SelectedPoint, SurfaceWindow1 mapwindow) { foreach (GISMapPolygon Polygon in mapwindow.MapPolygons) { foreach (GISMapPoint GMPoint in mapwindow.MapPolygons) { if (SelectedPoint.Equals(GMPoint)) { MovePoint(GMPoint, Polygon, SelectedPoint, mapwindow); break; } } } }
//used for plotting the points for drawing a polygon. public void AddPoint(Location MapPointLocation, SurfaceWindow1 mapwindow) { if (AddPolyPoint) { GISMapPoint GMPoint = new GISMapPoint(); GMPoint.PointLocation = MapPointLocation; mapwindow.PolyPointLayer.AddChild(GMPoint.pointrect, MapPointLocation); MapPoints.Add(GMPoint); GMPoint.pointrect.TouchDown += new EventHandler <TouchEventArgs>(Point_TouchDown); } if (SelectedPoint != null) { GISMapPolygon.FindPoint(SelectedPoint, mapwindow); } }
public void UpdateColors(Rectangle pointrect) { for (int i = 0; i < MapPoints.Count; i++) { GISMapPoint test = MapPoints[i] as GISMapPoint; if (pointrect.Equals(test.pointrect) && pointrect != null) { test.pointrect.Stroke = new SolidColorBrush(Colors.Wheat); test.pointrect.Fill = new SolidColorBrush(Colors.Blue); } else // not the selected polygon... reset it's color { test.pointrect.Stroke = new SolidColorBrush(Colors.Gold); test.pointrect.Fill = new SolidColorBrush(Colors.Maroon); } } }
/* * this is where we tried to make it so that a selected point is able to be moved. but we only want the points that are connected to a SelectedPolygon to move * which leads us to the commented out methods and errors in the Polygon_TouchDown part and the AddPoint part. */ internal static void MovePoint(GISMapPoint GMPoint, GISMapPolygon Polygon, GISMapPoint SelectedPoint, SurfaceWindow1 mapwindow) { GMPoint.PointLocation = SelectedPoint.PointLocation; Polygon.AddPolygon(mapwindow); }