Beispiel #1
0
        internal void DrawMirrorAxis(List <IssoPoint2D> mirrorAxis, SKCanvas canvas)
        {
            SKPaint dashPaint = new SKPaint()
            {
                Style      = SKPaintStyle.Stroke,
                Color      = Color.AliceBlue.ToSKColor(),
                PathEffect = SKPathEffect.CreateDash(new Single[2] {
                    surface.ViewHeight / 100, surface.ViewHeight / 100
                }, surface.ViewHeight / 80),
                IsAntialias = true,
                StrokeWidth = 1
            };
            SKPoint pt1 = IssoConvert.IssoPoint2DToSkPoint(mirrorAxis[0], surface.ScaleFactor, surface.Origin, surface.ViewHeight);
            SKPoint pt2 = IssoConvert.IssoPoint2DToSkPoint(mirrorAxis[1], surface.ScaleFactor, surface.Origin, surface.ViewHeight);

            canvas.DrawLine(pt1.X, pt1.Y, pt2.X, pt2.Y, dashPaint);

            // Рисуем то, как будет выглядеть отражение
            dashPaint.PathEffect = null;
            foreach (ComponentLinear c in SelectedBeams)
            {
                IssoPoint2D p1 = IssoDist.MirrorPoint(c.Start, mirrorAxis[0], mirrorAxis[1]);
                IssoPoint2D p2 = IssoDist.MirrorPoint(c.End, mirrorAxis[0], mirrorAxis[1]);
                pt1 = IssoConvert.IssoPoint2DToSkPoint(p1, surface.ScaleFactor, surface.Origin, surface.ViewHeight);
                pt2 = IssoConvert.IssoPoint2DToSkPoint(p2, surface.ScaleFactor, surface.Origin, surface.ViewHeight);

                canvas.DrawLine(pt1.X, pt1.Y, pt2.X, pt2.Y, dashPaint);
            }
        }
Beispiel #2
0
        private ComponentNode MirrorNode(IssoPoint2D point, List <ComponentBasic> newElements)
        {
            IssoPoint2D pt = IssoDist.MirrorPoint(point, surface.MirrorAxis[0], surface.MirrorAxis[1]);

            IssoPoint2D   ptout;
            ComponentNode nd = (ComponentNode)GetComponent(pt, out ptout, ComponentTypes.ctNode);

            if (nd == null)
            {
                nd = new ComponentNode(pt);
                newElements.Add(nd);
            }
            return(nd);
        }