public RenderNodeAction OnPolyline(PolylineNode node)
        {
            // tessellate annotations OnPolyline to support Wireframe annotation export
            if (m_currentElem.Category.CategoryType == CategoryType.Annotation)
            {
                PolyLine    pLine = node.GetPolyline();
                IList <XYZ> list  = pLine.GetCoordinates();
                Utilities.addTo(m_points, list);
            }

            return(RenderNodeAction.Proceed);
        }
        public RenderNodeAction OnPolyline(PolylineNode node)
        {
            // Customize processing of annotation polylines
            if (m_currentElem.Category.CategoryType == CategoryType.Annotation)
            {
                PolyLine    pLine = node.GetPolyline();
                IList <XYZ> list  = pLine.GetCoordinates();
                Utilities.addTo(m_points, list);
                return(RenderNodeAction.Skip);
            }

            return(RenderNodeAction.Proceed);
        }
Example #3
0
        /// <summary>
        /// initializes the Diagram data
        /// </summary>
        private void InitializeDiagram()
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 25, 120, 75);
            rect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            rect.FillStyle.ForeColor = Color.White;
            rect.FillStyle.Type      = FillStyleType.LinearGradient;
            rect.LineStyle.LineColor = Color.DarkGray;
            AddLabel(rect, "Rectangle", Position.Center);
            diagram1.Model.AppendChild(rect);

            Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(400, 25, 120, 75, MeasureUnits.Pixel);
            roundRect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            roundRect.FillStyle.ForeColor = Color.White;
            roundRect.LineStyle.LineColor = Color.DarkGray;
            roundRect.FillStyle.Type      = FillStyleType.LinearGradient;
            AddLabel(roundRect, "RoundRect1", Position.Center);
            diagram1.Model.AppendChild(roundRect);

            Ellipse ellipse1 = new Ellipse(100, 125, 120, 80);

            ellipse1.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            ellipse1.FillStyle.ForeColor = Color.White;
            ellipse1.LineStyle.LineColor = Color.DarkGray;
            ellipse1.FillStyle.Type      = FillStyleType.LinearGradient;
            AddLabel(ellipse1, "Ellipse", Position.Center);
            diagram1.Model.AppendChild(ellipse1);

            Polygon poly = new Polygon(new PointF[] { new PointF(160, 235), new PointF(100, 265), new PointF(120, 325), new PointF(200, 325), new PointF(220, 265) });

            poly.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            poly.FillStyle.ForeColor = Color.White;
            poly.FillStyle.Type      = FillStyleType.LinearGradient;
            poly.LineStyle.LineColor = Color.DarkGray;
            AddLabel(poly, "Polygon", Position.Center);
            diagram1.Model.AppendChild(poly);

            SemiCircle semiCircle = new SemiCircle(400, 125, 120, 75);

            semiCircle.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            semiCircle.FillStyle.ForeColor = Color.White;
            semiCircle.FillStyle.Type      = FillStyleType.LinearGradient;
            semiCircle.LineStyle.LineColor = Color.DarkGray;
            AddLabel(semiCircle, "SemiCircle", Position.Center);
            diagram1.Model.AppendChild(semiCircle);

            TextNode textNode = new TextNode("TextNode1", new RectangleF(400, 245, 120, 50));

            textNode.FontStyle.Size       = 9;
            textNode.FontStyle.Family     = "Segoe UI";
            textNode.HorizontalAlignment  = StringAlignment.Center;
            textNode.VerticalAlignment    = StringAlignment.Center;
            textNode.LineStyle.LineColor  = Color.DarkGray;
            textNode.FontColorStyle.Color = Color.Black;
            diagram1.Model.AppendChild(textNode);

            RichTextNode richTextNode = new RichTextNode(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Meiryo UI;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
{\colortbl ;\red255\green0\blue0;\red0\green64\blue128;}
\viewkind4\uc1\pard\b\f0\fs17 This is a text symbol\f1  \b0\f0 designed using the \cf1\b\i Essential Diagram\i0  \cf2\ul RichText\ulnone  node\cf0\b0 .\par
\i\f1\fs20\par
}", new RectangleF(400, 320, 120, 100));

            richTextNode.LineStyle.LineColor = Color.DarkGray;
            diagram1.Model.AppendChild(richTextNode);

#if !NETCORE
            BitmapNode bmpNode = new BitmapNode(@"..\..\..\..\..\..\common\Images\Diagram\OrgChart Layout\image3.png");
#else
            BitmapNode bmpNode = new BitmapNode(@"..\..\..\..\..\..\..\common\Images\Diagram\OrgChart Layout\image3.png");
