Radium Engine
1.5.0
|
This class contains the main application logic. It owns the engine and the GUI. More...
#include <Gui/BaseApplication.hpp>
Inherits QApplication.
Public Slots | |
virtual void | engineOpenGLInitialize () |
slot called when the OpenGL need to be initialized | |
virtual void | initializeGl () |
void | updateRadiumFrameIfNeeded () |
bool | loadFile (QString path) |
void | framesCountForStatsChanged (uint count) |
void | appNeedsToQuit () |
void | setRealFrameRate (bool on) |
void | setRecordFrames (bool on) |
void | setRecordTimings (bool on) |
void | setRecordGraph (bool on) |
void | recordFrame () |
void | onSelectedItem (const Ra::Engine::Scene::ItemEntry &entry) |
void | setContinuousUpdate (bool b) |
void | askForUpdate () |
Signals | |
void | starting () |
Fired when the engine has just started, before the frame timer is set. | |
void | stopping () |
Fired when the engine is about to stop. | |
void | sceneChanged (const Core::Aabb &) |
Fired when the scene has changed. | |
void | updateFrameStats (const std::vector< FrameTimerData > &) |
void | loadComplete () |
void | selectedItem (const Ra::Engine::Scene::ItemEntry &entry) |
Public Member Functions | |
BaseApplication (int &argc, char **argv, QString applicationName="RadiumEngine", QString organizationName="STORM-IRIT") | |
void | initialize (const WindowFactory &factory, const glbinding::Version &glVersion={ 4, 1 }) |
virtual void | engineBaseInitialization () |
virtual void | addApplicationExtension () |
void | radiumFrame () |
Advance the engine for one frame. More... | |
bool | isRunning () const |
const Engine::RadiumEngine * | getEngine () const |
uint | getFrameCount () const |
const std::string & | getExportFolderName () const |
void | addPluginDirectory (const std::string &pluginDir) |
Allow the user to register a specific plugin directory for the application. | |
void | clearPluginDirectories () |
Remove all registered plugin directories (except the default Radium Bundle one) | |
void | editSettings () |
virtual std::string | getHelpText () const |
Get the html formatted help text. | |
void | addRadiumMenu () |
Public Attributes | |
std::unique_ptr< Gui::MainWindowInterface > | m_mainWindow |
Application main window and GUI root class. | |
Engine::RadiumEngine * | m_engine |
Instance of the radium engine. | |
std::unique_ptr< Core::TaskQueue > | m_taskQueue |
Task queue for processing tasks. | |
uint | m_targetFPS |
Number of frames per second to generate. | |
Protected Member Functions | |
void | createConnections () |
Create signal / slots connections. | |
bool | loadPlugins (const std::string &pluginsPath, const QStringList &loadList, const QStringList &ignoreList) |
void | setupScene () |
bool | isUpdateNeeded () |
check wheter someone ask for update | |
void | setIsUpdateNeeded (bool b) |
if b is true, then update anyway. If b is false, update on request only | |
Protected Attributes | |
std::vector< Ra::Plugins::RadiumPluginInterface * > | m_openGLPlugins |
Plugins that need to be initialized once OpenGL is ready. | |
Gui::Viewer * | m_viewer |
Pointer to OpenGL Viewer for render call (belongs to MainWindow). | |
QTimer * | m_frameTimer |
Timer to wake us up at every frame start. | |
Core::Utils::TimePoint | m_lastFrameStart |
Time since the last frame start. | |
uint | m_frameCounter |
uint | m_frameCountBeforeUpdate |
uint | m_numFrames |
uint | m_maxThreads |
std::vector< FrameTimerData > | m_timerData |
std::string | m_pluginPath |
bool | m_realFrameRate |
If true, use the wall clock to advance the engine. If false, use a fixed time step. | |
std::string | m_exportFoldername |
Name of the folder where exported data goes. | |
bool | m_recordFrames |
If true, dump each frame to a PNG file. | |
bool | m_recordTimings |
If true, print the detailed timings of each frame. | |
bool | m_recordGraph |
If true, print the task graph;. | |
bool | m_isAboutToQuit |
True if the applicatioon is about to quit. prevent to use resources that are being released. | |
std::atomic_bool | m_isUpdateNeeded { true } |
If true update the viewer frame next time. | |
std::atomic< int > | m_continuousUpdateRequest { 1 } |
If counter is >= 0, continuously update viewer frame. | |
Plugins::Context | m_pluginContext |
QCommandLineParser * | m_parser |
std::map< std::string, std::string > | m_loadedPlugins |
maps name and paths of already loaded plugins | |
This class contains the main application logic. It owns the engine and the GUI.
Definition at line 31 of file BaseApplication.hpp.
Ra::Gui::BaseApplication::BaseApplication | ( | int & | argc, |
char ** | argv, | ||
QString | applicationName = "RadiumEngine" , |
||
QString | organizationName = "STORM-IRIT" |
||
) |
Setup the application, create main window and main connections.
argc | from main() |
argv | from main() |
applicationName | Name of the application (used to store settings) |
organizationName | Name of the organization (used to store settings) |
The arguments managed from the command line are the following :
[Command line arguments]
[Command line arguments]
Definition at line 62 of file BaseApplication.cpp.
|
inlinevirtual |
Allow derived applications to add specific extensions to the engine and the base application. Such extensions are expected to be :
Definition at line 123 of file BaseApplication.hpp.
void Ra::Gui::BaseApplication::editSettings | ( | ) |
Open the QSetting editor for the current application
Definition at line 772 of file BaseApplication.cpp.
|
virtual |
This method configure the base, non opengl dependant, scene services.
It is expected that this method add the Engine's systems required by the application. and configure the engine time management properties. The default implementation add the following systems :
The default implementation also configure the time system according to the user requested frame rate (app command line argument -framerate) or to the default 60fps.
Definition at line 374 of file BaseApplication.cpp.
void Ra::Gui::BaseApplication::initialize | ( | const WindowFactory & | factory, |
const glbinding::Version & | glVersion = { 4, 1 } |
||
) |
Initialize the application, create the Gui and OpenGL environment. The initialization of an application is made in several steps
factory | : a functor that instanciate the mainWindow |
glVersion | : glbinding::Version of the requested OpenGL Version. If no version is given, the default recommended version for Radium (4.1) will be requested. |
Definition at line 248 of file BaseApplication.cpp.
|
virtualslot |
slot called once the application window and its OpenGL services are ready. TODO : rename this to be more representative of post opengl & gui operations
Definition at line 551 of file BaseApplication.cpp.
|
protected |
Load plugins from the specified folder. If loadList is empty, attempts to load all DLLs in the folder (except those on the ignore list) If loadList contains names it will only look for DLLs in that folder with the given name.
Definition at line 588 of file BaseApplication.cpp.
void Ra::Gui::BaseApplication::radiumFrame | ( | ) |
Advance the engine for one frame.
Definition at line 469 of file BaseApplication.cpp.