CS-560, Assignment # 7 Due Date: 4/26/02 In this assignment you are do write a Visual C++ MFC program that allows the user to draw, modify, extend, and transform a B-Spline curve. There should be a menu with the following items: "B-Spline", "Translate", "Scale", "Rotate", "Extend". When the user selects "B-Spline" the user should be allowed to input any number of control points with the mouse. Each click of the left-hand mouse button provides a new control point, which should be drawn as a small rectangle on the screen. A click of the right mouse button should then cause the program to draw the uniform cubic B-spline polynomial curve determined by the control points that were entered. After the B-Spline is drawn, the program should enter a mode in which it permits the user to use the left-hand mouse button to adjust the curve by moving any of its control points. Pressing the left-hand mouse button over a control point selects that point. While the button is down, the user moves the mouse to the new position of the control point. Releasing the left- hand button should cause the control point's rectangle to be repositioned at the new cursor location and the B-Spline curve to be redrawn. (The old control point and curve should, of course, disappear.) The user should be able to perform this readjustment of the curve as many times as desired with any of the control points. A click of the right-hand mouse button should permit the user to go back to the menu to choose another option. If you wish (preferably), you may implement the adjustment of the curve using a "rubberband" technique in which the curve stretches and contracts while the user is moving a control point with the left-hand mouse button down. The curve should be made "permanent" when the user releases the left mouse button. This adjustment of the curve by moving selected control points should continue until the user selects some other menu item. Regardless of which way you do the adjustment of the curve, for enhanced performance, the forward difference method discussed in class must be used any time the curve is plotted. "Translate"--Choosing this menu item should enable the user to translate the B-Spline curve in the drawing area. Subsequently the user should be permitted to click somewhere in the drawing area. The point selected will be the new location of the first (P0) control point of the B-Spline curve. The program will then move P0 to the selected location and all the other control points will then be translated by an equal amount. Finally the curve will be redrawn according to the new locations of the control points. "Scale" or "Rotate" menu items should enable the user to change the size or orientation of the B-Spline curve. Selecting either of these two menu items should allow the user to click on some point in the drawing area. The curve should then be scaled with respect to that point or rotated about that point by a fixed amount. The details of how this is done are up to you. Try to make it as intuitive and user friendly as possible. (You may want to use "Scale Up", "Scale Down", "Rotate Clockwise", and "Rotate Counter Clockwise" menu items here.) "Extend"--Each time this menu item is selected, the program should allow the user to input a control point (with the mouse) that will be used to attach a new B-Spline curve segment to the end of the previous one, thus extending the B-Spline curve.