public List <Plots> Rotate90(List <Plots> plots) { string path = "rotated_plots.txt"; List <Plots> rotated90plots = new List <Plots>(); for (int i = 0; i < plots.Count - 1; i++) { Plots rotatingPlot = plots[i]; rotated90plots.Add(rotatingPlot); Plots bitterPlot = rotated90plots[i]; bitterPlot.x1 = rotatingPlot.x1 + rotatingPlot.Height - rotatingPlot.Width; bitterPlot.y1 = rotatingPlot.y1 + rotatingPlot.Height - rotatingPlot.Width; } List <Plots> mirroredPlots = new List <Plots>(); for (int i = 0; i < plots.Count - 1; i++) { Plots mirroringPlot = plots[i]; mirroredPlots.Add(mirroringPlot); Plots mirrorPLot = mirroredPlots[i]; mirrorPLot.x1 = mirroringPlot.x1 - (mirroringPlot.Width * 2); mirrorPLot.y1 = mirroringPlot.y1 - (mirroringPlot.Width * 2); } using (StreamWriter rotate90writer = new StreamWriter(path)) { foreach (Plots rotatedPlot in rotated90plots) { rotate90writer.WriteLine("Rotated: {0},{1}", rotatedPlot.x1, rotatedPlot.y1); } } return(rotated90plots); }
public List <Plots> Rotate180(List <Plots> plots) { string path = "rotated_plots.txt"; List <Plots> mirroredPlots = new List <Plots>(); for (int i = 0; i < plots.Count - 1; i++) { Plots mirroringPlot = plots[i]; mirroredPlots.Add(mirroringPlot); Plots mirrorPLot = mirroredPlots[i]; mirrorPLot.x1 = mirroringPlot.x1 - (mirroringPlot.Width * 2); mirrorPLot.y1 = mirroringPlot.y1 - (mirroringPlot.Width * 2); } if (File.Exists(path)) { using (StreamWriter mirroredWriter = new StreamWriter(path)) { foreach (Plots flippedPlot in mirroredPlots) { mirroredWriter.WriteLine("Mirrored: {0},{1}", flippedPlot.x1, flippedPlot.y1); } } } return(mirroredPlots); }
public void CreatePlot(string[] ArrayOfPlotPoints) { List<int> PlotPoints = new List<int>(); for (int i = 0; i < ArrayOfPlotPoints.Length; i++) { PlotPoints.Add(Convert.ToInt32(ArrayOfPlotPoints[i])); } int x1 = (PlotPoints[0] + PlotPoints[3]); int y1 = (PlotPoints[1] + PlotPoints[2]); Plots plot = new Plots(PlotPoints[0], PlotPoints[1], PlotPoints[2], PlotPoints[3]); plots.Add(plot); }
public void CreatePlot(string[] ArrayOfPlotPoints) { List <int> PlotPoints = new List <int>(); for (int i = 0; i < ArrayOfPlotPoints.Length; i++) { PlotPoints.Add(Convert.ToInt32(ArrayOfPlotPoints[i])); } int x1 = (PlotPoints[0] + PlotPoints[3]); int y1 = (PlotPoints[1] + PlotPoints[2]); Plots plot = new Plots(PlotPoints[0], PlotPoints[1], PlotPoints[2], PlotPoints[3]); plots.Add(plot); }