Ejemplo n.º 1
0
        void SetPointStyle(IniFile.Section section, IFigure figure)
        {
            figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);

            var fillColor     = section.ReadColor("FillColor");
            var fillStyle     = section.ReadInt("FillStyle");
            var foreColor     = section.ReadColor("ForeColor");
            var physicalWidth = section.ReadDouble("PhysicalWidth");

            if (fillStyle == 1)
            {
                fillColor = Colors.Transparent;
            }

            PointStyle pointStyle = new PointStyle()
            {
                Fill        = new SolidColorBrush(fillColor),
                Color       = foreColor,
                Size        = physicalWidth,
                StrokeWidth = 0.7
            };

            figure.Style = drawing.StyleManager.FindExistingOrAddNew(pointStyle);
        }
Ejemplo n.º 2
0
        void SetButtonStyle(IniFile.Section section, IFigure figure)
        {
            figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);

            var    fontName      = section["FontName"];
            double?fontSize      = section.TryReadDouble("FontSize");
            bool   fontUnderline = section.ReadBool("FontUnderline", false);
            var    foreColor     = section.ReadColor("ForeColor");
            var    backColor     = section.ReadColor("BackColor");

            TextStyle style = new TextStyle()
            {
                FontFamily = new FontFamily(fontName),
                Color      = foreColor,
                Underline  = fontUnderline
            };

            if (fontSize.HasValue)
            {
                style.FontSize = fontSize.Value * 1.7;
            }

            figure.Style = drawing.StyleManager.FindExistingOrAddNew(style);
        }
Ejemplo n.º 3
0
 double GetAuxInfo(IniFile.Section section, int index)
 {
     return(section.ReadDouble("AuxInfo(" + index.ToString() + ")"));
 }
Ejemplo n.º 4
0
        void SetFigureStyle(IniFile.Section section, IFigure figure)
        {
            figure.Visible = !section.ReadBool("Hide", false) && section.ReadBool("Visible", true);

            var    fillColor = section.ReadColor("FillColor");
            var    foreColor = section.ReadColor("ForeColor");
            double drawWidth = section.TryReadDouble("DrawWidth") ?? 1.0;

            if (drawWidth < 0.1)
            {
                drawWidth = 0.1;
            }
            int?drawStyle = section.TryReadInt("DrawStyle");
            int?fillStyle = section.TryReadInt("FillStyle");
            int?drawMode  = section.TryReadInt("DrawMode");

            if (fillStyle == null || fillStyle == 6)
            {
                fillColor = Colors.Transparent;
            }
            DoubleCollection strokeDashArray = null;

            if (drawStyle != null && drawStyle != 0)
            {
                strokeDashArray = new DoubleCollection();
                switch (drawStyle)
                {
                case 1:
                    strokeDashArray.Add(15 / drawWidth, 6 / drawWidth);
                    break;

                case 2:
                    strokeDashArray.Add(3 / drawWidth, 3 / drawWidth);
                    break;

                case 3:
                    strokeDashArray.Add(10 / drawWidth, 4 / drawWidth, 2 / drawWidth, 4 / drawWidth);
                    break;

                case 4:
                    strokeDashArray.Add(10 / drawWidth, 4 / drawWidth, 2 / drawWidth, 4 / drawWidth, 2 / drawWidth, 4 / drawWidth);
                    break;

                default:
                    break;
                }
            }

            IFigureStyle style;

            if (figure is IShapeWithInterior)
            {
                if (fillColor != Colors.Transparent && drawMode != 13)
                {
                    fillColor.A = 128;
                }
                style = new ShapeStyle()
                {
                    Fill            = new SolidColorBrush(fillColor),
                    Color           = foreColor,
                    StrokeWidth     = drawWidth,
                    StrokeDashArray = strokeDashArray
                };
            }
            else
            {
                if (foreColor == Colors.Transparent)
                {
                    System.Diagnostics.Debugger.Break();
                }
                style = new LineStyle()
                {
                    Color           = foreColor,
                    StrokeWidth     = drawWidth,
                    StrokeDashArray = strokeDashArray
                };
            }

            figure.Style = drawing.StyleManager.FindExistingOrAddNew(style);
        }
Ejemplo n.º 5
0
 void AddLabelFigure(IniFile.Section section, IFigure figure)
 {
     //SetLabelStyle(section, figure);
     Actions.Add(drawing, figure);
     figures[section.GetTitleNumber("Figure")] = figure;
 }
Ejemplo n.º 6
0
 void AddFigure(IniFile.Section section, IFigure figure)
 {
     Actions.Add(drawing, figure);
     figures[section.GetTitleNumber("Figure")] = figure;
 }
Ejemplo n.º 7
0
        void ProcessFigure(IniFile.Section section)
        {
            var figureType = section.ReadInt("FigureType");

            switch (figureType)
            {
            case 1:     // Segment
                ReadSegment(section);
                break;

            case 2:     // Ray
                ReadRay(section);
                break;

            case 3:     // Line
                ReadLine2Points(section);
                break;

            case 4:     // ParallelLine
                ReadParallelLine(section);
                break;

            case 5:     // PerpendicularLine
                ReadPerpendicularLine(section);
                break;

            case 6:     // Circle
                ReadCircle(section);
                break;

            case 7:     // CircleByRadius
                ReadCircleByRadius(section);
                break;

            case 8:     // Arc
                ReadArc(section);
                break;

            case 9:     // MidPoint
                ReadMidPoint(section);
                break;

            case 10:     // SymmPoint
                ReadSymmPoint(section);
                break;

            case 11:     // SymmPointByLine
                ReadSymmPointByLine(section);
                break;

            case 12:     // InvertedPoint
                ReadInvertedPoint(section);
                break;

            case 13:     // IntersectionPoint
                ReadIntersectionPoint(section);
                break;

            case 14:     // PointOnFigure
                ReadPointOnFigure(section);
                break;

            case 15:     // MeasureDistance
                ReadMeasureDistance(section);
                break;

            case 16:     // MeasureAngle
                ReadMeasureAngle(section);
                break;

            case 17:     // AnLineGeneral
                ReadAnalyticLineGeneral(section);
                break;

            case 21:     // AnCircle
                ReadAnalyticCircle(section);
                break;

            case 22:     // AnalyticPoint
                ReadAnalyticPoint(section);
                break;

            case 23:     // Locus
                ReadLocus(section);
                break;

            case 24:     // AngleBisector
                ReadAngleBisector(section);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 8
0
 void ProcessLocus(IniFile.Section section)
 {
 }