示例#1
0
        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));
        }
示例#2
0
 public void Draw(Graphics _Graphics, XView _View)
 {
     for (int i = 0; i < Features.Count; i++)
     {
         Features[i].Draw(_Graphics, _View, DrawAttributeOrNot, LabelIndex);
     }
 }
示例#3
0
 internal void SelectByClick(Point location, XView view)
 {
     //for (int i = 0; i < Features.Count; i++)
     //{
     //    if (Features[i].)
     //}
 }
示例#4
0
 public void Draw(Graphics _Graphics, XView _View, bool _DrawAttributeOrNot, int _Index)
 {
     Spatial.Draw(_Graphics, _View);
     if (_DrawAttributeOrNot)
     {
         Attribute.Draw(_Graphics, _View, Spatial.Centroid, _Index);
     }
 }
示例#5
0
        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);
        }
示例#6
0
 public FormXGIS()
 {
     InitializeComponent();
     view = new XView(
         new XExtent(
             new XVertex(0, 0),
             new XVertex(1, 1)),
         this.ClientRectangle
         );
 }
示例#7
0
 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);
         }
     }
 }
示例#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
                );
        }
示例#9
0
 public abstract void Draw(Graphics _Graphics, XView _View);
示例#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);
 }
示例#11
0
 public override void Draw(Graphics _Graphics, XView _View)
 {
     _Graphics.DrawLines(new Pen(Color.Red, 2),
                         _View.ToScreenPoints(AllVertexes));
 }
示例#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;
                    }
                }
            }
        }
示例#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);
 }
示例#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));
 }
示例#15
0
 public abstract void Draw(Graphics _Graphics, XView _View, bool _Selected);
示例#16
0
 internal void selectByClick(Point location, XView view)
 {
     throw new NotImplementedException();
 }