Exemplo 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 );
            }
        }
Exemplo n.º 2
0
        public MIFCoordSys(string row, NumberFormatInfo nfi)
        {
            this.row = row;

            string str = row.Substring(row.IndexOf("bounds", StringComparison.OrdinalIgnoreCase));

            string[] strs = str.Split(new char[] { ' ', '(', ')', ',' }, StringSplitOptions.RemoveEmptyEntries);
            p1 = new MPoint(Double.Parse(strs[1], nfi), Double.Parse(strs[2], nfi));
            p2 = new MPoint(Double.Parse(strs[3], nfi), Double.Parse(strs[4], nfi));
        }
Exemplo n.º 3
0
        public MPoint lableLinePoint;                           //		{simple | arrow} x y

        public MIFText(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
            cnt++;

            if (mr.textOnNextLine)
            {
                mr.ReadLine(true);
                text = mr.curStr;
                mr.ReadLine(true);
            }
            else
            {
                string[] strs1 = mr.curStr.Split(' ');
                text = strs1[1];
                mr.ReadLine(true);
            }
            string[] strs2 = mr.curStr.Split(' ');
            point1 = new MPoint(double.Parse(strs2[0], nfi), double.Parse(strs2[1], nfi));
            point2 = new MPoint(double.Parse(strs2[2], nfi), double.Parse(strs2[3], nfi));

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

            if (mr.curStr != null && mr.curStr.StartsWith("spacing", StringComparison.OrdinalIgnoreCase))
            {
                string[] strs7 = mr.curStr.Split(' ');
                spacing = double.Parse(strs7[1], nfi);
                mr.ReadLine();
            }
            if (mr.curStr != null && mr.curStr.StartsWith("justify", StringComparison.OrdinalIgnoreCase))
            {
                string[] strs3 = mr.curStr.Split(' ');
                justify = strs3[1];
                mr.ReadLine();
            }
            if (mr.curStr != null && mr.curStr.StartsWith("angle", StringComparison.OrdinalIgnoreCase))
            {
                string[] strs4 = mr.curStr.Split(' ');
                angle = double.Parse(strs4[1], nfi);
                mr.ReadLine();
            }
            if (mr.curStr != null && mr.curStr.StartsWith("lable", StringComparison.OrdinalIgnoreCase))
            {
                string[] strs5 = mr.curStr.Split(' ');
                labelLineStyle = strs5[1];
                lableLinePoint = new MPoint(double.Parse(strs5[2], nfi), double.Parse(strs5[3], nfi));
                mr.ReadLine();
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
0
        public MIFPoint(MIFFileReader mr, NumberFormatInfo nfi) : base(mr.mifNLine)
        {
//			line = mr.RowLine;

            cnt++;
            string[] strs = mr.curStr./*Replace( '.', ',' ).*/ Split(' ');
            point = new MPoint(double.Parse(strs[1], nfi), double.Parse(strs[2], nfi));

            if (mr.curStr != null && mr.curStr.StartsWith("symbol", StringComparison.OrdinalIgnoreCase))
            {
                symbol = new MIFSymbol(mr);
            }
            mr.ReadLine( );
        }
Exemplo n.º 6
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();
            }
        }
Exemplo n.º 7
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);
                }
            }
        }
Exemplo n.º 8
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);
            }
        }