Assigned Friday, Feb. 20, 2009, due Friday, Feb. 27, 2009
[1] Construct a high level class diagram (just showing classes and associations) associated with the application constructed in Part II of the computational work.
[2] Create a state diagram of the application constructed in Part II of the computational work.
[Discussion/Preliminaries] The goal of the computational problem is to create an application that plots a user specified function. The user interface will be created and managed using Qt designer. In order to make the following instructions precise, specific names have been given for the user interface components and files. You may change the names if you desire, but be aware that you'll typically need to modify the instructions in several places to reflect a name change.
Part I of the assignment consists of creating a skeleton application that contains the essential ingredients to build an application whose user interface is managed by Qt Designer. Part II consists of "fleshing out" the application and implementing the desired functionality.
[+] Obtain the repository SampleQt from the class repository at 157support.
[+] Create a subdirectory named Assign8 of your course directory to hold the files for this assignment.
[1] Use Qt Designer to create a "skeleton" user interface based upon the Main Window template:
designer
at a command prompt. objectName
property of the top level QObject to PlotFunctionWindowwindowTitle
property of the QMainWindow to Plot Function. You'll have to scroll down the properties list to reveal this. [2] Create the project structure and file structure required to build an application that uses the interface defined by PlotFunctionWindow.ui.
qmake -project -o PlotFunction.pro
qmake
from the command line to create the Visual Studio project file PlotFunction.vcproj. [3] Create implementations of the main(...) routine and the PlotFunction class. This is most easily done by copying and pasting from the SampleQt codes and changing names accordingly.
PlotFunction
#include "PlotFunction.h"
PlotFunction
(don't forget to change the constructor). #include "ui_PlotFunctionWindow.h"
Ui::PlotFunctionWindow
#include "PlotFunction.h"
PlotFunction
[4] Re-run qmake by cd'ing to the Assign8 directory and running qmake
from the command line. If you have added qmake as a tool to your Visual Studio environment, then just select the qmake tool. Re-running qmake induces Qt create a makefile that will generate the required supporting files for the application.
[5] Build the project and run the executable. If you are successful, then the application interface that appears should be similar to that observed when previewing the interface in Qt Designer.
[+] Obtain the repository QtGLgraphics from 157support. This repository contains the support files for the classes GLDisplayListWidget and GLDriverQt.
[1] By adding to the user interface and application files created in Part I create an application that plots a user specified function. Your plots will be displayed using a GLDisplayListWidget widget .
Your application should possess the following functionality
Notes:
The typical programming procedure consists of a repetition of the following steps
You will use a GLDisplayListWidget to display graphics. Since this is a "custom" widget, in order to work with it in Qt Designer, you should use the Graphics View widget (one of the Qt Designer display widgets) as a placeholder. In order for the correct code to be generated from the user interface file, you'll need to "promote" the Graphics View widget to a GLDisplayListWidget. When promoting the object you will have to specify the header file GLDisplayListWidget.h that is associated with this widget. Instructions on promoting a Graphics View widget to a GLDisplayListWidget.
After placement in the user interface, the use of a GLDisplayListWidget to display graphics consists of obtaining a GLDriverQt pointer from the widget and passing it to code that is written using UCdriver graphics calls (e.g. the PlotData class you used in Assignment 6). For detailed information about setting up and using GLDisplayListWidget, see "Setting Up and Using a GLDisplayListWidget".
To get a window that resizes appropriately, you should insert a Grid Layout object in the centralWidget of the main window, place your interface widgets in this layout. After you have done this, highlight the centralWidget object, go to the Forms menu item, and select "Layout in a Grid". This latter step will cause the Grid Layout object to expand when the surrounding window expands.
If your interface elements expand to the full size of the window when added to the layout, and you don't want this to occur, then you need to set their properties so they have a fixed size.
Hardcopy to be turned in
In an Assign8 subdirectory of your submit directory, place