Ejemplo n.º 1
0
        public static Polymarker Polymarker(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1-Pn: (point) n (X,Y) marker positions
            var points = ReadPointList(reader);

            return(new Polymarker(points.ToArray()));
        }
Ejemplo n.º 2
0
 public static ParabolicArc ParabolicArc(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) tangent intersection point
     // P2: (point) start point
     // P3: (point) end point
     return(new ParabolicArc(reader.ReadPoint(), reader.ReadPoint(), reader.ReadPoint()));
 }
Ejemplo n.º 3
0
 public static Ellipse Ellipse(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) centre of ellipse
     // P2: (point) endpoint of first conjugate diameter
     // P3: (point) endpoint of second conjugate diameter
     return(new Ellipse(reader.ReadPoint(), reader.ReadPoint(), reader.ReadPoint()));
 }
Ejemplo n.º 4
0
        public static DisjointPolyline DisjointPolyline(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1-Pn: (point) n (X,Y) line segment endpoints
            var points = ReadPointList(reader);

            return(new DisjointPolyline(points.ToArray()));
        }
Ejemplo n.º 5
0
 public static CircularArc3Point CircularArc3Point(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) starting point
     // P2: (point) intermediate point
     // P3: (point) ending point
     return(new CircularArc3Point(reader.ReadPoint(), reader.ReadPoint(), reader.ReadPoint()));
 }
Ejemplo n.º 6
0
        public static NonUniformBSpline NonUniformBSpline(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1: (integer) spline order (=m)
            // P2: (integer) number of control points (=n)
            // P(3)-P(2+n): (points) array of control points
            // P(3+n)-P(2+2n+m): (real) list of knots, of length n+m.
            // P(3+2n+m): (real) parameter start value
            // P(4+2n+m): (real) parameter end value
            int splineOrder           = reader.ReadInteger();
            int numberOfControlPoints = reader.ReadInteger();
            var controlPoints         = new List <PointF>();

            for (int i = 0; i < numberOfControlPoints; i++)
            {
                controlPoints.Add(reader.ReadPoint());
            }
            var knots = new List <double>();

            for (int i = 0; i < splineOrder + numberOfControlPoints; i++)
            {
                knots.Add(reader.ReadReal());
            }
            double start = reader.ReadReal();
            double end   = reader.ReadReal();

            return(new NonUniformBSpline(splineOrder, controlPoints.ToArray(), knots.ToArray(), start, end));
        }
Ejemplo n.º 7
0
        private static Command ReadColorIndexPrecision(MetafileReader reader, CommandHeader commandHeader)
        {
            var colorIndexPrecision = MetafileDescriptorReader.ColorIndexPrecision(reader, commandHeader);

            reader.Descriptor.ColorIndexPrecision = colorIndexPrecision.Precision;
            return(colorIndexPrecision);
        }
 public static BeginTileArray BeginTileArray(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) position
     // P2: (enumerated) cell path direction: valid values are
     //      0 0°
     //      1 90°
     //      2 180°
     //      3 270°
     // P3: (enumerated) line progression direction: valid values are
     //      0 90°
     //      1 270°
     // P4: (integer) number of tiles in pth direction
     // P5: (integer) number of tiles in line direction
     // P6: (integer) number of cells/ tile in path direction
     // P7: (integer) number of cells/ tile in line direction
     // P8: (real) cell size in path direction
     // P9: (real) cell size in line direction
     // P10: (integer) image offset in path direction
     // P11: (integer) image offset in line direction
     // P12: (integer) image number of cells in path direction
     // P13: (integer) image number of cells in line direction
     return(new BeginTileArray(
                reader.ReadPoint(),
                reader.ReadEnum <CellPathDirection>(),
                reader.ReadEnum <LineProgressionDirection>(),
                reader.ReadInteger(), reader.ReadInteger(),
                reader.ReadInteger(), reader.ReadInteger(),
                reader.ReadReal(), reader.ReadReal(),
                reader.ReadInteger(), reader.ReadInteger(),
                reader.ReadInteger(), reader.ReadInteger()));
 }
Ejemplo n.º 9
0
        private static Command ReadColorModel(MetafileReader reader, CommandHeader commandHeader)
        {
            var colorModel = MetafileDescriptorReader.ColorModelCommand(reader, commandHeader);

            reader.Descriptor.ColorModel = colorModel.ColorModel;
            return(colorModel);
        }
Ejemplo n.º 10
0
        private static Command ReadColorSelectionMode(MetafileReader reader, CommandHeader commandHeader)
        {
            var colorSelectionMode = PictureDescriptorReader.ColorSelectionMode(reader, commandHeader);

            reader.Descriptor.ColorSelectionMode = colorSelectionMode.ColorMode;
            return(colorSelectionMode);
        }
Ejemplo n.º 11
0
        public static Polyline Polyline(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1-Pn: (point) n (X,Y) polyline vertices
            var points = ReadPointList(reader);

            return(new Polyline(points.ToArray()));
        }
Ejemplo n.º 12
0
        private static Command ReadNamePrecision(MetafileReader reader, CommandHeader commandHeader)
        {
            var namePrecision = MetafileDescriptorReader.NamePrecision(reader, commandHeader);

            reader.Descriptor.NamePrecision = namePrecision.Precision;
            return(namePrecision);
        }
Ejemplo n.º 13
0
        private static Command ReadRealPrecision(MetafileReader reader, CommandHeader commandHeader)
        {
            var realPrecision = MetafileDescriptorReader.RealPrecision(reader, commandHeader);

            reader.Descriptor.RealPrecision = realPrecision.Specification;
            return(realPrecision);
        }
