public Form1() { InitializeComponent(); canvas = new Bitmap(1920, 1024); Point center = new Point(bitMap.Size.Width / 2, bitMap.Size.Height / 2); vertexRectangle = new Rectangle() { Size = new Size(Vertex.radius, Vertex.radius) }; currentPolygon = new LinkedList <Vertex>(PolygonFactory.GetRegularPolygon(center, 6)); polygons = new List <LinkedList <Vertex> > { currentPolygon }; // Add initial relations Vertex v1 = currentPolygon.First.Value; var v3 = v1.next.next; _ = new EqualLengthRelation(v1, v3); _ = new EqualLengthRelation(v3.next, v3.next.next); //_ = new PerpendicularityRelation(v1.next, v3.next); centreXTextBox.Text = center.X.ToString(); centreYTextBox.Text = center.Y.ToString(); }
private void AddRelationForSelected(Vertex v1, Vertex v3) { if (v1.Locked || v1.next.Locked || v3.Locked || v3.next.Locked) { MessageBox.Show("Nie można dodać relacji dla krawędzi z zablokowanym wierzchołkiem.", "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (selectedRelationType == typeof(EqualLengthRelation)) { _ = new EqualLengthRelation(v1, v3); } else { _ = new PerpendicularityRelation(v1, v3); } }