Radium Engine
1.5.20
|
This class contains the main application logic. It owns the engine and the GUI. More...
#include <Gui/BaseApplication.hpp>
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. | |
bool | isRunning () const |
const Engine::RadiumEngine * | getEngine () const |
Viewer * | getViewer () |
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.
|
override |
Definition at line 578 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::addPluginDirectory | ( | const std::string & | pluginDir | ) |
Allow the user to register a specific plugin directory for the application.
Definition at line 755 of file BaseApplication.cpp.
void Ra::Gui::BaseApplication::addRadiumMenu | ( | ) |
Definition at line 389 of file BaseApplication.cpp.
|
slot |
Definition at line 546 of file BaseApplication.cpp.
|
inlineslot |
Definition at line 205 of file BaseApplication.hpp.
void Ra::Gui::BaseApplication::clearPluginDirectories | ( | ) |
Remove all registered plugin directories (except the default Radium Bundle one)
Definition at line 767 of file BaseApplication.cpp.
|
protected |
Create signal / slots connections.
Definition at line 412 of file BaseApplication.cpp.
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.
|
virtualslot |
slot called when the OpenGL need to be initialized
Definition at line 407 of file BaseApplication.cpp.
|
slot |
Definition at line 465 of file BaseApplication.cpp.
|
inline |
Definition at line 130 of file BaseApplication.hpp.
|
inline |
Definition at line 135 of file BaseApplication.hpp.
|
inline |
Definition at line 133 of file BaseApplication.hpp.
|
virtual |
Get the html formatted help text.
Definition at line 778 of file BaseApplication.cpp.
|
inline |
Definition at line 131 of file BaseApplication.hpp.
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.
|
inline |
Definition at line 128 of file BaseApplication.hpp.
|
inlineprotected |
check wheter someone ask for update
Definition at line 222 of file BaseApplication.hpp.
|
slot |
Definition at line 446 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.
|
inlineslot |
Definition at line 197 of file BaseApplication.hpp.
void Ra::Gui::BaseApplication::radiumFrame | ( | ) |
Advance the engine for one frame.
Definition at line 469 of file BaseApplication.cpp.
|
slot |
Definition at line 571 of file BaseApplication.cpp.
|
inlineslot |
Definition at line 199 of file BaseApplication.hpp.
|
inlineprotected |
if b is true, then update anyway. If b is false, update on request only
Definition at line 225 of file BaseApplication.hpp.
|
slot |
Definition at line 561 of file BaseApplication.cpp.
|
slot |
Definition at line 565 of file BaseApplication.cpp.
|
slot |
Definition at line 751 of file BaseApplication.cpp.
|
slot |
Definition at line 747 of file BaseApplication.cpp.
|
protected |
Definition at line 428 of file BaseApplication.cpp.
|
inlineslot |
Definition at line 176 of file BaseApplication.hpp.
|
protected |
If counter is >= 0, continuously update viewer frame.
Definition at line 282 of file BaseApplication.hpp.
Engine::RadiumEngine* Ra::Gui::BaseApplication::m_engine |
Instance of the radium engine.
Definition at line 233 of file BaseApplication.hpp.
|
protected |
Name of the folder where exported data goes.
Definition at line 266 of file BaseApplication.hpp.
|
protected |
Definition at line 255 of file BaseApplication.hpp.
|
protected |
Definition at line 254 of file BaseApplication.hpp.
|
protected |
Timer to wake us up at every frame start.
Definition at line 249 of file BaseApplication.hpp.
|
protected |
True if the applicatioon is about to quit. prevent to use resources that are being released.
Definition at line 276 of file BaseApplication.hpp.
|
protected |
If true update the viewer frame next time.
Definition at line 279 of file BaseApplication.hpp.
|
protected |
Time since the last frame start.
Definition at line 252 of file BaseApplication.hpp.
|
protected |
maps name and paths of already loaded plugins
Definition at line 288 of file BaseApplication.hpp.
std::unique_ptr<Gui::MainWindowInterface> Ra::Gui::BaseApplication::m_mainWindow |
Application main window and GUI root class.
Definition at line 230 of file BaseApplication.hpp.
|
protected |
Definition at line 257 of file BaseApplication.hpp.
|
protected |
Definition at line 256 of file BaseApplication.hpp.
|
protected |
Plugins that need to be initialized once OpenGL is ready.
Definition at line 243 of file BaseApplication.hpp.
|
protected |
Definition at line 285 of file BaseApplication.hpp.
|
protected |
Definition at line 284 of file BaseApplication.hpp.
|
protected |
Definition at line 259 of file BaseApplication.hpp.
|
protected |
If true, use the wall clock to advance the engine. If false, use a fixed time step.
Definition at line 262 of file BaseApplication.hpp.
|
protected |
If true, dump each frame to a PNG file.
Definition at line 269 of file BaseApplication.hpp.
|
protected |
If true, print the task graph;.
Definition at line 273 of file BaseApplication.hpp.
|
protected |
If true, print the detailed timings of each frame.
Definition at line 271 of file BaseApplication.hpp.
uint Ra::Gui::BaseApplication::m_targetFPS |
Number of frames per second to generate.
Definition at line 239 of file BaseApplication.hpp.
std::unique_ptr<Core::TaskQueue> Ra::Gui::BaseApplication::m_taskQueue |
Task queue for processing tasks.
Definition at line 236 of file BaseApplication.hpp.
|
protected |
Definition at line 258 of file BaseApplication.hpp.
|
protected |
Pointer to OpenGL Viewer for render call (belongs to MainWindow).
Definition at line 246 of file BaseApplication.hpp.