public Figure CreateFigure() { PolygonDrawer drawer = new PolygonDrawer(); RectangleUpdater updater = new RectangleUpdater(); RegularMover mover = new RegularMover(); RegularRotator rotator = new RegularRotator(); RegularScaler scaler = new RegularScaler(); Figure figure = new Figure(drawer, scaler, updater, mover, rotator); return(figure); }
private void UpdateInit() { Circle3D circle3d = generalFiguresList[iterator] as Circle3D; if (circle3d != null) { figureName = "circle"; } Rectangle3D rectangle3d = generalFiguresList[iterator] as Rectangle3D; if (rectangle3d != null) { if (rectangle3d.figureType == 3) { figureName = "triang"; } else { figureName = "rectan"; } } Custom3D custom3d = generalFiguresList[iterator] as Custom3D; if (custom3d != null) { figureName = "custom"; } switch (figureName) { case "circle": Circle3D circle3D = (Circle3D)generalFiguresList[iterator]; CircleUpdater circleUpdater = new CircleUpdater(circle3D, model3DGroup, generalFiguresList); break; case "rectan": Rectangle3D rectangle3D = (Rectangle3D)generalFiguresList[iterator]; RectangleUpdater rectangleUpdater = new RectangleUpdater(rectangle3D, model3DGroup, generalFiguresList); break; case "triang": Rectangle3D triangle3D = (Rectangle3D)generalFiguresList[iterator]; TriangleUpdater triangleUpdater = new TriangleUpdater(triangle3D, model3DGroup, generalFiguresList); break; case "custom": Custom3D custom3D = (Custom3D)generalFiguresList[iterator]; CustomUpdater customUpdater = new CustomUpdater(custom3D, model3DGroup, generalFiguresList); break; } }