Esempio n. 1
0
        public MIFRegion(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
            cnt++;

            string[] strs = mr.curStr.Split(' ');
            if (strs.Length == 2)
            {
                parts  = Int32.Parse(strs[1]);
                points = new MPoint[parts][];
                for (int i = 0; i < parts; i++)
                {
                    mr.ReadLine(true);
                    int n = Int32.Parse(mr.curStr);
                    points[i] = new MPoint[n];
                    for (int j = 0; j < n; j++)
                    {
                        points[i][j] = new MPoint(mr, nfi);
                    }
                }
                mr.ReadLine();
                if (mr.curStr != null && mr.curStr.StartsWith("pen", StringComparison.OrdinalIgnoreCase))
                {
                    pen = new MIFPen(mr);
                }

                if (mr.curStr != null && mr.curStr.StartsWith("brush", StringComparison.OrdinalIgnoreCase))
                {
                    brush = new MIFBrush(mr);
                }

//                if( mr.curStr != null && mr.curStr.ToLower().StartsWith( "center" ) )
//					center = new MPoint( mr );
            }
        }
Esempio n. 2
0
        public MIFLine(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
            cnt++;
            string[] strs = mr.curStr.Split(' ');
            point1 = new MPoint(double.Parse(strs[1], nfi), double.Parse(strs[2], nfi));
            point2 = new MPoint(double.Parse(strs[3], nfi), double.Parse(strs[4], nfi));

            mr.ReadLine();
            if (mr.curStr != null && mr.curStr.StartsWith("pen", StringComparison.OrdinalIgnoreCase))
            {
                pen = new MIFPen(mr);
            }
        }
Esempio n. 3
0
        public MIFPolyline(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
            cnt++;

            string[] strs = mr.curStr.Split(' ');
            if (strs.Length == 2)
            {
                parts  = 1;
                points = new MPoint[parts][];
                int n = Int32.Parse(strs[1]);
                points[0] = new MPoint[n];
                for (int j = 0; j < n; j++)
                {
                    mr.ReadLine(true);
                    string[] strsn = mr.curStr.Split(' ');
                    points[0][j] = new MPoint(double.Parse(strsn[0], nfi), double.Parse(strsn[1], nfi));
                }
            }
            if (strs.Length == 3)
            {
                parts  = Int32.Parse(strs[2]);
                points = new MPoint[parts][];
                for (int i = 0; i < parts; i++)
                {
                    mr.ReadLine(true);
                    int n = Int32.Parse(mr.curStr);
                    points[i] = new MPoint[n];
                    for (int j = 0; j < n; j++)
                    {
                        points[i][j] = new MPoint(mr, nfi);
                    }
                }
            }
            mr.ReadLine();
            if (mr.curStr != null && mr.curStr.StartsWith("pen", StringComparison.OrdinalIgnoreCase))
            {
                pen = new MIFPen(mr);
            }

            if (mr.curStr != null && mr.curStr.StartsWith("smooth", StringComparison.OrdinalIgnoreCase))
            {
                smooth = true;
                mr.ReadLine();
            }
        }
Esempio n. 4
0
        public MIFArc(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
            cnt++;

            string[] strs1 = mr.curStr.Split(' ');
            mr.ReadLine(true);
            string[] strs2 = mr.curStr.Split(' ');
            if (strs1.Length == 5 && strs2.Length == 2)
            {
                point1 = new MPoint(double.Parse(strs1[1], nfi), double.Parse(strs1[2], nfi));
                point2 = new MPoint(double.Parse(strs1[3], nfi), double.Parse(strs1[4], nfi));
                a      = double.Parse(strs2[0], nfi);
                b      = double.Parse(strs2[1], nfi);

                mr.ReadLine();
                if (mr.curStr != null && mr.curStr.StartsWith("pen", StringComparison.OrdinalIgnoreCase))
                {
                    pen = new MIFPen(mr);
                }
            }
        }
Esempio n. 5
0
        public MIFEllipse(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
            cnt++;

            string[] strs1 = mr.curStr.Split(' ');
            if (strs1.Length == 5)
            {
                point1 = new MPoint(double.Parse(strs1[1], nfi), double.Parse(strs1[2], nfi));
                point2 = new MPoint(double.Parse(strs1[3], nfi), double.Parse(strs1[4], nfi));
            }

            mr.ReadLine();
            if (mr.curStr != null && mr.curStr.StartsWith("pen", StringComparison.OrdinalIgnoreCase))
            {
                pen = new MIFPen(mr);
            }

            if (mr.curStr != null && mr.curStr.StartsWith("brush", StringComparison.OrdinalIgnoreCase))
            {
                brush = new MIFBrush(mr);
            }
        }