public void SetTriangle(ITriangle tri) { if (tri != null) { lbTriangle.Text = tri.ID.ToString(); lbV0.Text = tri.GetVertexID(0).ToString(); lbV1.Text = tri.GetVertexID(1).ToString(); lbV2.Text = tri.GetVertexID(2).ToString(); lbN0.Text = tri.GetNeighborID(0).ToString(); lbN1.Text = tri.GetNeighborID(1).ToString(); lbN2.Text = tri.GetNeighborID(2).ToString(); lbS0.Text = GetSegmentString(tri.GetSegment(0)); lbS1.Text = GetSegmentString(tri.GetSegment(1)); lbS2.Text = GetSegmentString(tri.GetSegment(2)); } else { lbTriangle.Text = "-"; lbV0.Text = "-"; lbV1.Text = "-"; lbV2.Text = "-"; lbN0.Text = "-"; lbN1.Text = "-"; lbN2.Text = "-"; lbS0.Text = "-"; lbS1.Text = "-"; lbS2.Text = "-"; } }
private void RenderSelectedTriangle(Graphics g) { if (currentTri != null) { var p = new PointF[3]; p[0] = points[currentTri.GetVertexID(0)]; p[1] = points[currentTri.GetVertexID(1)]; p[2] = points[currentTri.GetVertexID(2)]; zoom.WorldToScreen(ref p[0]); zoom.WorldToScreen(ref p[1]); zoom.WorldToScreen(ref p[2]); g.FillPolygon(SelectedTriangle, p); } }