Ejemplo n.º 14
0
        private static Command ReadIndexPrecision(MetafileReader reader, CommandHeader commandHeader)
        {
            var indexPrecision = MetafileDescriptorReader.IndexPrecision(reader, commandHeader);

            reader.Descriptor.IndexPrecision = indexPrecision.Precision;
            return(indexPrecision);
        }
Ejemplo n.º 15
0
        private static Command ReadVdcType(MetafileReader reader, CommandHeader commandHeader)
        {
            var vdcType = MetafileDescriptorReader.VdcType(reader, commandHeader);

            reader.Descriptor.VdcType = vdcType.Specification;
            return(vdcType);
        }
Ejemplo n.º 16
0
        private static Command ReadEndMetafile(MetafileReader reader, CommandHeader commandHeader)
        {
            var result = DelimiterElementReader.EndMetafile(reader, commandHeader);

            reader._insideMetafile = false;
            return(result);
        }
Ejemplo n.º 17
0
        private static Command ReadBeginMetafile(MetafileReader reader, CommandHeader commandHeader)
        {
            var result = DelimiterElementReader.BeginMetafile(reader, commandHeader);

            reader._insideMetafile = result != null;
            return(result);
        }
Ejemplo n.º 18
0
        private static Command ReadLineWidthSpecificationMode(MetafileReader reader, CommandHeader commandHeader)
        {
            var lineWidthSpecificationMode = PictureDescriptorReader.LineWidthSpecificationMode(reader, commandHeader);

            reader.Descriptor.LineWidthSpecificationMode = lineWidthSpecificationMode.WidthSpecificationMode;
            return(lineWidthSpecificationMode);
        }
Ejemplo n.º 19
0
 public static AppendText AppendText(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) final / not - final flag: valid values are
     //      0 not final
     //      1 final
     // P2: (string) text string
     return(new AppendText(reader.ReadEnum <FinalFlag>(), reader.ReadString()));
 }
Ejemplo n.º 20
0
 public static TextPrecision TextPrecision(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) text precision: valid values are
     //      0 string
     //      1 character
     //      2 stroke
     return(new TextPrecision(reader.ReadEnum <TextPrecisionType>()));
 }
Ejemplo n.º 21
0
 public static Message Message(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) action-required flag: valid values are
     //      0 noaction
     //      1 action
     // P2: (string fixed) message string
     return(new Message(reader.ReadEnum <ActionRequired>(), reader.ReadString()));
 }
Ejemplo n.º 22
0
 public static SegmentHighlighting SegmentHighlighting(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (name) segment identifier
     // P2: (enumerated) highlighting: valid values are
     //      0 normal
     //      1 highlighted
     return(new SegmentHighlighting(reader.ReadName(), reader.ReadEnum <Highlighting>()));
 }
Ejemplo n.º 23
0
 public static EdgeClippingMode EdgeClippingMode(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) clipping mode: valid values are
     //      0 locus
     //      1 shape
     //      2 locus then shape
     return(new EdgeClippingMode(reader.ReadEnum <ClippingMode>()));
 }
Ejemplo n.º 24
0
 public static TextCommand Text(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (point) text position
     // P2: (enumerated) final / not - final flag: valid values are
     //      0 not final
     //      1 final
     // P3: (string) text string
     return(new TextCommand(reader.ReadPoint(), reader.ReadEnum <FinalFlag>(), reader.ReadString()));
 }
Ejemplo n.º 25
0
 public static TextPath TextPath(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) text path: valid values are:
     //      0 right
     //      1 left
     //      2 up
     //      3 down
     return(new TextPath(reader.ReadEnum <TextPathType>()));
 }
Ejemplo n.º 26
0
 public static VdcRealPrecision VdcRealPrecision(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (enumerated) form of representation for real values: valid values are
     //      0 floating point format
     //      1 fixed point format
     // P2: (integer) field width for exponent or whole part (including 1 bit for sign)
     // P3: (integer) field width for fraction or fractional part
     return(new VdcRealPrecision(reader.ReadEnum <RealRepresentation>(), reader.ReadInteger(), reader.ReadInteger()));
 }
Ejemplo n.º 27
0
        public static DeviceViewport DeviceViewport(MetafileReader reader, CommandHeader header)
        {
            // P1: (viewport point) first corner
            // P2: (viewport point) second corner
            var firstCorner  = reader.ReadViewportPoint();
            var secondCorner = reader.ReadViewportPoint();

            return(new DeviceViewport(firstCorner, secondCorner));
        }
Ejemplo n.º 28
0
        public static VdcExtent VdcExtent(MetafileReader reader, CommandHeader header)
        {
            // P1: (point) first corner
            // P2: (point) second corner
            var firstCorner  = reader.ReadPoint();
            var secondCorner = reader.ReadPoint();

            return(new VdcExtent(firstCorner, secondCorner));
        }
Ejemplo n.º 29
0
 public static EdgeJoin EdgeJoin(MetafileReader reader, CommandHeader commandHeader)
 {
     // P1: (index) edge join indicator: the following values are standardized:
     //      1 unspecified
     //      2 mitre
     //      3 round
     //      4 bevel
     //      >4 reserved for registered values
     return(new EdgeJoin(reader.ReadIndex()));
 }
        public static FontList FontList(MetafileReader reader, CommandHeader commandHeader)
        {
            // P1-Pn: (string fixed) n font names
            var fonts = new List <string>();

            while (reader.HasMoreData())
            {
                fonts.Add(reader.ReadString());
            }
            return(new FontList(fonts));
        }