Esempio n. 1
0
        public void RemovePointAt(int index)
        {
            if (_pts == null || index < 0 || index >= _pts.Length)
            {
                return;
            }

            if (_pts.Length == 1)
            {
                _pts = null;
            }
            else
            {
                var tmp = new precisionpoint[_pts.Length - 1];
                int c   = 0;
                for (int i = 0; i < _pts.Length; i++)
                {
                    if (i != index)
                    {
                        tmp[c++] = _pts[i];
                    }
                }
                _pts = tmp;
            }

            if (_parent != null)
            {
                _parent.Invalidate();
            }
        }
Esempio n. 2
0
        public void RemovePoint(precisionpoint point)
        {
            if (_pts == null)
            {
                return;
            }

            for (int i = 0; i < _pts.Length; i++)
            {
                if (Math.Abs(_pts[i].X - point.X) <= Single.Epsilon && Math.Abs(_pts[i].Y - point.Y) <= Single.Epsilon)
                {
                    RemovePointAt(i);
                    return;
                }
            }
        }
Esempio n. 3
0
        public void AddPoints(precisionpoint[] points)
        {
            if (_pts == null)
            {
                _pts = points;
            }
            else
            {
                var tmp = new precisionpoint[_pts.Length + points.Length];
                Array.Copy(_pts, tmp, _pts.Length);
                Array.Copy(points, 0, tmp, _pts.Length, points.Length);
                _pts = tmp;
            }

            if (_parent != null)
            {
                _parent.Invalidate();
            }
        }
Esempio n. 4
0
        public void AddPoint(precisionpoint point)
        {
            if (_pts == null)
            {
                _pts = new[] { point };
            }
            else
            {
                var tmp = new precisionpoint[_pts.Length + 1];
                Array.Copy(_pts, tmp, _pts.Length);
                tmp[tmp.Length - 1] = point;
                _pts = tmp;
            }

            if (_parent != null)
            {
                _parent.Invalidate();
            }
        }
Esempio n. 5
0
 public LineGraphItem(Color color, precisionpoint point)
 {
     _color   = color;
     _pts     = new[] { point };
     _visible = true;
 }