public void AddPolygon(SurfaceWindow1 mapwindow)
        {
            MapPolygon NewPolygon = new MapPolygon();

            NewPolygon.Locations = new LocationCollection();
            //NewPolygon.Locations = GMPoint.PointsList;
            ConvertPointLocations(NewPolygon, GMPoint.MapPoints);

            NewPolygon.Fill = new SolidColorBrush(Colors.Maroon);
            NewPolygon.Stroke = new SolidColorBrush(Colors.Gold);
            NewPolygon.StrokeThickness = 2;
            NewPolygon.Opacity = 0.8;
            mapwindow.PolygonLayer.Children.Add(NewPolygon);

            MapPolygons.Add(NewPolygon);
            NewPolygon.Name = "MapPoly" + MapPolygons.Count.ToString();
            NewPolygon.TouchDown += new EventHandler<TouchEventArgs>(Polygon_TouchDown);
            /*
             * this is where we are trying to make it so that we can pass in SurfaceWindow1 so that we can make the selected Polygon show the points it is made from.
             * right now the polygon is drawn from plotted points, then the points are erased, since they no longer have a purpose to be there.
             * see if statement inside Polygon_TouchDown Method for more detail
             * until this error is fixed the Polygon_Touchdown methods does nothing so the user can NOT select a polygon.
             */
            //NewPolygon.TouchDown += new EventHandler(void Polygon_TouchDown(mapwindow, this, ));
            GMPoint.MapPoints = new ArrayList();
        }
示例#2
0
        public void AddPolygon(SurfaceWindow1 mapwindow)
        {
            MapPolygon NewPolygon = new MapPolygon();

            NewPolygon.Locations = new LocationCollection();
            //NewPolygon.Locations = GMPoint.PointsList;
            ConvertPointLocations(NewPolygon, GMPoint.MapPoints);

            NewPolygon.Fill            = new SolidColorBrush(Colors.Maroon);
            NewPolygon.Stroke          = new SolidColorBrush(Colors.Gold);
            NewPolygon.StrokeThickness = 2;
            NewPolygon.Opacity         = 0.8;
            mapwindow.PolygonLayer.Children.Add(NewPolygon);


            MapPolygons.Add(NewPolygon);
            NewPolygon.Name       = "MapPoly" + MapPolygons.Count.ToString();
            NewPolygon.TouchDown += new EventHandler <TouchEventArgs>(Polygon_TouchDown);

            /*
             * this is where we are trying to make it so that we can pass in SurfaceWindow1 so that we can make the selected Polygon show the points it is made from.
             * right now the polygon is drawn from plotted points, then the points are erased, since they no longer have a purpose to be there.
             * see if statement inside Polygon_TouchDown Method for more detail
             * until this error is fixed the Polygon_Touchdown methods does nothing so the user can NOT select a polygon.
             */
            //NewPolygon.TouchDown += new EventHandler(void Polygon_TouchDown(mapwindow, this, ));
            GMPoint.MapPoints = new ArrayList();
        }
示例#3
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;
                    }
                }
            }
        }
示例#4
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);
            }
        }
示例#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);
        }
示例#6
0
        // This is for creating polygons from touches on the map

        public GISMapPolygon(SurfaceWindow1 surwin)
        {
            mapwindow = surwin;
        }
 // This is for creating polygons from touches on the map
 public GISMapPolygon(SurfaceWindow1 surwin)
 {
     mapwindow = surwin;
 }
 /*
  * 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);
 }
 /*
  * 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;
             }
         }
     }
 }
 public SURGISControl1(SurfaceWindow1 surfaceWindow1)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.surfaceWindow1 = surfaceWindow1;
 }
 public SURGISControl1(SurfaceWindow1 surfaceWindow1)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.surfaceWindow1 = surfaceWindow1;
 }