rtVTK  0.6.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Slots | Signals | Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Private Attributes
rtVTK::RenderWindow Class Reference

Creates a window containing the QWidget onto which glw renders. More...

List of all members.

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

Detailed Description

Creates a window containing the QWidget onto which glw renders.


Constructor & Destructor Documentation

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.

Parameters:
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.


Member Function Documentation

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().

Parameters:
e: QEvent* - The event
Returns:
Returns whether the base class event handler handled the event.
Bug:
XXX(ajc) - Send the event to the base class first. Unfortunately, it is not possible to know what the change will be until after the change has occurred. This is a Qt limitation, keeping us from overloading the maximize function to do what we want until after it has occurred. Hope to eventually get RenderWindow's maximize button back and be more dual screen friendly, unlike the current full screen mode.

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().

Referenced by event().

void rtVTK::RenderWindow::slotToggleIdle ( bool  value) [slot]

Updates the value of the idling flag.

Parameters:
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.

Parameters:
eye: QString - QString containing new eye coordinates.
focal: QString - QString containing new lookat point coordinates.

References lblEyeCoord, and lblFocalCoord.

Referenced by RenderWindow().

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.

Parameters:
sceneName_:const string& - name of current scene.

References glw, sceneName, and rtVTK::to_string().

Referenced by resizeEvent(), rtVTK::MainWindow::slotLoadScene(), and slotUpdateTitle().


Member Data Documentation

const uint rtVTK::RenderWindow::baseHeight = 512 [static]

Referenced by RenderWindow().

const uint rtVTK::RenderWindow::baseWidth = 512 [static]

Referenced by RenderWindow().

Referenced by RenderWindow().

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().

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::lblFocal [private]

Referenced by RenderWindow(), and ~RenderWindow().

QLabel* rtVTK::RenderWindow::lblTab [private]

Referenced by RenderWindow(), and ~RenderWindow().

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends