public override void Draw(Graphics _Graphics, XView _View)
        {
            Point screenPoint = _View.ToScreenPoint(Centroid);

            _Graphics.FillEllipse(new SolidBrush(Color.Red),
                                  new Rectangle(screenPoint.X - 3, screenPoint.Y - 3, 6, 6));
        }
 public void Draw(Graphics _Graphics, XView _View)
 {
     for (int i = 0; i < Features.Count; i++)
     {
         Features[i].Draw(_Graphics, _View, DrawAttributeOrNot, LabelIndex);
     }
 }
 internal void SelectByClick(Point location, XView view)
 {
     //for (int i = 0; i < Features.Count; i++)
     //{
     //    if (Features[i].)
     //}
 }
 public void Draw(Graphics _Graphics, XView _View, bool _DrawAttributeOrNot, int _Index)
 {
     Spatial.Draw(_Graphics, _View);
     if (_DrawAttributeOrNot)
     {
         Attribute.Draw(_Graphics, _View, Spatial.Centroid, _Index);
     }
 }
        public void Draw(Graphics _Graphics, XView _View, XVertex _Location, int _Index)
        {
            Point screenPoint = _View.ToScreenPoint(_Location);

            _Graphics.DrawString(GetValue(_Index).ToString(),
                                 new Font("宋体", 20),
                                 new SolidBrush(Color.Green), screenPoint);
        }
Exemple #6
0
 public FormXGIS()
 {
     InitializeComponent();
     view = new XView(
         new XExtent(
             new XVertex(0, 0),
             new XVertex(1, 1)),
         this.ClientRectangle
         );
 }
 public void Draw(Graphics _Graphics, XView _View)
 {
     for (int i = 0; i < Features.Count; i++)
     {
         if (Features[i].Spatial.Extent.IntersectWith(_View.CurrentMapExtent))
         {
             Features[i].Draw(_Graphics, _View, DrawAttributeOrNot, LabelIndex);
         }
     }
 }
Exemple #8
0
        public FormXGIS()
        {
            InitializeComponent();
            this.SetStyle(
                System.Windows.Forms.ControlStyles.UserPaint |
                System.Windows.Forms.ControlStyles.AllPaintingInWmPaint |
                System.Windows.Forms.ControlStyles.OptimizedDoubleBuffer,
                true);

            backWindow = BufferedGraphicsManager.Current;

            view = new XView(
                new XExtent(
                    new XVertex(0, 0),
                    new XVertex(1, 1)),
                this.ClientRectangle
                );
        }
 public abstract void Draw(Graphics _Graphics, XView _View);
Exemple #10
0
 public override void Draw(Graphics _Graphics, XView _View)
 {
     Point[] points = _View.ToScreenPoints(AllVertexes);
     _Graphics.FillPolygon(new SolidBrush(Color.Yellow), points);
     _Graphics.DrawPolygon(new Pen(Color.White, 2), points);
 }
Exemple #11
0
 public override void Draw(Graphics _Graphics, XView _View)
 {
     _Graphics.DrawLines(new Pen(Color.Red, 2),
                         _View.ToScreenPoints(AllVertexes));
 }
Exemple #12
0
        internal void SelectByClick(Point location, XView view)
        {
            XVertex v = view.ToMapVertex(location);

            foreach (XFeature feature in Features)
            {
                feature.Selected = false;
            }
            if (ShapeType == SHAPETYPE.point)
            {
                Double distance = Double.MaxValue;
                int    id       = -1;
                for (int i = 0; i < Features.Count; i++)
                {
                    XPointSpatial point = (XPointSpatial)(Features[i].Spatial);
                    double        dist  = point.Distance(v);
                    if (dist < distance)
                    {
                        distance = dist;
                        id       = i;
                    }
                }
                double scd = view.ToScreenDistance(v, Features[id].Spatial.Centroid);//转为屏幕距离
                if (scd <= 5)
                {
                    Features[id].Selected = true;
                }
                else
                {
                    Console.WriteLine("屏幕距离为" + scd + ",选择无效!!");
                }
            }
            else if (ShapeType == SHAPETYPE.line)
            {
                Double distance = Double.MaxValue;
                int    id       = -1;
                for (int i = 0; i < Features.Count; i++)
                {
                    XLineSpatial line = (XLineSpatial)(Features[i].Spatial);
                    double       dist = line.Distance(v);
                    if (dist < distance)
                    {
                        distance = dist;
                        id       = i;
                    }
                }
                double scd = view.ToScreenDistance(distance);//转为屏幕距离
                if (scd <= 5)
                {
                    Features[id].Selected = true;
                }
                else
                {
                    Console.WriteLine("屏幕距离为" + scd + ",选择无效!!");
                }
            }
            else if (ShapeType == SHAPETYPE.polygon)
            {
                for (int i = 0; i < Features.Count; i++)
                {
                    XPolygonSpatial polygon = (XPolygonSpatial)(Features[i].Spatial);
                    if (polygon.Incude(v))
                    {
                        Features[i].Selected = true;
                    }
                }
            }
        }
Exemple #13
0
 public override void Draw(Graphics _Graphics, XView _View, bool _Selected)
 {
     Point[] points = _View.ToScreenPoints(AllVertexes);
     _Graphics.FillPolygon(new SolidBrush(_Selected ? Color.Red : Color.Green), points);
     _Graphics.DrawPolygon(new Pen(Color.White, 2), points);
 }
Exemple #14
0
 public override void Draw(Graphics _Graphics, XView _View, bool _Selected)
 {
     _Graphics.DrawLines(new Pen(_Selected ? Color.Red : Color.Green, 2),
                         _View.ToScreenPoints(AllVertexes));
 }
Exemple #15
0
 public abstract void Draw(Graphics _Graphics, XView _View, bool _Selected);
Exemple #16
0
 internal void selectByClick(Point location, XView view)
 {
     throw new NotImplementedException();
 }