public void MakeAllOperations() { for (int i = 0; i < ListOfObjects.Count; i++) { if (ListOfObjects[i].GetType() == typeof(Poliline)) { Poliline buffer = new Poliline(); Poliline bufferFinal = new Poliline(); buffer = (Poliline)ListOfObjects[i]; for (int j = 0; j < buffer.listOfPoints.Count; j++) { bufferFinal.ourArrays.AddRow(new OurPoint(buffer.listOfPoints[j].X, buffer.listOfPoints[j].Y)); bufferFinal.listOfPoints.Add(new OurPoint(buffer.listOfPoints[j].X, buffer.listOfPoints[j].Y)); bufferFinal.StartPointX = buffer.listOfPoints[j].X; bufferFinal.StartPointY = buffer.listOfPoints[j].Y; } draw = false; bufferFinal.comeBackArray = bufferFinal.ourArrays.ToCopy(); bufferFinal.Increase(); bufferFinal.Move(200, -300); bufferFinal.Rotate(45); bufferFinal.Move(100, 440); bufferListAbstract.Add(bufferFinal); } if (ListOfObjects[i].GetType() == typeof(Circle)) { Circle buffer = new Circle(); buffer = (Circle)ListOfObjects[i]; Circle bufferFinal = new Circle(new OurPoint(buffer.Center.X, buffer.Center.Y), buffer.Radius, buffer.Angle1, buffer.Angle2); bufferFinal.Increase(); bufferFinal.Move(310, -180); bufferListAbstract.Add(bufferFinal); draw = false; } } if (bufferListAbstract.Count >= 4) { for (int i = 0; i < 3; i++) { bufferListAbstract.RemoveAt(0); } } pictureBox1.Invalidate(); }
public void MakeChoice() { for (int i = 0; i < ListOfObjects.Count; i++) { if (ListOfObjects[i].GetType() == typeof(Poliline)) { Poliline buffer = new Poliline(); Poliline bufferFinal = new Poliline(); buffer = (Poliline)ListOfObjects[i]; for (int j = 0; j < buffer.listOfPoints.Count; j++) { bufferFinal.ourArrays.AddRow(new OurPoint(buffer.listOfPoints[j].X, buffer.listOfPoints[j].Y)); bufferFinal.listOfPoints.Add(new OurPoint(buffer.listOfPoints[j].X, buffer.listOfPoints[j].Y)); bufferFinal.StartPointX = buffer.listOfPoints[j].X; bufferFinal.StartPointY = buffer.listOfPoints[j].Y; } draw = false; switch (functionMode) { case 1: { bufferFinal.comeBackArray = bufferFinal.ourArrays.ToCopy(); bufferFinal.Increase(); bufferFinal.Move(-80, -150); bufferListAbstract.Add(bufferFinal); break; } case 2: { bufferFinal.comeBackArray = bufferFinal.ourArrays.ToCopy(); bufferFinal.Move(300, -150); bufferListAbstract.Add(bufferFinal); break; } case 3: { bufferFinal.comeBackArray = bufferFinal.ourArrays.ToCopy(); bufferFinal.Rotate(45); bufferFinal.Move(-150, 280); bufferListAbstract.Add(bufferFinal); break; } } if (bufferListAbstract.Count >= 4) { for (int k = 0; k < 3; k++) { bufferListAbstract.RemoveAt(0); } } } if (ListOfObjects[i].GetType() == typeof(Circle)) { Circle buffer = new Circle(); buffer = (Circle)ListOfObjects[i]; Circle bufferFinal = new Circle(new OurPoint(buffer.Center.X, buffer.Center.Y), buffer.Radius, buffer.Angle1, buffer.Angle2); draw = false; switch (functionMode) { case 1: { bufferFinal.Increase(); bufferListAbstract.Add(bufferFinal); break; } case 2: { bufferFinal.Move(300, -150); bufferListAbstract.Add(bufferFinal); break; } case 3: { bufferFinal.Rotate(45); bufferFinal.Move(35, -10); bufferListAbstract.Add(bufferFinal); break; } } } pictureBox1.Invalidate(); } }