Exemplo n.º 1
0
 GetPairs(PointCollection points)
 {
     using (IEnumerator <Point> iter = points.GetEnumerator()) {
         while (iter.MoveNext())
         {
             Point value1 = (Point)iter.Current;
             if (!iter.MoveNext())
             {
                 yield break;
             }
             yield return(new Tuple <Point, Point>(value1, (Point)iter.Current));
         }
     }
 }
Exemplo n.º 2
0
 public Point3DCollection GetAsCartesianCoord(int n)
 {
     if (n >= GetNumberOfBorderLines())
     {
         return(null);
     }
     else
     {
         PointCollection   sph   = BorderLines[n] as PointCollection;
         Point3DCollection cart  = new Point3DCollection(sph.Count);
         IEnumerator       ienum = sph.GetEnumerator();
         while (ienum.MoveNext())
         {
             Point point = (Point)ienum.Current;
             cart.Add(GetCartesianCoord(point.X, point.Y));
         }
         return(cart);
     }
 }
Exemplo n.º 3
0
 public IEnumerator <IPoint> GetEnumerator()
 {
     return(points.GetEnumerator());
 }
Exemplo n.º 4
0
        // Token: 0x06002E04 RID: 11780 RVA: 0x000CF83C File Offset: 0x000CDA3C
        private void _ProcessOutlinePath(Matrix transform, PathGeometry pathGeom)
        {
            PathFigureCollection figures = pathGeom.Figures;

            foreach (PathFigure pathFigure in figures)
            {
                PathSegmentCollection segments = pathFigure.Segments;
                Point startPoint = pathFigure.StartPoint;
                Point startP     = startPoint;
                foreach (PathSegment pathSegment in segments)
                {
                    if (pathSegment is ArcSegment)
                    {
                        startP = (pathSegment as ArcSegment).Point;
                    }
                    else if (pathSegment is BezierSegment)
                    {
                        startP = (pathSegment as BezierSegment).Point3;
                    }
                    else if (pathSegment is LineSegment)
                    {
                        Point point = (pathSegment as LineSegment).Point;
                        this._AddLine(startP, point, transform);
                        startP = point;
                    }
                    else if (pathSegment is PolyBezierSegment)
                    {
                        PointCollection points = (pathSegment as PolyBezierSegment).Points;
                        startP = points[points.Count - 1];
                    }
                    else
                    {
                        if (pathSegment is PolyLineSegment)
                        {
                            PointCollection points2 = (pathSegment as PolyLineSegment).Points;
                            using (PointCollection.Enumerator enumerator3 = points2.GetEnumerator())
                            {
                                while (enumerator3.MoveNext())
                                {
                                    Point point2 = enumerator3.Current;
                                    this._AddLine(startP, point2, transform);
                                    startP = point2;
                                }
                                continue;
                            }
                        }
                        if (pathSegment is PolyQuadraticBezierSegment)
                        {
                            PointCollection points3 = (pathSegment as PolyQuadraticBezierSegment).Points;
                            startP = points3[points3.Count - 1];
                        }
                        else if (pathSegment is QuadraticBezierSegment)
                        {
                            startP = (pathSegment as QuadraticBezierSegment).Point2;
                        }
                    }
                }
                if (pathFigure.IsClosed)
                {
                    this._AddLine(startP, startPoint, transform);
                }
            }
        }