Main Window of the Application. More...
Public Slots | |
void | slotUpdateCoords (const Camera &) |
Signals | |
void | sgnlLoadScene (const Options &) |
void | sgnlSetView (const Scene::ViewParameters &) |
void | sgnlSetLookMode (uiCore::CameraMode) |
void | sgnlActivatePlugin (Plugin *, const Mesh &, QLayout *, QWidget *) |
void | sgnlSetRotationSpeed (float) |
void | sgnlSetTranslationSpeed (float) |
void | sgnlSetDollySpeed (float) |
void | sgnlSetFOV (float) |
void | sgnlSetBG (float, float, float) |
void | sgnlRender () |
void | sgnlSetIdle (bool) |
void | sgnlNewRay () |
void | sgnlCoordsChanged (QString, QString) |
void | sgnlPauseTimers () |
void | sgnlUnpauseTimers () |
Public Member Functions | |
MainWindow (const Configuration &, QWidget *=0) | |
~MainWindow () | |
glWidget const * | getGLW () const |
rl::RayLogger * | getRL () const |
void | show () |
QDir | getConfigDir (string str) |
Shortcut Management | |
A shortcut is like a library book, only one person may checkout the book at a time. No one else can checkout the book until it is returned. Claim is analogous to checking out a book and Release is analogous to returning the book to the library so that someone else may use it. These functions help plugins avoid shortcut collisions. Hint: const QObject* argument should almost always be "this" keyword. | |
const set< QKeySequence > *const | getTakenKeyCombos () const |
bool | claimKeyCombo (const QObject *requester_, const QString &shortcut_) |
bool | claimKeyCombo (const QObject *requester_, const QKeySequence &shortcut_) |
bool | releaseKeyCombo (const QObject *requester_, const QString &shortcut_) |
bool | releaseKeyCombo (const QObject *requester_, const QKeySequence &shortcut_) |
Private Slots | |
void | slotBackground () |
void | slotToggleFullScreenMode (bool) |
void | slotShowUsingDocs () |
void | slotShowWritingDocs () |
void | slotShowMainDocs () |
void | slotSetLookModeFocal () |
void | slotSetLookModeEye () |
void | slotShowPipeline () |
void | slotSetDefaultScene () |
void | slotShowAbout () |
void | slotRestoreIdle () |
void | slotDisableIdle () |
void | slotToggleIdle () |
void | slotPauseTimers () |
void | slotUnpauseTimers () |
void | slotShowTimerDialog () |
void | slotNewRay () |
void | slotResetRL () |
File Open | |
Slots to load scene data from files | |
void | slotOpenScene () |
void | slotLoadScene (const Options &) |
void | slotLoadMesh () |
void | slotLoadView () |
Camera Control | |
Slots to alter the behavior of the camera | |
void | slotToggleAdvancedSettings () |
void | slotConvertRotationSpeed (int) |
void | slotConvertTranslationSpeed (int) |
void | slotConvertDollySpeed (int) |
void | slotConvertFOV (int) |
void | slotConvertFOV (double) |
Save File | |
Slots to save visualization data | |
void | slotCopyImage () |
void | slotSaveImage () |
void | slotSaveView () |
DLL Slots | |
Slots related to plugin management | |
void | slotLoadDLL (QAction *) |
void | slotUnloadDLL (QAction *) |
void | slotSetActivePlugins (const vector< string > &) |
void | slotEstablishTabsForActivePlugins (const vector< string > &) |
Slider Controls | |
Functions for incrementing/decrementing camera slider values | |
void | slotIncrRotation () |
void | slotIncrDolly () |
void | slotIncrTranslation () |
void | slotIncrFOV () |
void | slotDecrRotation () |
void | slotDecrDolly () |
void | slotDecrTranslation () |
void | slotDecrFOV () |
Private Member Functions | |
bool | eventFilter (QObject *, QEvent *) |
void | loadDefaultScene () |
bool | initializePlugin (Plugin *) |
void | setShortcuts () |
bool | event (QEvent *) |
Private Attributes | |
Ui::MainWindow * | ui |
PluginManager * | pmgr |
glWidget * | glw |
RenderWindow * | winRender |
Documentation * | winDoc |
vector< QShortcut * > | shortcuts |
set< QKeySequence > | keyCombos |
map< const QKeySequence, const QObject * > | pluginShortcutOwnership |
Configuration | config |
Scene | scene |
Mesh | mesh |
rl::RayLogger | rlRayLogger |
Tab Components | |
Vectors to aggregate Qt components used to create plugin tabs. | |
vector< QScrollArea * > | scrollAreas |
vector< QWidget * > | scrollAreasContents |
Speed settings | |
Camera speed settings, determined from file. | |
float | rspeed |
float | tspeed |
float | dspeed |
map< Plugin *, QWidget * > | pluginToTab |
vector< Plugin * > | pipeline |
AboutDialog * | dlgAbout |
PipelineDialog * | dlgPipeline |
TimerDialog * | dlgTimer |
bool | isInSlotFullScreenMode |
bool | userResizedCaptured |
bool | areThereCustomPlugins |
Main Window of the Application.
MainWindow controls the application GUI. It aggregates glWidget and PluginManager, and acts as the middleman between these two classes.
rtVTK::MainWindow::MainWindow | ( | const Configuration & | config_, |
QWidget * | parent = 0 |
||
) | [explicit] |
Performs setup operations for MainWindow. Instantiates glWidget and PluginManager. Connects signals and slots. Loads glRenderer and rlRenderer.
Calls winRender->show().
parent | : QWidget* = 0 - parent of MainWindow. |
References Ui_MainWindow::actionAbout, Ui_MainWindow::actionBGColor, Ui_MainWindow::actionConfigurePipeline, Ui_MainWindow::actionCopy, Ui_MainWindow::actionCut, Ui_MainWindow::actionDocumentation, Ui_MainWindow::actionExit, Ui_MainWindow::actionFullscreen, Ui_MainWindow::actionOpenMesh, Ui_MainWindow::actionOpenScene, Ui_MainWindow::actionOpenView, Ui_MainWindow::actionSaveImage, Ui_MainWindow::actionSaveView, Ui_MainWindow::actionSetDefaultScene, Ui_MainWindow::actionTimerManagement, Ui_MainWindow::actionToggleIdle, Ui_MainWindow::actionUsing, Ui_MainWindow::actionWriting, areThereCustomPlugins, config, dlgAbout, dlgPipeline, dlgTimer, rtVTK::PluginManager::findValidDLLs(), Ui_MainWindow::frame_advancedSettings, rtVTK::PluginManager::getPluginByName(), glw, initializePlugin(), loadDefaultScene(), pmgr, setShortcuts(), Ui_MainWindow::setupUi(), sgnlLoadScene(), sgnlPauseTimers(), sgnlRender(), sgnlSetBG(), sgnlSetDollySpeed(), sgnlSetFOV(), sgnlSetIdle(), sgnlSetLookMode(), sgnlSetRotationSpeed(), sgnlSetTranslationSpeed(), sgnlSetView(), sgnlUnpauseTimers(), slotBackground(), slotConvertDollySpeed(), slotConvertFOV(), slotConvertRotationSpeed(), slotConvertTranslationSpeed(), slotCopyImage(), slotDisableIdle(), slotEstablishTabsForActivePlugins(), slotLoadDLL(), slotLoadMesh(), slotLoadScene(), slotLoadView(), slotOpenScene(), slotPauseTimers(), slotResetRL(), slotRestoreIdle(), slotSaveImage(), slotSaveView(), slotSetActivePlugins(), slotSetDefaultScene(), slotSetLookModeEye(), slotSetLookModeFocal(), slotShowAbout(), slotShowMainDocs(), slotShowPipeline(), slotShowTimerDialog(), slotShowUsingDocs(), slotShowWritingDocs(), slotToggleAdvancedSettings(), slotToggleFullScreenMode(), slotToggleIdle(), slotUnloadDLL(), slotUnpauseTimers(), slotUpdateCoords(), ui, winDoc, and winRender.
Deletes all heap-allocated members. Note that the ordering of delete statements is important here. Also note that vectors of pointers are iterated through to delete each pointer element.
References dlgPipeline, dlgTimer, pmgr, scrollAreas, scrollAreasContents, shortcuts, ui, and winDoc.
bool rtVTK::MainWindow::claimKeyCombo | ( | const QObject * | requester_, |
const QString & | shortcut_ | ||
) | [inline] |
Overload for MainWindow::claimKeyCombo(const Plugin* requester_, const QKeySequence& shortcut_) const.
requester_ | : const Plugin*& - the plugin attempting to claim the shortcut. Typically the "this" keyword. |
shortcut_ | : const QString& - the key combo being claimed. |
Referenced by rtVTK::rlRenderer::rlRenderer().
bool rtVTK::MainWindow::claimKeyCombo | ( | const QObject * | requester_, |
const QKeySequence & | shortcut_ | ||
) | [inline] |
Determines if a shortcut is available to claim and if so, set "ownership" of the shortcut key sequence to the requesting plugin.
requester_ | : const Plugin*& - the plugin attempting to claim the shortcut. Typically the "this" keyword. |
shortcut_ | : const QKeySequence& - the key combo being claimed. |
References keyCombos, and pluginShortcutOwnership.
bool rtVTK::MainWindow::event | ( | QEvent * | e | ) | [private] |
References sgnlRender(), slotPauseTimers(), slotUnpauseTimers(), ui, and winRender.
bool rtVTK::MainWindow::eventFilter | ( | QObject * | obj, |
QEvent * | e | ||
) | [private] |
Because this eventFilter is a reimplementation of QObject's eventFilter function, returning true will filter out the event. Inversely, returning false will pass the event to the parent base class.
Resize event is filtered to ensure that resizing in full screen is only done at certain times. The private Boolean variables of MainWindow are used to determine who/what sent the Resize Event. One bool indicates if slotToggleFullScreenMode is currently on the call stack. The ui->actionFullscreen->isChecked() is used like a bool variable to check if rtVTK is in full screen mode or not.
WindowBlocked and WindowUnblocked are triggered when a modal dialog box appears or disappears, respectively.
References Ui_MainWindow::actionFullscreen, isInSlotFullScreenMode, sgnlPauseTimers(), sgnlUnpauseTimers(), slotDisableIdle(), slotRestoreIdle(), ui, and userResizedCaptured.
QDir rtVTK::MainWindow::getConfigDir | ( | string | str | ) | [inline] |
References config.
Referenced by rtVTK::rlRenderer::slotOpenFile().
glWidget const* rtVTK::MainWindow::getGLW | ( | ) | const [inline] |
References glw.
Referenced by rtVTK::glRenderer::glRenderer(), PluginTemplate::PluginTemplate::PluginTemplate(), and rtVTK::rlRenderer::rlRenderer().
rl::RayLogger* rtVTK::MainWindow::getRL | ( | ) | const [inline] |
References rlRayLogger.
const set<QKeySequence>* const rtVTK::MainWindow::getTakenKeyCombos | ( | ) | const [inline] |
Accessor for the set of shortcuts being used. The pointer returned can't be used to modify keyCombos (1st const). The pointer can't be set to point to someplace else (2nd const). This function will not change MainWindow (3rd const).
References keyCombos.
bool rtVTK::MainWindow::initializePlugin | ( | Plugin * | pl | ) | [private] |
This function calls create() for a given plugin, sets the plugin's initialized flag to true, and creates a tab on the main window for the plugin's options. After initialization, a plugin may be added to the rendering pipeline.
pl | : Plugin* - plugin to be initialized. |
References rtVTK::Plugin::callClose(), rtVTK::Plugin::callCreate(), uiCore::Trackball::getCam(), rtVTK::glWidget::getTrackball(), glw, rtVTK::Plugin::initialized, mesh, rtVTK::Plugin::name, pluginToTab, rtVTK::Plugin::requiresTab, scrollAreas, scrollAreasContents, and ui.
Referenced by MainWindow(), and slotLoadDLL().
void rtVTK::MainWindow::loadDefaultScene | ( | ) | [private] |
Loads the default scene. A default scene must reside in the scenes directory.
Emits sgnlLoadScene.
References ioCore::Options::bname, config, ioCore::Options::fname, rtVTK::Configuration::getDefaultScene(), ioCore::Options::path, and sgnlLoadScene().
Referenced by MainWindow().
bool rtVTK::MainWindow::releaseKeyCombo | ( | const QObject * | requester_, |
const QString & | shortcut_ | ||
) | [inline] |
Overload for MainWindow::releaseKeyCombo(const Plugin* requester_, const QKeySequence& shortcut_) const.
requester_ | : const Plugin*& - the plugin attempting to release the shortcut. Typically the "this" keyword. |
shortcut_ | : const QString& - the key combo being released. |
Referenced by rtVTK::rlRenderer::~rlRenderer().
bool rtVTK::MainWindow::releaseKeyCombo | ( | const QObject * | requester_, |
const QKeySequence & | shortcut_ | ||
) | [inline] |
A plugin that is being unloaded/destructed or which no longer needs a shortcut which it owns should release it back to the pool of unused shortcuts. This will allow other plugins and user created timers to claim the shortcut for use.
requester_ | : const Plugin*& - the plugin attempting to release the shortcut. Typically the "this" keyword. |
shortcut_ | : const QString& - the key combo being released. |
References keyCombos, and pluginShortcutOwnership.
void rtVTK::MainWindow::setShortcuts | ( | ) | [private] |
Sets up the keyboard shortcuts provided by the application. This function is meant to be called only the the constructor of MainWindow. Logically, it is a part of construction. This function is called before plugins are called, so it is believed to be safe (and faster) to push/connect these shortcuts without actually checking the set keyCombos. Normally, keyCombos should be accessed to make sure a desired key sequence has not already been used. In other words don't use this function as an example of shortcut management; instead, look at TimerDialog::slotAddTimer() and TimerDialog::slotRemoveTimer().
Plugins that want to use a shortcut should use the public interface involving claimKeyCombo and releaseKeyCombo.
References Ui_MainWindow::actionCopy, Ui_MainWindow::actionCut, Ui_MainWindow::actionDocumentation, Ui_MainWindow::actionExit, Ui_MainWindow::actionFullscreen, Ui_MainWindow::actionOpenScene, Ui_MainWindow::actionPaste, Ui_MainWindow::actionSaveImage, Ui_MainWindow::actionTimerManagement, glw, keyCombos, shortcuts, slotDecrDolly(), slotDecrFOV(), slotDecrRotation(), slotDecrTranslation(), slotIncrDolly(), slotIncrFOV(), slotIncrRotation(), slotIncrTranslation(), slotShowMainDocs(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::sgnlActivatePlugin | ( | Plugin * | , |
const Mesh & | , | ||
QLayout * | , | ||
QWidget * | |||
) | [signal] |
void rtVTK::MainWindow::sgnlCoordsChanged | ( | QString | , |
QString | |||
) | [signal] |
Referenced by slotUpdateCoords().
void rtVTK::MainWindow::sgnlLoadScene | ( | const Options & | ) | [signal] |
Referenced by loadDefaultScene(), MainWindow(), and slotOpenScene().
void rtVTK::MainWindow::sgnlNewRay | ( | ) | [signal] |
Referenced by slotNewRay().
void rtVTK::MainWindow::sgnlPauseTimers | ( | ) | [signal] |
Referenced by eventFilter(), MainWindow(), and slotPauseTimers().
void rtVTK::MainWindow::sgnlRender | ( | ) | [signal] |
Referenced by event(), MainWindow(), slotLoadMesh(), slotLoadView(), slotSetActivePlugins(), slotToggleFullScreenMode(), and slotUnloadDLL().
void rtVTK::MainWindow::sgnlSetBG | ( | float | , |
float | , | ||
float | |||
) | [signal] |
Referenced by MainWindow(), and slotBackground().
void rtVTK::MainWindow::sgnlSetDollySpeed | ( | float | ) | [signal] |
Referenced by MainWindow(), and slotConvertDollySpeed().
void rtVTK::MainWindow::sgnlSetFOV | ( | float | ) | [signal] |
Referenced by MainWindow(), and slotConvertFOV().
void rtVTK::MainWindow::sgnlSetIdle | ( | bool | ) | [signal] |
Referenced by MainWindow(), slotBackground(), slotCopyImage(), slotDisableIdle(), slotLoadMesh(), slotLoadView(), slotOpenScene(), slotRestoreIdle(), slotSaveImage(), slotSaveView(), slotSetActivePlugins(), slotSetDefaultScene(), slotShowMainDocs(), slotShowPipeline(), slotShowUsingDocs(), slotShowWritingDocs(), and slotToggleIdle().
void rtVTK::MainWindow::sgnlSetLookMode | ( | uiCore::CameraMode | ) | [signal] |
Referenced by MainWindow(), slotSetLookModeEye(), and slotSetLookModeFocal().
void rtVTK::MainWindow::sgnlSetRotationSpeed | ( | float | ) | [signal] |
Referenced by MainWindow(), and slotConvertRotationSpeed().
void rtVTK::MainWindow::sgnlSetTranslationSpeed | ( | float | ) | [signal] |
Referenced by MainWindow(), and slotConvertTranslationSpeed().
void rtVTK::MainWindow::sgnlSetView | ( | const Scene::ViewParameters & | ) | [signal] |
Referenced by MainWindow(), slotLoadScene(), and slotLoadView().
void rtVTK::MainWindow::sgnlUnpauseTimers | ( | ) | [signal] |
Referenced by eventFilter(), MainWindow(), and slotUnpauseTimers().
void rtVTK::MainWindow::show | ( | ) |
Displays the right-hand panel (MainWindow) and the render window (RenderWindow).
References winRender.
void rtVTK::MainWindow::slotBackground | ( | ) | [private, slot] |
Allows user to select new color for background of glWidget from the QColorDialog box.
Emits sgnlSetBG if user clicks the color selection's Ok button.
References sgnlSetBG(), sgnlSetIdle(), slotPauseTimers(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotConvertDollySpeed | ( | int | value | ) | [private, slot] |
Converts value from dolly speed slider into a multiplier and calculates new speed value.
Emits sgnlSetDollySpeed with this value.
value | : int - value of dolly speed slider bar. |
References dspeed, sgnlSetDollySpeed(), and ui.
Referenced by MainWindow(), and slotLoadScene().
void rtVTK::MainWindow::slotConvertFOV | ( | int | value | ) | [private, slot] |
Given value of fov slider, calculates new field of view value.
Emits sgnlSetFOV with this value.
value | : int - value of fov slider bar. |
References sgnlSetFOV(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotConvertFOV | ( | double | value | ) | [private, slot] |
Given value of fov spin box, calculates new field of view value.
Emits sgnlSetFOV with this value.
value | : float - value of fov spin box. |
References sgnlSetFOV(), and ui.
void rtVTK::MainWindow::slotConvertRotationSpeed | ( | int | value | ) | [private, slot] |
Converts value from rotation speed slider into a multiplier and calculates new speed value.
Emits sgnlSetRotationSpeed with this value.
value | : int - value of rotation speed slider bar. |
References rspeed, sgnlSetRotationSpeed(), and ui.
Referenced by MainWindow(), and slotLoadScene().
void rtVTK::MainWindow::slotConvertTranslationSpeed | ( | int | value | ) | [private, slot] |
Converts value from rotation speed slider into a multiplier and calculates new speed value.
Emits sgnlSetTranslationSpeed with this value.
value | : int - value of translation speed slider bar. |
References sgnlSetTranslationSpeed(), tspeed, and ui.
Referenced by MainWindow(), and slotLoadScene().
void rtVTK::MainWindow::slotCopyImage | ( | ) | [private, slot] |
Saves the current render image to the clipboard.
References glw, sgnlSetIdle(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotDecrDolly | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotDecrFOV | ( | ) | [private, slot] |
Subtracts ten from the value of field of view slider bar.
References ui.
Referenced by setShortcuts().
void rtVTK::MainWindow::slotDecrRotation | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotDecrTranslation | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotDisableIdle | ( | ) | [private, slot] |
Pauses idling so that it may be continued at a later point.
References sgnlSetIdle().
Referenced by eventFilter(), and MainWindow().
void rtVTK::MainWindow::slotEstablishTabsForActivePlugins | ( | const vector< string > & | activePluginNames | ) | [private, slot] |
Sets tabs for each plugin to enabled if plugin is in the pipeline and inactive if plugin is not in the pipeline.
This slot is only called when the plugins are set to active.
activePluginNames | : const vector<string>& - names of plugins currently in the pipeline. |
References rtVTK::PluginManager::getInitPluginNames(), rtVTK::PluginManager::getPluginByName(), pluginToTab, pmgr, rtVTK::Plugin::requiresTab, and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotIncrDolly | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotIncrFOV | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotIncrRotation | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotIncrTranslation | ( | ) | [private, slot] |
void rtVTK::MainWindow::slotLoadDLL | ( | QAction * | choice | ) | [private, slot] |
This function, given a plugin name, queries the PluginManager for a Plugin*. MainWindow::initializePlugin() is called for this Plugin*.
choice | : QAction* - the item that has been selected from the Load Plugin menu. |
References rtVTK::PluginManager::getPluginByName(), initializePlugin(), pmgr, and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotLoadMesh | ( | ) | [private, slot] |
Allows user to select a new mesh file to be loaded. Emits either sgnlSetIdle and/or sgnlRefesh, depending on conditions.
References config, Core::Mesh::load(), mesh, sgnlRender(), sgnlSetIdle(), slotPauseTimers(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotLoadScene | ( | const Options & | opt | ) | [private, slot] |
Loads a new scene file. Emits sgnlSetView
opt | : const Options& - to be used in constructing an ioCore::Scene object. |
References Ui_MainWindow::actionOpenScene, areThereCustomPlugins, Core::Mesh::diagonal(), dspeed, ioCore::Scene::getMeshFilename(), ioCore::Scene::getTitle(), ioCore::Scene::getViewParameters(), ioCore::Scene::load(), mesh, rspeed, scene, sgnlSetView(), slotConvertDollySpeed(), slotConvertRotationSpeed(), slotConvertTranslationSpeed(), tspeed, ui, rtVTK::RenderWindow::updateTitle(), and winRender.
Referenced by MainWindow().
void rtVTK::MainWindow::slotLoadView | ( | ) | [private, slot] |
Allows user to select a View file to be loaded.
Emits sgnlSetView if a view is loaded.
References config, ioCore::Scene::ViewParameters::eye, ioCore::Scene::ViewParameters::fov, ioCore::Scene::ViewParameters::lookat, sgnlRender(), sgnlSetIdle(), sgnlSetView(), slotPauseTimers(), slotUnpauseTimers(), ui, and ioCore::Scene::ViewParameters::up.
Referenced by MainWindow().
void rtVTK::MainWindow::slotNewRay | ( | ) | [private, slot] |
References sgnlNewRay().
void rtVTK::MainWindow::slotOpenScene | ( | ) | [private, slot] |
Displays a dialog box and allows the user to select a scene file.
Emits sgnlLoadScene.
References ioCore::Options::bname, config, ioCore::Options::fname, ioCore::Options::path, sgnlLoadScene(), sgnlSetIdle(), slotPauseTimers(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotPauseTimers | ( | ) | [private, slot] |
Forward signal along to TimerDialog to pause the timers.
References sgnlPauseTimers().
Referenced by event(), MainWindow(), slotBackground(), slotLoadMesh(), slotLoadView(), slotOpenScene(), slotSaveImage(), slotSaveView(), slotSetDefaultScene(), slotShowMainDocs(), slotShowPipeline(), slotShowUsingDocs(), and slotShowWritingDocs().
void rtVTK::MainWindow::slotResetRL | ( | ) | [private, slot] |
References rl::RayLogger::close(), rl::DepthFirst, rl::ImmediateMode, rl::RayLogger::init(), and rlRayLogger.
Referenced by MainWindow().
void rtVTK::MainWindow::slotRestoreIdle | ( | ) | [private, slot] |
Continues idling where it was last left off. Does not re-render the window because that would lose all of the previous calculations and start over from scratch.
References sgnlSetIdle(), and ui.
Referenced by eventFilter(), and MainWindow().
void rtVTK::MainWindow::slotSaveImage | ( | ) | [private, slot] |
Allows user to save an image of the view currently displayed by glWidget.
References glw, sgnlSetIdle(), slotPauseTimers(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotSaveView | ( | ) | [private, slot] |
Allows user to save the current view information to a file.
References config, uiCore::Trackball::getEye(), uiCore::Trackball::getFOV(), uiCore::Trackball::getLook(), rtVTK::glWidget::getTrackball(), uiCore::Trackball::getUp(), glw, sgnlSetIdle(), slotPauseTimers(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotSetActivePlugins | ( | const vector< string > & | names | ) | [private, slot] |
Given a set of plugin names, this function queries PluginManager for the plugins and replaces the current pipeline with them.
The plugins become, in the order they are passed, the rendering pipeline.
names | : const vector<string>& - names of plugins to be set as active. |
References rtVTK::Plugin::callResize(), rtVTK::PluginManager::getPluginByName(), glw, pipeline, pmgr, sgnlRender(), sgnlSetIdle(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotSetDefaultScene | ( | ) | [private, slot] |
Opens the select file dialog box for user to choose a default scene.
References config, rtVTK::Configuration::setDefaultScene(), sgnlSetIdle(), slotPauseTimers(), slotUnpauseTimers(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotSetLookModeEye | ( | ) | [private, slot] |
Emits sgnlSetLookMode with argument uiCore::Eye.
References uiCore::Eye, and sgnlSetLookMode().
Referenced by MainWindow().
void rtVTK::MainWindow::slotSetLookModeFocal | ( | ) | [private, slot] |
Emits sgnlSetLookMode with argument uiCore::Lookat.
References uiCore::Lookat, and sgnlSetLookMode().
Referenced by MainWindow().
void rtVTK::MainWindow::slotShowAbout | ( | ) | [private, slot] |
References dlgAbout.
Referenced by MainWindow().
void rtVTK::MainWindow::slotShowMainDocs | ( | ) | [private, slot] |
Shows main documentation window, setting webView URL to the location of the documentation files.
References config, rtVTK::Documentation::setPath(), sgnlSetIdle(), slotPauseTimers(), ui, and winDoc.
Referenced by MainWindow(), and setShortcuts().
void rtVTK::MainWindow::slotShowPipeline | ( | ) | [private, slot] |
Retrieves names of loaded plugins from PluginManager and of active plugins from glWidget.
Passes this information to pipeline's populate function.
References dlgPipeline, rtVTK::PluginManager::getInitPluginNames(), pipeline, pmgr, rtVTK::PipelineDialog::populate(), sgnlSetIdle(), and slotPauseTimers().
Referenced by MainWindow().
void rtVTK::MainWindow::slotShowTimerDialog | ( | ) | [private, slot] |
This will tell the TimerDialog that it needs to populate the list of plugins to prepare for showing the potential slots for the user to choose from.
References dlgTimer, and rtVTK::TimerDialog::populate().
Referenced by MainWindow().
void rtVTK::MainWindow::slotShowUsingDocs | ( | ) | [private, slot] |
Shows "Using rtVTK" documentation window, setting webView URL to the location of the documentation files.
References config, rtVTK::Documentation::setPath(), sgnlSetIdle(), slotPauseTimers(), ui, and winDoc.
Referenced by MainWindow().
void rtVTK::MainWindow::slotShowWritingDocs | ( | ) | [private, slot] |
Shows "Writing Plugins" documentation window, setting webView URL to the location of the documentation files.
References config, rtVTK::Documentation::setPath(), sgnlSetIdle(), slotPauseTimers(), ui, and winDoc.
Referenced by MainWindow().
void rtVTK::MainWindow::slotToggleAdvancedSettings | ( | ) | [private, slot] |
Changes the visibility of advanced camera speed settings, such as rotation translation, and dolly speeds, as well as the field of view.
References Ui_MainWindow::frame_advancedSettings, and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotToggleFullScreenMode | ( | bool | on | ) | [private, slot] |
Toggles fullscreen mode. Emits sgnlRender.
on | : bool - true if fullscreen is being turned on; false otherwise. |
References Ui_MainWindow::actionFullscreen, isInSlotFullScreenMode, sgnlRender(), ui, userResizedCaptured, and winRender.
Referenced by MainWindow().
void rtVTK::MainWindow::slotToggleIdle | ( | ) | [private, slot] |
Toggles the idle state.
Emits the new toggle state.
References sgnlSetIdle(), and ui.
Referenced by MainWindow().
void rtVTK::MainWindow::slotUnloadDLL | ( | QAction * | choice | ) | [private, slot] |
This function takes the name of a given plugin and calls PluginManager::unload() for that plugin. The plugin is removed from the pipeline if necessary. The plugin's tab on the main window is destroyed.
choice | : QAction* - the item that has been selected from the Unload Plugin menu. |
References rtVTK::PluginManager::getPluginByName(), pipeline, pluginToTab, pmgr, rtVTK::Plugin::requiresTab, scrollAreas, scrollAreasContents, sgnlRender(), ui, and rtVTK::PluginManager::unload().
Referenced by MainWindow().
void rtVTK::MainWindow::slotUnpauseTimers | ( | ) | [private, slot] |
Forward signal along to TimerDialog to resume the timers.
References sgnlUnpauseTimers().
Referenced by event(), MainWindow(), slotBackground(), slotLoadMesh(), slotLoadView(), slotOpenScene(), slotSaveImage(), slotSaveView(), slotSetActivePlugins(), and slotSetDefaultScene().
void rtVTK::MainWindow::slotUpdateCoords | ( | const Camera & | camera | ) | [slot] |
Outputs camera coordinates to the status bar. Emits sgnlCoordChanged to change the labels at the bottom of the render window.
camera | : const uiCore::Camera& - camera to be used for output. |
References uiCore::Camera::getEye(), uiCore::Camera::getFOV(), uiCore::Camera::getLook(), sgnlCoordsChanged(), and ui.
Referenced by MainWindow().
bool rtVTK::MainWindow::areThereCustomPlugins [private] |
Referenced by MainWindow(), and slotLoadScene().
Configuration rtVTK::MainWindow::config [private] |
The current configuration
Referenced by getConfigDir(), loadDefaultScene(), MainWindow(), slotLoadMesh(), slotLoadView(), slotOpenScene(), slotSaveView(), slotSetDefaultScene(), slotShowMainDocs(), slotShowUsingDocs(), and slotShowWritingDocs().
AboutDialog* rtVTK::MainWindow::dlgAbout [private] |
Referenced by MainWindow(), and slotShowAbout().
PipelineDialog* rtVTK::MainWindow::dlgPipeline [private] |
Referenced by MainWindow(), slotShowPipeline(), and ~MainWindow().
TimerDialog* rtVTK::MainWindow::dlgTimer [private] |
Referenced by MainWindow(), slotShowTimerDialog(), and ~MainWindow().
float rtVTK::MainWindow::dspeed [private] |
Referenced by slotConvertDollySpeed(), and slotLoadScene().
glWidget* rtVTK::MainWindow::glw [private] |
glw leverages function calls inherited from QGLWidget to draw to the main window. Actual rendering is done by the plugins that glw aggregates.
Referenced by getGLW(), initializePlugin(), MainWindow(), setShortcuts(), slotCopyImage(), slotSaveImage(), slotSaveView(), and slotSetActivePlugins().
bool rtVTK::MainWindow::isInSlotFullScreenMode [private] |
Got sick and tired of ResizeEvent() doing silly things. This prevents it from doing weird, double call stuff.
Referenced by eventFilter(), and slotToggleFullScreenMode().
set<QKeySequence> rtVTK::MainWindow::keyCombos [mutable, private] |
rtVTK Shortcut Policy: All shortcut key combos must be added to this data structure. This is a record of existing combinations so that before a new shortcut is created, it is verified that the desired key sequence does not already exist. Shortcuts with multiple connections are rejected by Qt as ambiguous and neither connection is executed.
std::set stores unique elements and the elements are the keys. Because std::set is implemented as a binary tree, accessing elements is more efficient than linear search. To compare to a less efficient implementation using std::vector, go to:
git branch c03e63698e65b63c1ea8eb8d4cd33c9867c883ef
NOTE (ajc) Mutable. Because MainWindow's mutators for the keyCombos is, a const function, I needed a way for the MainWindow object to be able make an internal change. This member is private and is unchangeable by outsiders when getTakenKeyCombos() is called. If an outsider needs to checkout a shortcut, they will attempt to checkout the QKeySquence and if MainWindow returns back true, then the plugin is permitted to connecting QShortcuts around. If false, the plugin should not move forward with connecting the shortcut
Q: Why not just pass by ref the private member to plugins like with TimerDialog?
A: Plugins are "dangerous". TimerDialog is written by us, so it is known how the reference is used/modified, viz. TimerDialog is not dangerous. Plugins shall use the MainWindow interface for claiming and releasing shortcut key combinations.
Referenced by claimKeyCombo(), getTakenKeyCombos(), releaseKeyCombo(), and setShortcuts().
Mesh rtVTK::MainWindow::mesh [private] |
The current mesh, loaded from file.
Referenced by initializePlugin(), slotLoadMesh(), and slotLoadScene().
vector<Plugin*> rtVTK::MainWindow::pipeline [private] |
The container which holds a pointer for each of the active plugins.
Referenced by slotSetActivePlugins(), slotShowPipeline(), and slotUnloadDLL().
map<const QKeySequence, const QObject*> rtVTK::MainWindow::pluginShortcutOwnership [mutable, private] |
Keeps track of which shortcuts were created by which plugin. Their plugin "owner" reserves the right to delete them. Other plugins may not delete them. This design makes it acceptable to use mutable. Shortcuts owned by MainWindow (including user created Timers) are not stored in this container.
Unique Key: QKeySequence shortcut Non-key data: QObject* owner of the shortcut
Referenced by claimKeyCombo(), and releaseKeyCombo().
map<Plugin*, QWidget*> rtVTK::MainWindow::pluginToTab [private] |
Maps Plugin IDs to tab widgets.
Referenced by initializePlugin(), slotEstablishTabsForActivePlugins(), and slotUnloadDLL().
PluginManager* rtVTK::MainWindow::pmgr [private] |
pmgr is used to control loading, unloading, and aggregation of plugins
Referenced by MainWindow(), slotEstablishTabsForActivePlugins(), slotLoadDLL(), slotSetActivePlugins(), slotShowPipeline(), slotUnloadDLL(), and ~MainWindow().
rl::RayLogger rtVTK::MainWindow::rlRayLogger [mutable, private] |
An instance of rl::RayLogger to deal with rl immediate-mode
Referenced by getRL(), and slotResetRL().
float rtVTK::MainWindow::rspeed [private] |
Referenced by slotConvertRotationSpeed(), and slotLoadScene().
Scene rtVTK::MainWindow::scene [private] |
The current scene, loaded from file.
Referenced by slotLoadScene().
vector<QScrollArea*> rtVTK::MainWindow::scrollAreas [private] |
Referenced by initializePlugin(), slotUnloadDLL(), and ~MainWindow().
vector<QWidget*> rtVTK::MainWindow::scrollAreasContents [private] |
Referenced by initializePlugin(), slotUnloadDLL(), and ~MainWindow().
vector<QShortcut*> rtVTK::MainWindow::shortcuts [private] |
Vector to aggregate keyboard shortcuts pointers (i.e. pressing 'f' to adjust the field of view) local to MainWindow. and another to keep a list of shortcut combos. This data structure is not used outside of the class, unlike keyCombos which is. This data structure is used to properly delete the dynamic shortcuts during destruction. Removal of this member would not be acceptable.
Referenced by setShortcuts(), and ~MainWindow().
float rtVTK::MainWindow::tspeed [private] |
Referenced by slotConvertTranslationSpeed(), and slotLoadScene().
Ui::MainWindow* rtVTK::MainWindow::ui [private] |
ui is auto-generated by Qt. It aggregates all components placed on the main window GUI. Additionally, UI components may be added to the window programmatically by adding them to this member.
Referenced by event(), eventFilter(), initializePlugin(), MainWindow(), setShortcuts(), slotBackground(), slotConvertDollySpeed(), slotConvertFOV(), slotConvertRotationSpeed(), slotConvertTranslationSpeed(), slotCopyImage(), slotDecrDolly(), slotDecrFOV(), slotDecrRotation(), slotDecrTranslation(), slotEstablishTabsForActivePlugins(), slotIncrDolly(), slotIncrFOV(), slotIncrRotation(), slotIncrTranslation(), slotLoadDLL(), slotLoadMesh(), slotLoadScene(), slotLoadView(), slotOpenScene(), slotRestoreIdle(), slotSaveImage(), slotSaveView(), slotSetActivePlugins(), slotSetDefaultScene(), slotShowMainDocs(), slotShowUsingDocs(), slotShowWritingDocs(), slotToggleAdvancedSettings(), slotToggleFullScreenMode(), slotToggleIdle(), slotUnloadDLL(), slotUpdateCoords(), and ~MainWindow().
bool rtVTK::MainWindow::userResizedCaptured [private] |
Got sick and tired of slotFullScreenMode() doing silly things. This prevents it from jumping to an old size of winRender when the user manually resizes winRender.
Referenced by eventFilter(), and slotToggleFullScreenMode().
Documentation* rtVTK::MainWindow::winDoc [private] |
The most recent documentation window, created on menu item selection.
Referenced by MainWindow(), slotShowMainDocs(), slotShowUsingDocs(), slotShowWritingDocs(), and ~MainWindow().
RenderWindow* rtVTK::MainWindow::winRender [private] |
Referenced by event(), MainWindow(), show(), slotLoadScene(), and slotToggleFullScreenMode().