Beispiel #1
0
 internal void AddPoint(double x, double y)
 {
     if (_pLine == null)
     {
         _pLine = new Polyline();
         Path path = new Path();
         _pLine.AddPath(path);
     }
     _pLine[0].AddPoint(new Point(x, y));
 }
Beispiel #2
0
        public void Load(IPersistStream stream)
        {
            if (_polyline == null || stream == null)
            {
                return;
            }

            PersistablePointCollection p;

            while ((p = stream.Load("Path", null, new PersistablePointCollection(new Path())) as PersistablePointCollection) != null)
            {
                _polyline.AddPath(p.PointCollection as IPath);
            }
        }
Beispiel #3
0
        public void AddPoint(IPoint point)
        {
            if (point == null)
            {
                return;
            }

            if (_geometry is IPoint && _actPartNr == 0)
            {
                ((IPoint)_geometry).X = point.X;
                ((IPoint)_geometry).Y = point.Y;
                ((IPoint)_geometry).Z = point.Z;
            }
            else if (_geometry is IMultiPoint)
            {
                IMultiPoint mPoint = (IMultiPoint)_geometry;
                mPoint.AddPoint(point);
            }
            else if (_geometry is IPolyline)
            {
                IPolyline pLine = (IPolyline)_geometry;
                if (_actPartNr >= pLine.PathCount)
                {
                    gView.Framework.Geometry.Path path = new gView.Framework.Geometry.Path();
                    path.AddPoint(point);
                    pLine.AddPath(path);
                    _actPartNr = pLine.PathCount - 1;
                }
                else
                {
                    pLine[_actPartNr].AddPoint(point);
                }
            }
            else if (_geometry is IPolygon)
            {
                IPolygon poly = (IPolygon)_geometry;
                if (_actPartNr >= poly.RingCount)
                {
                    Ring ring = new Ring();
                    ring.AddPoint(point);
                    poly.AddRing(ring);
                    _actPartNr = poly.RingCount - 1;
                }
                else
                {
                    poly[_actPartNr].AddPoint(point);
                }
            }
        }