private void On_MainForm_Load(object sender, EventArgs e) { InitializeDirectX(); basePoint = new Vertex((float)Width / 2, (float)Height / 2); polyShape = new BaseShape(); moveStartPoint = basePoint; lightSource = new Vertex(-1000, 0, 0); // var cube = new Cube(new Vertex(basePoint.X - 300, basePoint.Y + 100, basePoint.Z), 200); //var cube = new Cube(basePoint, 200); //var pyramid = new Pyramid(basePoint, 4, 150, 300); var cone = new Cone(basePoint, 150, -300); //var pyramidReverse = new Pyramid(new Vertex(basePoint.X - 100, basePoint.Y, basePoint.Z + 300), 9, 50, -100); //var axises = new CoordinateAxises(basePoint); //var cylinder = new Cylinder(basePoint, 100, 200); //var cylinderReverse = new Cylinder(new Vertex(basePoint.X - 100, basePoint.Y, basePoint.Z), 100, -200); //var prizm = new Prizm(basePoint, 3, (float)(200 / Math.Sqrt(2.0F)), -200); objectsToDraw = S.DeserializeShapes(PATHTO_SERIALIZED_STATE) ?? new List <BaseShape> { new CoordinateAxises(basePoint) }; //objectsToDraw.Add(pyramid); objectsToDraw.Add(cone); //objectsToDraw.Add(prizm); //objectsToDraw.Add(pyramidReverse); //objectsToDraw.Add(cylinder); //objectsToDraw.Add(cylinderReverse); //objectsToDraw.Add(cube); SaveObjectsState(objectsToDraw); On_MainForm_Paint(null, null); }
private void On_miReload_Click(object sender, EventArgs e) { objectsToDraw = S.DeserializeShapes(PATHTO_SERIALIZED_STATE); On_MainForm_Paint(null, null); }
private void On_miSave_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; S.SerializeShapes(PATHTO_SERIALIZED_STATE, objectsToDraw); Cursor.Current = Cursors.Default; }