#include <vuMainWindow.h>
Inheritance diagram for vuMainWindow:
Public Member Functions | |
vuMainWindow () | |
The vuMainWindow constructor. Does default initialization. | |
~vuMainWindow () | |
The vuMainWindow destructor. Responsible for cleaning up memory use. | |
bool | init (int argc=0, char *argv[]=0) |
Initializes and starts the vuMainWindow, with the option of command line parameters. | |
void | notifyDataChanged () |
Notifies the vuMainWindow that a change has been made to the volume data. | |
void | notifyClosed (vuUtilityWindow *Window) |
Notifies the vuMainWindow that a utility window has been closed by the user. | |
Private Member Functions | |
bool | open (const char *file) |
Opens a volume data file. | |
void | close () |
Closes the volume data file. | |
bool | isOpened () |
Tells whether the window is in the opened or closed state. | |
bool | save (const char *file) |
Saves the volume data to a file. | |
bool | isSaved () |
Indicates whether the current volume data is saved to disk. | |
bool | parseCommandLine (int argc, char *argv[]) |
Parses the command line and returns whether it was successful or not. | |
bool | addUtility (const char *Name) |
Creates and initializes a utility window of the given Name. | |
void | saveData () |
Pops up a file dialog and saves to the chosen file. | |
bool | initWindow () |
Creates and sets up the main window. | |
void | setOpened () |
Puts the window into the opened state. | |
void | setClosed () |
Puts the window into the closed state. | |
wxMenu * | createUtilityMenu () |
Creates a utility menu for the opened file type. | |
void | OnOpenData (wxCommandEvent &event) |
Opens a file dialog and opens the chosen file. | |
void | OnSaveData (wxCommandEvent &event) |
Opens a file dialog and saves to the chosen file. | |
void | OnCloseData (wxCommandEvent &event) |
Puts the window in a closed state. | |
void | OnAddUtility (wxCommandEvent &event) |
Adds the utility that the user chose. | |
void | OnSize (wxSizeEvent &event) |
Handles the window resize event. | |
void | OnExit (wxCommandEvent &event) |
Handles the window exit event. | |
void | OnClose (wxCloseEvent &event) |
Handles the window close event. | |
Private Attributes | |
vuVolume * | m_Data |
A pointer to the opened volume data, if any -- currently unused. | |
wxString | m_FileName |
The name of the file storing the opened volume data. | |
wxString | m_FileType |
The known file type of the chosen data file. | |
bool | m_Opened |
Indicates whether the program is in the open state. | |
bool | m_Saved |
Indicates whether the opened volume data is saved to the disk. | |
wxList | m_Windows |
A list of the utility windows. |
This class primarily represents to the main window of the GUI Tool; it is created and used as a windowing class. As such, it creates the main window and implements its functions. The implementation of the main window depends on the windowing system. In most systems, the main window is implemented as an MDI parent window, and so is derived from the wxWindows wxMDIParentFrame class. In gtk, the wxWindow's implementation of the mdi architecture is not suitable to the gui tool, and so the main window is implemented as a regular window, deriving from the wxFrame class.
The main window's other task is to manage all the utility windows. It is responsible for creating them, supplying them with the volume data file, and notifying them of any changes in the data. All the utility windows implement the vuUtilityWindow interface, and this is what the main window sees.
Finally, the class also manages the volume data for the application. This is because the main window corresponds to a viewing session of volume data. Therefore the vuMainWindow class keeps track of this data and supplies functions for operating on it. For many utilities, this simply constitutes passing around the data file name. These are the utilites which need to open their own data set for efficiency reasons. The main window can also keep track of a shared data set which a number of utilities operate on.
The vuMainWindow, and so the main program, can be started with command line parameters. When the vuMainWindow initializes itself, it will automatically open up the volume data and create the desired utility windows. The syntax is as follows
programname VolumeData Utility1 Utility2 ...
programName - name of the executable
VolumeData - the file name of the volume data
Utility# - a list of the utilities to be opened up, by name
Definition at line 64 of file vuMainWindow.h.
|
The vuMainWindow constructor. Does default initialization.
Definition at line 38 of file vuMainWindow.cpp. |
|
The vuMainWindow destructor. Responsible for cleaning up memory use.
Definition at line 49 of file vuMainWindow.cpp. References close(), and isOpened(). |
Here is the call graph for this function:
|
Creates and initializes a utility window of the given Name.
Definition at line 177 of file vuMainWindow.cpp. References vuUtilityFactory::create(), vuUtilityWindow::init(), isOpened(), m_FileName, and m_Windows. Referenced by OnAddUtility(), and parseCommandLine(). |
Here is the call graph for this function:
|
Closes the volume data file. This puts the main window into the closed state. The main window is open but it's empty and has no data. This implies that no utility windows can be added anymore. The user can only quit or open up another set of data. Definition at line 290 of file vuMainWindow.cpp. References vuUtilityWindow::close(), isOpened(), m_Data, m_FileName, m_FileType, m_Opened, m_Saved, m_Windows, and setClosed(). Referenced by open(), and ~vuMainWindow(). |
Here is the call graph for this function:
|
Creates a utility menu for the opened file type. The method checks with the vuUtilityFactory to see what utilities are available for the opened file type, and creates a menu that lets the user choose from among them. Definition at line 150 of file vuMainWindow.cpp. References vuUtilityFactory::listAvailable(), m_FileType, and MENU_ADD. Referenced by initWindow(), and setOpened(). |
Here is the call graph for this function:
|
Initializes and starts the vuMainWindow, with the option of command line parameters. This method intializes the windowing environment for the vuMainWindow, creates the main window, and starts it. Once this method has been called, the window will be visible and accepting events from the user. The user can then choose to open data and so on. The main window can be optionally initialized with command line parameters. These tell it the name of a file containing volume data, and the utility windows to start with. If the volume file or utility name is invalid, the main window asks the user if it should quit.
Definition at line 58 of file vuMainWindow.cpp. References initWindow(), parseCommandLine(), and setClosed(). Referenced by vuGUI::OnInit(). |
Here is the call graph for this function:
|
Creates and sets up the main window. This method sets up the user interface for the main window. It does not put the window into neither the open nor the closed state, that has to be done afterwards.
Definition at line 76 of file vuMainWindow.cpp. References createUtilityMenu(), MENU_CLOSE, MENU_EXIT, MENU_OPEN, and NULL. Referenced by init(). |
Here is the call graph for this function:
|
Tells whether the window is in the opened or closed state.
Definition at line 324 of file vuMainWindow.cpp. Referenced by addUtility(), close(), open(), and ~vuMainWindow(). |
|
Indicates whether the current volume data is saved to disk. This would be false if one of the utilities changed the volume data in memory, and thereby created new data. By checking this function, the caller can find out whether to provide the option of saving the data to disk. Once the data has been saved, this method again returns true.
Definition at line 347 of file vuMainWindow.cpp. Referenced by OnClose(). |
|
Notifies the vuMainWindow that a utility window has been closed by the user. This is called by utility windows when they have been closed by the user, as opposed to being closed by the vuMainWindow itself. In GUI environments, this is often done without the main window being aware that the child has been closed. Definition at line 251 of file vuMainWindow.cpp. References m_Windows. Referenced by vuBasicUtility::~vuBasicUtility(). |
|
Notifies the vuMainWindow that a change has been made to the volume data. This is called by utility windows when they change the data and is necessary for program synchronization. First of all, the vuMainWindow window will then notify the user of the change. Also, it will let other utility windows know of the change so that they can update their data views.
Definition at line 237 of file vuMainWindow.cpp. |
|
Adds the utility that the user chose. This method handles the Add Utility menu commands. Definition at line 439 of file vuMainWindow.cpp. References addUtility(), dword, vuUtilityFactory::listAvailable(), m_FileType, and MENU_ADD. |
Here is the call graph for this function:
|
Handles the window close event.
Definition at line 502 of file vuMainWindow.cpp. References isSaved(), and saveData(). |
Here is the call graph for this function:
|
Puts the window in a closed state. This method handles the Close Data menu command. |
|
Handles the window exit event.
|
|
Opens a file dialog and opens the chosen file. This method handles the Open Data menu command. |
|
Opens a file dialog and saves to the chosen file. This method handles the Save Data menu command. |
|
Handles the window resize event.
|
|
Opens a volume data file. This puts the main window into the opened state. Menus and functions which depend on volume data are now enabled. This includes adding utilities, managing windows and so on.
Definition at line 262 of file vuMainWindow.cpp. References close(), vuFileHelper::getFileType(), isOpened(), m_FileName, m_FileType, m_Opened, m_Saved, and setOpened(). Referenced by parseCommandLine(). |
Here is the call graph for this function:
|
Parses the command line and returns whether it was successful or not.
Definition at line 207 of file vuMainWindow.cpp. References addUtility(), and open(). Referenced by init(). |
Here is the call graph for this function:
|
Saves the volume data to a file.
Definition at line 333 of file vuMainWindow.cpp. References m_Saved. Referenced by saveData(). |
|
Pops up a file dialog and saves to the chosen file.
Definition at line 356 of file vuMainWindow.cpp. References save(). Referenced by OnClose(). |
Here is the call graph for this function:
|
Puts the window into the closed state. This is the state of the window when there is no opened volume data file. Under this state, the user can only open a volume data file. Definition at line 132 of file vuMainWindow.cpp. References MENU_ADD, MENU_CLOSE, and MENU_OPEN. |
|
Puts the window into the opened state. This is the state of the window when there is an opened volume data file. Under this state, the utitily menu is enabled and the user can add utilities Definition at line 105 of file vuMainWindow.cpp. References createUtilityMenu(), m_FileName, MENU_CLOSE, and MENU_OPEN. Referenced by open(). |
Here is the call graph for this function:
|
A pointer to the opened volume data, if any -- currently unused.
Definition at line 227 of file vuMainWindow.h. Referenced by close(). |
|
The name of the file storing the opened volume data.
Definition at line 229 of file vuMainWindow.h. Referenced by addUtility(), close(), open(), and setOpened(). |
|
The known file type of the chosen data file.
Definition at line 231 of file vuMainWindow.h. Referenced by close(), createUtilityMenu(), OnAddUtility(), and open(). |
|
Indicates whether the program is in the open state.
Definition at line 234 of file vuMainWindow.h. |
|
Indicates whether the opened volume data is saved to the disk.
Definition at line 236 of file vuMainWindow.h. Referenced by close(), notifyDataChanged(), open(), and save(). |
|
A list of the utility windows.
Definition at line 239 of file vuMainWindow.h. Referenced by addUtility(), close(), notifyClosed(), and notifyDataChanged(). |