Exemple #1
0
        public void RdButtonClicked(Data data, object sender, Color lineColor)
        {
            if (Lineded == false)
            {
                SaveFirstPoint(sender);
            }
            else if ((sender as RadioButton).Name == Vertex1.ToString())
            {
                MessageBox.Show("Нельзя провести линию в ту же точку", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Lineded = false;
            }
            else
            {
                SaveSecondPoint(sender);

                if (data.Edges[Vertex1].Contains(Vertex2))
                {
                    MessageBox.Show("Нельзя дважды провести линию", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Lineded = false;
                }
                else
                {
                    CreateLine(data, lineColor);
                }
            }
        }
        public void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Vertices/Vertex1", true, out subEle);
            subEle.Value = Vertex1.ToString();

            ele.TryPathTo("Vertices/Vertex2", true, out subEle);
            subEle.Value = Vertex2.ToString();

            ele.TryPathTo("Vertices/Vertex3", true, out subEle);
            subEle.Value = Vertex3.ToString();

            ele.TryPathTo("Edges/Vertices1_2", true, out subEle);
            subEle.Value = EdgeVertices1_2.ToString();

            ele.TryPathTo("Edges/Vertices2_3", true, out subEle);
            subEle.Value = EdgeVertices2_3.ToString();

            ele.TryPathTo("Edges/Vertices3_1", true, out subEle);
            subEle.Value = EdgeVertices3_1.ToString();

            ele.TryPathTo("Flags", true, out subEle);
            subEle.Value = Flags.ToString();
        }
 /// <summary>
 /// Creates a String Representation of this Triangle.
 /// </summary>
 /// <returns>String representation of this Triangle.</returns>
 public override string ToString()
 {
     return($"Vertex1: {Vertex1.ToString()} " +
            $"Vertex2: {Vertex2.ToString()} " +
            $"Vertex3: {Vertex3.ToString()} " +
            $"Normal: {_normal.ToString()} " +
            $"Area: [{_area:0.00}]");
 }