Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

StelApp Class Reference

Singleton main Stellarium application class. More...

#include <StelApp.hpp>

List of all members.

Public Slots

static QString getApplicationName ()
static QString getApplicationVersion ()
void setVisionModeNight (bool)
bool getVisionModeNight () const
void setMinFps (float m)
float getMinFps ()
void setMaxFps (float m)
float getMaxFps ()
float getFps () const
static double getTotalRunTime ()
void reportFileDownloadFinished (QNetworkReply *reply)

Signals

void minFpsChanged ()

Public Member Functions

 StelApp (int argc, char **argv, QObject *parent=NULL)
virtual ~StelApp ()
void init ()
void initPlugIns ()
StelModuleMgrgetModuleMgr ()
StelLocaleMgrgetLocaleMgr ()
StelFontMgrgetFontManager ()
StelSkyCultureMgrgetSkyCultureMgr ()
StelTextureMgrgetTextureManager ()
StelLocationMgrgetLocationMgr ()
StelObjectMgrgetStelObjectMgr ()
StelSkyImageMgrgetSkyImageMgr ()
StelFileMgrgetFileMgr ()
StelAudioMgr * getStelAudioMgr ()
StelScriptMgrgetScriptMgr ()
StelDownloadMgrgetDownloadMgr ()
StelCoregetCore ()
StelLoadingBargetStelLoadingBar ()
QNetworkAccessManager * getNetworkAccessManager ()
void updateI18n ()
void updateSkyCulture ()
const QString & getConfigFilePath ()
QSettings * getSettings ()
const StelStylegetCurrentStelStyle ()
QString getLog ()
QString getStartupScript () const

Static Public Member Functions

static StelAppgetInstance ()
static void debugLogHandler (QtMsgType, const char *)


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 ( int  argc,
char **  argv,
QObject *  parent = NULL 
)

Create and initialize the main Stellarium application.

Parameters:
argc The number of command line parameters
argv an array of char* command line arguments
parent the 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

void StelApp::init (  ) 

Initialize core and default modules.

void StelApp::initPlugIns (  ) 

Load and initialize external modules (plugins).

static StelApp& StelApp::getInstance (  )  [inline, static]

Get the StelApp singleton instance.

Returns:
the StelApp singleton instance

StelModuleMgr& StelApp::getModuleMgr (  )  [inline]

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

Returns:
the module manager.

StelLocaleMgr& StelApp::getLocaleMgr (  )  [inline]

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

Returns:
the font manager to use for loading fonts.

StelFontMgr& StelApp::getFontManager (  )  [inline]

Get the font manager to use for loading fonts.

Returns:
the font manager to use for loading fonts.

StelSkyCultureMgr& StelApp::getSkyCultureMgr (  )  [inline]

Get the sky cultures manager.

Returns:
the sky cultures manager

StelTextureMgr& StelApp::getTextureManager (  )  [inline]

Get the texture manager to use for loading textures.

Returns:
the texture manager to use for loading textures.

StelLocationMgr& StelApp::getLocationMgr (  )  [inline]

Get the Location manager to use for managing stored locations.

Returns:
the Location manager to use for managing stored locations

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 .

StelSkyImageMgr& StelApp::getSkyImageMgr (  )  [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 .

StelFileMgr& StelApp::getFileMgr (  )  [inline]

Get the StelFileMgr for performing file operations.

Returns:
the StelFileMgr manager to use for performing file operations

StelScriptMgr& StelApp::getScriptMgr (  )  [inline]

Get the script manager.

StelDownloadMgr& StelApp::getDownloadMgr (  )  [inline]

Get the download manager.

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

StelLoadingBar* StelApp::getStelLoadingBar (  )  [inline]

Get the main loading bar used by modules for displaying loading informations.

Returns:
the main StelLoadingBar instance of the program.

QNetworkAccessManager* StelApp::getNetworkAccessManager (  )  [inline]

Get the common instance of QNetworkAccessManager used in stellarium.

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.

const QString& StelApp::getConfigFilePath (  )  [inline]

Retrieve the full path of the current configuration file.

Returns:
the full path of the configuration file

QSettings* StelApp::getSettings (  )  [inline]

Return the main configuration options.

const StelStyle* StelApp::getCurrentStelStyle (  )  [inline]

Return the currently used style.

static void StelApp::debugLogHandler ( QtMsgType  ,
const char *   
) [static]

Handler for qDebug() and friends.

Writes message to log file at $USERDIR/log.txt and echoes to stderr. Do not call this function; it's only for use by qInstallMsgHandler. Use writeLog(QString) instead, but preferably qDebug().

QString StelApp::getLog (  )  [inline]

Return a copy of text of the log file.

QString StelApp::getStartupScript (  )  const [inline]

Get the file name of the startup script.

static QString StelApp::getApplicationName (  )  [static, slot]

Return the full name of stellarium, i.e. "Stellarium 0.9.0".

static QString StelApp::getApplicationVersion (  )  [static, slot]

Return the version of stellarium, i.e. "0.9.0".

void StelApp::setVisionModeNight ( bool   )  [slot]

Set flag for activating night vision mode.

bool StelApp::getVisionModeNight (  )  const [inline, slot]

Get flag for activating night vision mode.

void StelApp::setMinFps ( float  m  )  [inline, slot]

Set the minimum frames per second.

Usually this minimum will be switched to after there are no user events for some seconds to save power. However, if can be useful to set this to a high value to improve playing smoothness in scripts.

Parameters:
m the new minimum fps setting.

float StelApp::getMinFps (  )  [inline, slot]

Get the current minimum frames per second.

void StelApp::setMaxFps ( float  m  )  [inline, slot]

Set the maximum frames per second.

Parameters:
m the new maximum fps setting.

float StelApp::getMaxFps (  )  [inline, slot]

Get the current maximum frames per second.

float StelApp::getFps (  )  const [inline, slot]

Get the current number of frame per second.

Returns:
the FPS averaged on the last second

static double StelApp::getTotalRunTime (  )  [static, slot]

Return the time since when stellarium is running in second.

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.


Generated on Mon Mar 9 16:16:16 2009 for Stellarium by  doxygen 1.5.5