#endif
            bmpNode.Name                = "BitmapNode1";
            bmpNode.PinPoint            = new PointF(700, 75);
            bmpNode.Size                = new SizeF(120, 100);
            bmpNode.LineStyle.LineWidth = 0;
            diagram1.Model.AppendChild(bmpNode);

            ClosedCurveNode curve = new ClosedCurveNode(new PointF[] { new PointF(120, 350), new PointF(120, 450), new PointF(220, 400) });
            curve.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            curve.FillStyle.ForeColor = Color.White;
            curve.FillStyle.Type      = FillStyleType.LinearGradient;
            curve.LineStyle.LineColor = Color.DarkGray;
            AddLabel(curve, "ClosedCurve", Position.Center);
            diagram1.Model.AppendChild(curve);

            CurveNode curve1 = new CurveNode(new PointF[] { new PointF(120, 100), new PointF(120, 200), new PointF(220, 150) });
            curve1 = new CurveNode(new PointF[] { new PointF(0, 30), new PointF(4.99999952f, 25), new PointF(18.3333321f, 0), new PointF(30, 0), new PointF(41.66666641f, 0), new PointF(58.33333321f, 30), new PointF(70, 30), new PointF(81.66666f, 30), new PointF(95, 4.99999952f), new PointF(100, 0) });
            AddLabel(curve1, "CurveNode", Position.Center);
            diagram1.Model.AppendChild(curve1);

            CircularArc circular = new CircularArc(new RectangleF(640, 150, 100, 100), 0, 270);
            circular.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            circular.FillStyle.ForeColor = Color.White;
            circular.FillStyle.Type      = FillStyleType.LinearGradient;
            circular.LineStyle.LineColor = Color.DarkGray;
            circular.PinPoint            = new PointF(700, 200);
            AddLabel(circular, "CircularArc", Position.Center);
            diagram1.Model.AppendChild(circular);

            Line line1 = new Line(new PointF(700, 320), new PointF(700, 430));
            line1.LineStyle.LineColor = Color.DarkGray;
            AddLabel(line1, "line", Position.TopCenter);
            diagram1.Model.AppendChild(line1);

            PolylineNode polyLine = new PolylineNode(new PointF[] { new PointF(640, 500), new PointF(760, 500), new PointF(640, 540), new PointF(760, 540) });
            polyLine.LineStyle.LineColor = Color.DarkGray;
            polyLine.LineStyle.LineWidth = 1;
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(polyLine, "PolyLine Node");
            label.OffsetX              = polyLine.BoundingRectangle.Width / 5f;
            label.OffsetY              = polyLine.BoundingRectangle.Height + 10;
            label.FontStyle.Family     = "Segoe UI";
            label.FontColorStyle.Color = Color.Black;
            label.FontStyle.Size       = 9;
            polyLine.Labels.Add(label);
            diagram1.Model.AppendChild(polyLine);

            BezierCurve bezier = new BezierCurve(new PointF[] { new PointF(100, 470), new PointF(160, 470), new PointF(160, 560), new PointF(220, 560) });
            AddLabel(bezier, "BezierCurve", Position.BottomCenter);
            diagram1.Model.AppendChild(bezier);

            SplineNode spline = new SplineNode(new PointF[] { new PointF(400, 460), new PointF(520, 500), new PointF(400, 520) });
            spline.LineStyle.LineColor = Color.Black;
            spline.LineStyle.LineWidth = 1;
            AddLabel(spline, "Spline", Position.BottomCenter);
            diagram1.Model.AppendChild(spline);
        }
Example #4
0
    public GridSymbols(string[] plan, string[] actual, string tip)
    {
        int x = 0;

        for (int i = 0; i < 12; i++)
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle numRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(x, 0, 20, 25f);
            numRect.FillStyle.Color = Color.White;
            this.AppendChild(numRect);

            switch (plan[i])
            {
            case "P-0":
                SymbolDoubleRect symbol = new SymbolDoubleRect();
                symbol.PinPoint = new PointF(x + symbol.BoundingRectangle.Width / 2 + 2.5f, symbol.BoundingRectangle.Height / 2 + 2.5f);
                this.AppendChild(symbol);
                break;

            case "P-1":
                Polygon triangle = getTriangle();
                triangle.PinPoint = new PointF(x + triangle.BoundingRectangle.Width / 2, triangle.BoundingRectangle.Height / 2 + 5f);
                this.AppendChild(triangle);
                break;

            case "P-2":
                PolylineNode poly = getPolyLine();
                poly.PinPoint = new PointF(x + poly.BoundingRectangle.Width / 2, poly.BoundingRectangle.Height / 2 + 2.5f);
                this.AppendChild(poly);
                break;

            case "P-3":
                SymbolDoubleEllipse dcircle = new SymbolDoubleEllipse();
                dcircle.PinPoint = new PointF(x + dcircle.BoundingRectangle.Width / 2, dcircle.BoundingRectangle.Height / 2 + 2.5f);
                this.AppendChild(dcircle);
                break;

            case "P-4":
                Polygon star = getStar();
                star.PinPoint = new PointF(x + star.BoundingRectangle.Width / 2, star.BoundingRectangle.Height / 2 + 2.5f);
                this.AppendChild(star);
                break;
            }
            x += 20;
        }

        x = 0;
        for (int i = 0; i < 12; i++)
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle numRect = new Syncfusion.Windows.Forms.Diagram.Rectangle(x, 25f, 20, 25f);
            numRect.FillStyle.Color = Color.White;
            this.AppendChild(numRect);

            switch (actual[i])
            {
            case "A-0":
                Ellipse green = getEllipse(x + 3, -45f, Color.Green);
                this.AppendChild(green);
                break;

            case "A-1":
                Ellipse yellow = getEllipse(x + 3, -45f, Color.Yellow);
                this.AppendChild(yellow);
                break;

            case "A-2":
                Ellipse red = getEllipse(x + 3, -45f, Color.Red);
                this.AppendChild(red);
                break;

            case "A-3":
                Ellipse blue = getEllipse(x + 3, -45f, Color.Blue);
                this.AppendChild(blue);
                break;
            }
            x += 20;
        }
        Syncfusion.Windows.Forms.Diagram.Rectangle HeadContent = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, -4, 100, 8);
        HeadContent.FillStyle.Color = Color.LightYellow;
        Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label();
        lbl.Text           = tip;
        lbl.SizeToNode     = true;
        lbl.Position       = Position.Center;
        lbl.FontStyle.Size = 10;
        HeadContent.Labels.Add(lbl);
        this.AppendChild(HeadContent);
        this.EditStyle.AllowSelect = false;
    }