Stellarium 0.13.0
List of all members | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties
StelApp Class Reference

Singleton main Stellarium application class. More...

#include <StelApp.hpp>

Public Slots

void setVisionModeNight (bool)
 Set flag for activating night vision mode. More...
 
bool getVisionModeNight () const
 Get flag for activating night vision mode. More...
 
float getFps () const
 Get the current number of frame per second. More...
 
static double getTotalRunTime ()
 Return the time since when stellarium is running in second. More...
 
void reportFileDownloadFinished (QNetworkReply *reply)
 Report that a download occured. More...
 

Signals

void visionNightModeChanged (bool)
 
void colorSchemeChanged (const QString &)
 
void languageChanged ()
 
void skyCultureChanged (const QString &)
 
void progressBarAdded (const StelProgressController *)
 Called just after a progress bar is added. More...
 
void progressBarRemoved (const StelProgressController *)
 Called just before a progress bar is removed. More...
 

Public Member Functions

 StelApp (QObject *parent=NULL)
 Create and initialize the main Stellarium application. More...
 
virtual ~StelApp ()
 Deinitialize and destroy the main Stellarium application. More...
 
void init (QSettings *conf)
 Initialize core and all the modules. More...
 
void deinit ()
 Deinitialize core and all the modules. More...
 
void initPlugIns ()
 Load and initialize external modules (plugins) More...
 
StelModuleMgrgetModuleMgr ()
 Get the module manager to use for accessing any module loaded in the application. More...
 
StelLocaleMgrgetLocaleMgr ()
 Get the locale manager to use for i18n & date/time localization. More...
 
StelSkyCultureMgrgetSkyCultureMgr ()
 Get the sky cultures manager. More...
 
StelTextureMgrgetTextureManager ()
 Get the texture manager to use for loading textures. More...
 
StelLocationMgrgetLocationMgr ()
 Get the Location manager to use for managing stored locations. More...
 
StelObjectMgrgetStelObjectMgr ()
 Get the StelObject manager to use for querying from all stellarium objects. More...
 
StelSkyLayerMgrgetSkyImageMgr ()
 
StelAudioMgrgetStelAudioMgr ()
 Get the audio manager. More...
 
StelActionMgrgetStelActionManager ()
 Get the actions manager to use for managing and editing actions. More...
 
StelVideoMgrgetStelVideoMgr ()
 Get the video manager. More...
 
StelCoregetCore ()
 Get the core of the program. More...
 
QNetworkAccessManager * getNetworkAccessManager ()
 Get the common instance of QNetworkAccessManager used in stellarium. More...
 
void updateI18n ()
 Update translations, font for GUI and sky everywhere in the program. More...
 
void updateSkyCulture ()
 Update and reload sky culture informations everywhere in the program. More...
 
QSettings * getSettings ()
 Return the main configuration options. More...
 
QString getCurrentStelStyle ()
 Return the currently used style. More...
 
void update (double deltaTime)
 Update all object according to the deltaTime in seconds. More...
 
void draw ()
 Draw all registered StelModule in the order defined by the order lists. More...
 
bool drawPartial ()
 Iterate through the drawing sequence. More...
 
void glWindowHasBeenResized (float x, float y, float w, float h)
 Call this when the size of the GL window has changed. More...
 
float getDevicePixelsPerPixel () const
 Get the ratio between real device pixel and "Device Independent Pixel". More...
 
void setDevicePixelsPerPixel (float dppp)
 
float getGlobalScalingRatio () const
 Get the scaling ratio to apply on all display elements, like GUI, text etc. More...
 
void setGlobalScalingRatio (float r)
 
StelGuiBasegetGui () const
 Get the GUI instance implementing the abstract GUI interface. More...
 
void setGui (StelGuiBase *b)
 Tell the StelApp instance which GUI si currently being used. More...
 
StelMainScriptAPIProxygetMainScriptAPIProxy ()
 Get the script API proxy (for signal handling) More...
 
StelScriptMgrgetScriptMgr ()
 Get the script manager. More...
 
StelProgressControlleraddProgressBar ()
 Add a progression indicator to the GUI (if applicable). More...
 
void removeProgressBar (StelProgressController *p)
 

Static Public Member Functions

static StelAppgetInstance ()
 Get the StelApp singleton instance. More...
 
static void initStatic ()
 
static void deinitStatic ()
 

Properties

bool nightMode
 

Detailed Description

Singleton main Stellarium application class.

This is the central class of Stellarium. Only one singleton instance of this class is created and can be accessed from anywhere else. This class is the access point to several "Manager" class which provide application-wide services for managment of font, textures, localization, sky culture, and in theory all other services used by the other part of the program.

The StelApp class is also the one managing the StelModule in a generic manner by calling their update, drawing and other methods when needed.

Author
Fabien Chereau

Constructor & Destructor Documentation

StelApp::StelApp ( QObject *  parent = NULL)

Create and initialize the main Stellarium application.

Parameters
parentthe QObject parent The configFile will be search for in the search path by the StelFileMgr, it is therefor possible to specify either just a file name or path within the search path, or use a full path or even a relative path to an existing file
virtual StelApp::~StelApp ( )
virtual

