/// <summary>
        /// 刷新显示坐标系中所有的元素坐标
        /// </summary>
        public void refreshGeometrys()
        {
            foreach (OutputPoint outputPoint in outputPointList)
            {
                outputPoint.viewPoint = ToVector2(outputPoint.point);
            }
            int            i = 0;
            OutputGeometry outputGeometry;

            while (i < outputPointSetList.Count)
            {
                outputGeometry = outputPointSetList[i];
                if (outputGeometry is OutputPoint)
                {
                    throw new Exception("不可能触发的异常");
                }
                else if (outputGeometry is OutputLine)
                {
                    OutputLine outLine = outputGeometry as OutputLine;
                    Line       line    = outLine.line;
                    if (line.lineRely == LineRely.Normal)                    //两点生成
                    {
                        if (line.type == LineType.Line)                      //线段
                        {
                            if (!(outputPointSetList[i + 1] is OutputLine))
                            {
                                throw new Exception();
                            }
                            if ((outputPointSetList[i + 1] as OutputLine).line != line)
                            {
                                throw new Exception();
                            }

                            Vector2 v1 = ToVector2(line.p1);
                            Vector2 v2 = ToVector2(line.p2);
                            Vector2 v3 = new Vector2();
                            Vector2 v4 = new Vector2();

                            if (v1.X == v2.X)                //竖线
                            {
                                v3.X = v1.X;
                                v3.Y = 0;
                                v4.X = v1.X;
                                v4.Y = WindowHeight;
                            }
                            else if (Math.Abs(v2.Y - v1.Y) > Math.Abs(v2.X - v1.X))
                            {
                                v3.X = v1.X - v1.Y * (v1.X - v2.X) / (v1.Y - v2.Y);
                                v3.Y = 0;
                                v4.X = (WindowHeight - v1.Y) / (v2.Y - v1.Y) * v2.X + (v2.Y - WindowHeight) / (v2.Y - v1.Y) * v1.X;
                                v4.Y = WindowHeight;
                            }
                            else if (Math.Abs(v2.Y - v1.Y) <= Math.Abs(v2.X - v1.X))
                            {
                                v3.X = WindowWidth;
                                v3.Y = (WindowWidth - v1.X) / (v2.X - v1.X) * v2.Y + (v2.X - WindowWidth) / (v2.X - v1.X) * v1.Y;
                                v4.X = 0;
                                v4.Y = v1.Y - v1.X * (v1.Y - v2.Y) / (v1.X - v2.X);
                            }
                            else
                            {
                                throw new Exception();
                            }

                            OutputLine outputLineNew = new OutputLine()
                            {
                                borderType        = ViewType.Solid,
                                isVisible         = true,
                                fillColor         = Color.FromArgb(255, 76, 123, 207),
                                lineColor         = Color.FromArgb(255, 76, 123, 207),
                                line              = line,
                                selectedFillColor = Color.FromArgb(255, 130, 91, 230),
                                selectedLineColor = Color.FromArgb(255, 255, 99, 91),
                                thickness         = 8,
                                p1 = v1,
                                p2 = v2,
                            };

                            OutputLine outputLineStraightNew = new OutputLine()
                            {
                                borderType        = ViewType.Solid,
                                isVisible         = true,
                                fillColor         = Color.FromArgb(128, 86, 106, 143),
                                lineColor         = Color.FromArgb(128, 86, 106, 143),
                                line              = line,
                                selectedFillColor = Color.FromArgb(128, 86, 106, 143),
                                selectedLineColor = Color.FromArgb(128, 86, 106, 143),
                                thickness         = 8,
                                p1 = v3,
                                p2 = v4,
                            };
                            line.resultLine.Clear();
                            line.resultLine.Add(outputLineStraightNew);                //先画延长线
                            outputPointSetList[i] = outputLineStraightNew;

                            line.resultLine.Add(outputLineNew);                        //覆盖线段
                            outputPointSetList[i + 1] = outputLineNew;
                            i = i + 2;
                        }
                    }
                }
                else if (outputGeometry is OutputCircle)
                {
                    OutputCircle outputCircle = outputGeometry as OutputCircle;
                    outputCircle.center = ToVector2(outputCircle.circle.center);
                    outputCircle.radius = (ToVector2(outputCircle.circle.center) - ToVector2(outputCircle.circle.radius)).Length();
                    i++;
                }
            }
        }
        /// <summary>
        /// 增加某一条直线的投影
        /// </summary>
        /// <param name="line">被投影的直线</param>
        /// <returns></returns>
        public int AddLine(Line line)
        {
            if (line.lineRely == LineRely.Normal)                    //两点生成
            {
                if (line.type == LineType.Line)                      //直线
                {
                    Vector2 v1 = ToVector2(line.p1);
                    Vector2 v2 = ToVector2(line.p2);
                    Vector2 v3 = new Vector2();
                    Vector2 v4 = new Vector2();

                    if (v1.X == v2.X)                //竖线
                    {
                        v3.X = v1.X;
                        v3.Y = 0;
                        v4.X = v1.X;
                        v4.Y = WindowHeight;
                    }
                    else if (Math.Abs(v2.Y - v1.Y) > Math.Abs(v2.X - v1.X))
                    {
                        v3.X = v1.X - v1.Y * (v1.X - v2.X) / (v1.Y - v2.Y);
                        v3.Y = 0;
                        v4.X = (WindowHeight - v1.Y) / (v2.Y - v1.Y) * v2.X + (v2.Y - WindowHeight) / (v2.Y - v1.Y) * v1.X;
                        v4.Y = WindowHeight;
                    }
                    else if (Math.Abs(v2.Y - v1.Y) <= Math.Abs(v2.X - v1.X))
                    {
                        v3.X = WindowWidth;
                        v3.Y = (WindowWidth - v1.X) / (v2.X - v1.X) * v2.Y + (v2.X - WindowWidth) / (v2.X - v1.X) * v1.Y;
                        v4.X = 0;
                        v4.Y = v1.Y - v1.X * (v1.Y - v2.Y) / (v1.X - v2.X);
                    }
                    else
                    {
                        throw new Exception();
                    }
                    float length12 = (v1 - v2).Length();

                    OutputLine outputLine = new OutputLine()
                    {
                        borderType        = ViewType.Solid,
                        isVisible         = true,
                        fillColor         = Color.FromArgb(255, 76, 123, 207),
                        lineColor         = Color.FromArgb(255, 76, 123, 207),
                        line              = line,
                        selectedFillColor = Color.FromArgb(255, 130, 91, 230),
                        selectedLineColor = Color.FromArgb(255, 255, 99, 91),
                        thickness         = 8,
                        p1 = v1,
                        p2 = v2,
                    };

                    OutputLine outputLineStraight = new OutputLine()
                    {
                        borderType        = ViewType.Solid,
                        isVisible         = true,
                        fillColor         = Color.FromArgb(128, 86, 106, 143),
                        lineColor         = Color.FromArgb(128, 86, 106, 143),
                        line              = line,
                        selectedFillColor = Color.FromArgb(128, 86, 106, 143),
                        selectedLineColor = Color.FromArgb(128, 86, 106, 143),
                        thickness         = 8,
                        p1 = v3,
                        p2 = v4,
                    };

                    line.resultLine.Add(outputLineStraight);                //先画延长线
                    outputPointSetList.Add(outputLineStraight);

                    line.resultLine.Add(outputLine);                        //覆盖线段
                    outputPointSetList.Add(outputLine);

                    return(1);
                }
            }

            return(0);
        }