private void Draw_main_rect(List <Color> color, int k0, int k1, int k2, int j) { var cord = 0.0; if (k1 != 0) { cord = PointsConstantCoordinatesSA[j + 3] - PointsConstantCoordinatesSA[j + 1]; } var length1 = PointsConstantCoordinatesCC.Count; var length2 = PointsConstantCoordinatesSA.Count; var y1 = height * (1 - k1 - k2) + k1 * PointsConstantCoordinatesSA[j + 1] + k2 * PointsConstantCoordinatesSA[length2 - 1]; var y2 = k2 * (1.69 * height - PointsConstantCoordinatesSA[length2 - 1]) + k1 * cord + k0 * (PointsConstantCoordinatesSA[1] - height); shapes.Draw_Rect(width, y1, PointsConstantCoordinatesCC[0] - width, y2, color[0], 1); for (var i = 0; i < PointsConstantCoordinatesCC.Count - 3; i += 2) { shapes.Draw_Rect(PointsConstantCoordinatesCC[i], y1, PointsConstantCoordinatesCC[i + 2] - PointsConstantCoordinatesCC[i], y2, color[i / 2 + 1], 1); } shapes.Draw_Rect(PointsConstantCoordinatesCC[length1 - 2], y1, width + 0.69 * height - PointsConstantCoordinatesCC[length1 - 2], y2, color[color.Count - 1], 1); }
public string DrawCurrentStateSystem() { var x = ((IntersectionPointsCurrentCoordinatesCountConnectClients.Count - 1) / 2 < 4) ? IntersectionPointsCurrentCoordinatesCountConnectClients[2] - IntersectionPointsCurrentCoordinatesCountConnectClients[0] : 0; var y = ((IntersectionPointsCurrentCoordinatesCountSameAdrress.Count - 1) / 2 < 4) ? IntersectionPointsCurrentCoordinatesCountSameAdrress[3] - IntersectionPointsCurrentCoordinatesCountSameAdrress[1] : 0; var x0 = 0.0; var y0 = 0.0; var x1 = IntersectionPointsCurrentCoordinatesCountConnectClients[0]; var x2 = IntersectionPointsCurrentCoordinatesCountConnectClients[2]; var y1 = IntersectionPointsCurrentCoordinatesCountSameAdrress[1]; var y2 = IntersectionPointsCurrentCoordinatesCountSameAdrress[3]; if (x1 > x2 && y1 > y2) { x0 = x2; y0 = y2; } else { if (x1 > x2 && y1 < y2) { x0 = x2; y0 = y1; } else { if (x1 < x2 && y1 < y2) { x0 = x1; y0 = y1; } else { if (x1 < x2 && y1 > y2) { x0 = x1; y0 = y2; } } } } shapes.Draw_Rect(x0, y0, x, y, Colors.Red, 0.3); var middle_x = x0 + x / 2; var middle_y = y0 + y / 2; var name_gr1 = Find(IntersectionPointsConstantCoordinatesCountConnectClients, middle_x, 0); var name_gr2 = Find(IntersectionPointsConstantCoordinatesCountSameAdrress, middle_y, 1); return(Namearea(Namegraph(ListNameSameAdrress[name_gr2 + 1]) * 10 + Namegraph(ListNameConnectClients[name_gr1 + 1])).ToString()); }