Creates a window containing the QWidget onto which glw renders. More...
Public Slots | |
void | slotUpdateTitle () |
void | slotToggleIdle (bool) |
Signals | |
void | sgnlRender () |
Public Member Functions | |
RenderWindow (glWidget *&, MainWindow *=0) | |
~RenderWindow () | |
void | updateTitle (const string &) |
Static Public Attributes | |
static const uint | baseWidth = 512 |
static const uint | baseHeight = 512 |
Private Slots | |
void | slotUpdateCoords (QString, QString) |
Private Member Functions | |
bool | event (QEvent *) |
void | resizeEvent (QResizeEvent *) |
Private Attributes | |
QShortcut * | escapeOverloaded |
Ui::RenderWindow * | ui |
glWidget *& | glw |
bool | idling |
string | sceneName |
Labels | |
Labels for displaying information on status bar. | |
QLabel * | lblEye |
QLabel * | lblEyeCoord |
QLabel * | lblTab |
QLabel * | lblFocal |
QLabel * | lblFocalCoord |
Creates a window containing the QWidget onto which glw renders.
rtVTK::RenderWindow::RenderWindow | ( | glWidget *& | glw_, |
MainWindow * | mw = 0 |
||
) | [explicit] |
Sets up labels in the status bar. Sets up the initial size of the window such that the resolution of glWidget is initially 512x512.
glw_ | : glWidget*& - a reference to glWidget*. This will be the widget that is drawn to the screen in this window. |
mw | : MainWindow* - a pointer to MainWindow, the parent of RenderWindow. |
References baseHeight, baseWidth, escapeOverloaded, glw, lblEye, lblEyeCoord, lblFocal, lblFocalCoord, lblTab, slotUpdateCoords(), slotUpdateTitle(), and ui.
Frees heap-allocated memory. Note that this function deletes glw; thus, the glWidget* to which glw is bound should not be deleted elsewhere (i.e., in MainWindow's destructor). If RenderWindow is closed by the user (which sends the event QEvent::Close), the application ought to be quit via a qApp->quit() call. The destructor of the RenderWindow should delete glw;
References glw, lblEye, lblEyeCoord, lblFocal, lblFocalCoord, lblTab, and ui.
bool rtVTK::RenderWindow::event | ( | QEvent * | e | ) | [private] |
Invokes QMainWindow::event(). Additionally, special behaviors may be set in this function to execute when certain events occur. Currently, if a close event occurs, this function will close the entire application. If the RenderWindow is restored after being minimized and idling is disabled, this function will invoke glw->render().
e | : QEvent* - The event |
References idling, and sgnlRender().
void rtVTK::RenderWindow::resizeEvent | ( | QResizeEvent * | e | ) | [private] |
Invokes QMainWindow::resizeEvent(). Also calls the updateTitle() function with the class-maintained sceneName (the scene has not changed; only the dimensions of glw have).
References sceneName, and updateTitle().
void rtVTK::RenderWindow::sgnlRender | ( | ) | [signal] |
Referenced by event().
void rtVTK::RenderWindow::slotToggleIdle | ( | bool | value | ) | [slot] |
Updates the value of the idling flag.
value | : bool - new value for idling |
References idling.
void rtVTK::RenderWindow::slotUpdateCoords | ( | QString | eye, |
QString | focal | ||
) | [private, slot] |
Updates label information on the status bar.
eye | : QString - QString containing new eye coordinates. |
focal | : QString - QString containing new lookat point coordinates. |
References lblEyeCoord, and lblFocalCoord.
Referenced by RenderWindow().
void rtVTK::RenderWindow::slotUpdateTitle | ( | ) | [slot] |
Possibly updates window title (glWidget dimensions only).
References sceneName, and updateTitle().
Referenced by RenderWindow().
void rtVTK::RenderWindow::updateTitle | ( | const string & | sceneName_ | ) |
Updates the title of the window. Information provided in the title includes the name of the current scene and the current dimensions of glw.
sceneName_ | :const string& - name of current scene. |
References glw, sceneName, and rtVTK::to_string().
Referenced by resizeEvent(), rtVTK::MainWindow::slotLoadScene(), and slotUpdateTitle().
const uint rtVTK::RenderWindow::baseHeight = 512 [static] |
Referenced by RenderWindow().
const uint rtVTK::RenderWindow::baseWidth = 512 [static] |
Referenced by RenderWindow().
QShortcut* rtVTK::RenderWindow::escapeOverloaded [private] |
Referenced by RenderWindow().
glWidget*& rtVTK::RenderWindow::glw [private] |
A reference to MainWindow's glw. While MainWindow is responsible for file interaction with glw (loading scenes, saving images, etc), RenderWindow is responsible for actually displaying glw's rendered image.
Referenced by RenderWindow(), updateTitle(), and ~RenderWindow().
bool rtVTK::RenderWindow::idling [private] |
A flag indicated whether the idling checkbox is currently checked. This information is maintained because if idling is enabled, this window should not cause glw to re-render when it is restored from being minimized. If idling is disabled, glw->render() should be called when the window is restored.
Referenced by event(), and slotToggleIdle().
QLabel* rtVTK::RenderWindow::lblEye [private] |
Referenced by RenderWindow(), and ~RenderWindow().
QLabel* rtVTK::RenderWindow::lblEyeCoord [private] |
Referenced by RenderWindow(), slotUpdateCoords(), and ~RenderWindow().
QLabel* rtVTK::RenderWindow::lblFocal [private] |
Referenced by RenderWindow(), and ~RenderWindow().
QLabel* rtVTK::RenderWindow::lblFocalCoord [private] |
Referenced by RenderWindow(), slotUpdateCoords(), and ~RenderWindow().
QLabel* rtVTK::RenderWindow::lblTab [private] |
Referenced by RenderWindow(), and ~RenderWindow().
string rtVTK::RenderWindow::sceneName [private] |
The name of the current scene file, to be displayed in the window title.
Referenced by resizeEvent(), slotUpdateTitle(), and updateTitle().
Ui::RenderWindow* rtVTK::RenderWindow::ui [private] |
Referenced by RenderWindow(), and ~RenderWindow().