コード例 #1
0
        public void DeselectAll()
        {
            this.SelectedPoint = new GISMapPoint();
            GISMapPoint Dummy = new GISMapPoint();

            UpdateColors(Dummy.pointrect);
        }
コード例 #2
0
        /*
         * 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;
                    }
                }
            }
        }
コード例 #3
0
        //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);
            }
        }
コード例 #4
0
 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);
         }
     }
 }
コード例 #5
0
        /*
         * 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);
        }