Example #1
0
            public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
            {
                if (_lineRendeE == null)
                {
                    VertexStore strokeVxs = new VertexStore();
                    VectorToolBox.GetFreeVxs(out var vxs);
                    VectorToolBox.GetFreeStroke(out var stroke, 3);

                    vxs.AddMoveTo(p0.Left, p0.Top);
                    vxs.AddLineTo(p1.Left, p1.Top);

                    stroke.MakeVxs(vxs, strokeVxs);
                    //---
                    //convert data in vxs to GraphicPath
                    //---

                    _lineRendeE         = new LineRenderElement(rootgfx, 10, 10);
                    _lineRendeE._stroke = new VxsRenderVx(strokeVxs);

                    _lineRendeE.X0 = p0.Left;
                    _lineRendeE.Y0 = p0.Top;
                    _lineRendeE.X1 = p1.Left;
                    _lineRendeE.Y1 = p1.Top;


                    VectorToolBox.ReleaseVxs(ref vxs);

                    VectorToolBox.ReleaseStroke(ref stroke);
                }
                return(_lineRendeE);
            }
Example #2
0
            public override RenderElement GetPrimaryRenderElement(RootGraphic rootgfx)
            {
                if (_lineRendeE == null)
                {
                    using (VectorToolBox.Borrow(out PixelFarm.CpuBlit.VertexProcessing.Stroke stroke))
                        using (VxsTemp.Borrow(out var vxs, out var strokeVxs))
                        {
                            stroke.Width = 3;
                            vxs.AddMoveTo(p0.Left, p0.Top);
                            vxs.AddLineTo(p1.Left, p1.Top);
                            stroke.MakeVxs(vxs, strokeVxs);
                            //---
                            //convert data in vxs to GraphicPath                         //---

                            _lineRendeE         = new LineRenderElement(rootgfx, 10, 10);
                            _lineRendeE._stroke = new VxsRenderVx(strokeVxs);

                            _lineRendeE.X0 = p0.Left;
                            _lineRendeE.Y0 = p0.Top;
                            _lineRendeE.X1 = p1.Left;
                            _lineRendeE.Y1 = p1.Top;
                        }
                }
                return(_lineRendeE);
            }
            public override RenderElement GetPrimaryRenderElement()
            {
                if (_lineRendeE == null)
                {
                    using (Tools.BorrowStroke(out var stroke))
                        using (Tools.BorrowVxs(out var vxs, out var strokeVxs))
                        {
                            stroke.Width = 3;
                            vxs.AddMoveTo(p0.Left, p0.Top);
                            vxs.AddLineTo(p1.Left, p1.Top);
                            stroke.MakeVxs(vxs, strokeVxs);
                            //---
                            //---

                            _lineRendeE         = new LineRenderElement(10, 10);
                            _lineRendeE._stroke = new VxsRenderVx(strokeVxs);

                            _lineRendeE.X0 = p0.Left;
                            _lineRendeE.Y0 = p0.Top;
                            _lineRendeE.X1 = p1.Left;
                            _lineRendeE.Y1 = p1.Top;
                        }
                }
                return(_lineRendeE);
            }
Example #4
0
 public ClassDiagramNode(ClassStructure codestructure, BasicNodeStructure structure, RectangleRenderElementStyle border_style) : base(structure, border_style)
 {
     CodeStructure = codestructure;
     NameTextBox   = new TextBoxNode(new BasicTextNodeStructure(Position, Renderer.GetTextWidth(Name.Length), Renderer.SingleTextHeight, Name), TextRenderElementStyle.Default, RectangleRenderElementStyle.Textbox);
     NameLine      = new LineRenderElement(new Vector(Position.X, Position.Y + Renderer.SingleTextHeight), new Vector(Position.X + Width, Position.Y + Renderer.SingleTextHeight), 1, Color.Black);
     SeparatorLine = new LineRenderElement(new Vector(Position.X, Position.Y + Renderer.SingleTextHeight), new Vector(Position.X + Width, Position.Y + Renderer.SingleTextHeight), 1, Color.Black);
     Children.Add(NameTextBox);
     GeneratePrefab();
     RepositionChildren();
     SetEvents();
 }