Deinitialize and destroy the main Stellarium application.

Member Function Documentation

StelProgressController* StelApp::addProgressBar ( )

Add a progression indicator to the GUI (if applicable).

Returns
a controller which can be used to indicate the current status. The StelApp instance remains the owner of the controller.
void StelApp::deinit ( )

Deinitialize core and all the modules.

void StelApp::draw ( )

Draw all registered StelModule in the order defined by the order lists.

Returns
the max squared distance in pixels that any object has travelled since the last update.
bool StelApp::drawPartial ( )

Iterate through the drawing sequence.

This allow us to split the slow drawing operation into small parts, we can then decide to pause the painting for this frame and used the cached image instead.

Returns
true if we should continue drawing (by calling the method again)
StelCore* StelApp::getCore ( )
inline

Get the core of the program.

It is the one which provide the projection, navigation and tone converter.

Returns
the StelCore instance of the program
QString StelApp::getCurrentStelStyle ( )
inline

Return the currently used style.

float StelApp::getDevicePixelsPerPixel ( ) const
inline

Get the ratio between real device pixel and "Device Independent Pixel".

Usually this value is 1, but for a mac with retina screen this will be value 2.

float StelApp::getFps ( ) const
inlineslot

Get the current number of frame per second.

Returns
the FPS averaged on the last second
float StelApp::getGlobalScalingRatio ( ) const
inline

Get the scaling ratio to apply on all display elements, like GUI, text etc.

When this ratio is 1, all pixel sizes used in Stellarium will look OK on a regular computer screen with 96 pixel per inch (reference for tuning sizes).

StelGuiBase* StelApp::getGui ( ) const
inline

Get the GUI instance implementing the abstract GUI interface.

static StelApp& StelApp::getInstance ( )
inlinestatic

Get the StelApp singleton instance.

Returns
the StelApp singleton instance
StelLocaleMgr& StelApp::getLocaleMgr ( )
inline

Get the locale manager to use for i18n & date/time localization.

Returns
the font manager to use for loading fonts.
StelLocationMgr& StelApp::getLocationMgr ( )
inline

Get the Location manager to use for managing stored locations.

Returns
the Location manager to use for managing stored locations
StelMainScriptAPIProxy* StelApp::getMainScriptAPIProxy ( )
inline

Get the script API proxy (for signal handling)

StelModuleMgr& StelApp::getModuleMgr ( )
inline

Get the module manager to use for accessing any module loaded in the application.

Returns
the module manager.
QNetworkAccessManager* StelApp::getNetworkAccessManager ( )
inline

Get the common instance of QNetworkAccessManager used in stellarium.

StelScriptMgr& StelApp::getScriptMgr ( )
inline

Get the script manager.

QSettings* StelApp::getSettings ( )
inline

Return the main configuration options.

StelSkyCultureMgr& StelApp::getSkyCultureMgr ( )
inline

Get the sky cultures manager.

Returns
the sky cultures manager
StelActionMgr* StelApp::getStelActionManager ( )
inline

Get the actions manager to use for managing and editing actions.

StelAudioMgr* StelApp::getStelAudioMgr ( )
inline

Get the audio manager.

StelObjectMgr& StelApp::getStelObjectMgr ( )
inline

Get the StelObject manager to use for querying from all stellarium objects.

Returns
the StelObject manager to use for querying from all stellarium objects .
StelVideoMgr* StelApp::getStelVideoMgr ( )
inline

Get the video manager.

StelTextureMgr& StelApp::getTextureManager ( )
inline

Get the texture manager to use for loading textures.

Returns
the texture manager to use for loading textures.
static double StelApp::getTotalRunTime ( )
staticslot

Return the time since when stellarium is running in second.

bool StelApp::getVisionModeNight ( ) const
inlineslot

Get flag for activating night vision mode.

void StelApp::glWindowHasBeenResized ( float  x,
float  y,
float  w,
float  h 
)

Call this when the size of the GL window has changed.

void StelApp::init ( QSettings *  conf)

Initialize core and all the modules.

void StelApp::initPlugIns ( )

Load and initialize external modules (plugins)

void StelApp::progressBarAdded ( const StelProgressController )
signal

Called just after a progress bar is added.

void StelApp::progressBarRemoved ( const StelProgressController )
signal

Called just before a progress bar is removed.

void StelApp::reportFileDownloadFinished ( QNetworkReply *  reply)
slot

Report that a download occured.

This is used for statistics purposes. Connect this slot to QNetworkAccessManager::finished() slot to obtain statistics at the end of the program.

void StelApp::setGui ( StelGuiBase b)
inline

Tell the StelApp instance which GUI si currently being used.

The caller is responsible for destroying the GUI.

void StelApp::setVisionModeNight ( bool  )
slot

Set flag for activating night vision mode.

void StelApp::update ( double  deltaTime)

Update all object according to the deltaTime in seconds.

void StelApp::updateI18n ( )

Update translations, font for GUI and sky everywhere in the program.

void StelApp::updateSkyCulture ( )

Update and reload sky culture informations everywhere in the program.