Exemplo n.º 1
0
        public override void Draw(Graphics2D graphics)
        {
            System.Drawing.Graphics g = graphics.Graphics;
            Pen penPath = new Pen(new SolidBrush(TopFace.ColorPath));

            // get points
            Point[] ptsFace = graphics.TransformPoint(TopFace.Points);

            // draw solid face
            Brush brushSolid = new SolidBrush(TopFace.ColorFill);

            g.FillPolygon(brushSolid, ptsFace);
            g.DrawPolygon(penPath, ptsFace);
            // draw box tape
            if (TapeWidth.Activated)
            {
                // instantiate brush
                Brush brushTape = new SolidBrush(TapeColor);
                // fill polygon
                Point[] ptsTape = graphics.TransformPoint(TapePoints);
                g.FillPolygon(brushTape, ptsTape);
                g.DrawPolygon(penPath, ptsTape);
            }
            // orientation mark
            if (ShowOrientationMark)
            {
                Pen      penPathOrientationMark = new Pen(new SolidBrush(OrientationMarkColor), 5.0F);
                Vector3D pt0           = TopFace.Points[0];
                Vector3D pt1           = TopFace.Points[1];
                double   offset        = 0.1 * (pt1 - pt0).GetLength();
                Point[]  ptsOrientMark = graphics.TransformPoint(new Vector3D[] { pt0 + new Vector3D(offset, offset, 0.0), pt1 + new Vector3D(-offset, offset, 0.0) });
                g.DrawLine(penPathOrientationMark, ptsOrientMark[0], ptsOrientMark[1]);
            }
        }
Exemplo n.º 2
0
 public override void Draw(Graphics2D graphics)
 {
     System.Drawing.Graphics g = graphics.Graphics;
     // get points
     Point[] ptOuter = graphics.TransformPoint(MaxRadiusPoints);
     // max radius / top view
     g.FillPolygon(new SolidBrush(Color), ptOuter);
     // bottom (draw only path)
     g.DrawPolygon(new Pen(new SolidBrush(ColorPath)), ptOuter);
 }
Exemplo n.º 3
0
        public override void Draw(Graphics2D graphics)
        {
            System.Drawing.Graphics g = graphics.Graphics;
            Pen penPath = new Pen(new SolidBrush(TopFace.ColorPath));

            // get points
            Point[] pt = graphics.TransformPoint(TopFace.Points);

            // draw solid face
            Brush brushSolid = new SolidBrush(TopFace.ColorFill);

            g.FillPolygon(brushSolid, pt);
            g.DrawPolygon(penPath, pt);
            // draw box tape
            if (TapeWidth.Activated)
            {
                // instantiate brush
                Brush brushTape = new SolidBrush(TapeColor);
                // fill polygon
                Point[] pts = graphics.TransformPoint(TapePoints);
                g.FillPolygon(brushTape, pts);
                g.DrawPolygon(penPath, pts);
            }
        }
Exemplo n.º 4
0
        public override void Draw(Graphics2D graphics)
        {
            System.Drawing.Graphics g = graphics.Graphics;

            // get points
            Point[] ptOuter = graphics.TransformPoint(TopPoints);;
            Point[] ptInner = graphics.TransformPoint(TopPointsInner);;

            // top color
            Brush brushSolid = new SolidBrush(ColorTop);

            g.FillPolygon(brushSolid, ptOuter);
            if (null != ptInner)
            {
                // hole -> drawing polygon with background color
                Brush brushBackground = new SolidBrush(graphics.ColorBackground);
                g.FillPolygon(brushBackground, ptInner);
            }
            // bottom (draw only path)
            Brush brushPath = new SolidBrush(ColorPath);
            Pen   penPath   = new Pen(brushPath);

            g.DrawPolygon(penPath, ptOuter);
        }