Stellarium
0.18.3
|
Singleton main Stellarium application class. More...
#include <StelApp.hpp>
Public Slots | |
void | glWindowHasBeenResized (const QRectF &rect) |
Call this when the size of the GL window has changed. | |
void | setVisionModeNight (bool) |
Set flag for activating night vision mode. | |
bool | getVisionModeNight () const |
Get flag for activating night vision mode. | |
void | setFlagShowDecimalDegrees (bool b) |
Set flag for showing decimal degree in various places. | |
bool | getFlagShowDecimalDegrees () const |
Get flag for showing decimal degree in various places. | |
bool | getFlagSouthAzimuthUsage () const |
Set flag for using calculation of azimuth from south towards west (instead north towards east) | |
void | setFlagSouthAzimuthUsage (bool use) |
Get flag for using calculation of azimuth from south towards west (instead north towards east) | |
void | setFlagUseFormattingOutput (bool b) |
Set flag for using of formatting output for coordinates. | |
bool | getFlagUseFormattingOutput () const |
Get flag for using of formatting output for coordinates. | |
void | setFlagUseCCSDesignation (bool b) |
Set flag for using designations for celestial coordinate systems. | |
bool | getFlagUseCCSDesignation () const |
Get flag for using designations for celestial coordinate systems. | |
float | getFps () const |
Get the current number of frame per second. More... | |
void | setAppFont (QFont font) |
Set global application font. More... | |
quint32 | getDefaultFBO () const |
Returns the default FBO handle, to be used when StelModule instances want to release their own FBOs. More... | |
void | ensureGLContextCurrent () |
Makes sure the correct GL context used for main drawing is made current. More... | |
static double | getTotalRunTime () |
Return the time since when stellarium is running in second. | |
static double | getAnimationTime () |
Return the scaled time for animated objects. | |
void | reportFileDownloadFinished (QNetworkReply *reply) |
Report that a download occured. More... | |
void | quit () |
do some cleanup and call QCoreApplication::exit(0) | |
Signals | |
void | visionNightModeChanged (bool) |
void | flagShowDecimalDegreesChanged (bool) |
void | flagUseAzimuthFromSouthChanged (bool) |
void | flagUseCCSDesignationChanged (bool) |
void | flagUseFormattingOutputChanged (bool) |
void | colorSchemeChanged (const QString &) |
void | languageChanged () |
void | screenFontSizeChanged (int) |
void | guiFontSizeChanged (int) |
void | fontChanged (QFont) |
void | progressBarAdded (const StelProgressController *) |
Called just after a progress bar is added. | |
void | progressBarRemoved (const StelProgressController *) |
Called just before a progress bar is removed. | |
void | aboutToQuit () |
Called just before we exit Qt mainloop. | |
Public Member Functions | |
StelApp (StelMainView *parent) | |
Create and initialize the main Stellarium application. More... | |
virtual | ~StelApp () |
Deinitialize and destroy the main Stellarium application. | |
void | init (QSettings *conf) |
Initialize core and all the modules. | |
void | deinit () |
Deinitialize core and all the modules. | |
void | initPlugIns () |
Load and initialize external modules (plugins) | |
void | initScriptMgr () |
Registers all loaded StelModules with the ScriptMgr, and queues starting of the startup script. | |
StelModuleMgr & | getModuleMgr () const |
Get the module manager to use for accessing any module loaded in the application. More... | |
StelModule * | getModule (const QString &moduleID) const |
Get the corresponding module or Q_NULLPTR if can't find it. More... | |
StelLocaleMgr & | getLocaleMgr () const |
Get the locale manager to use for i18n & date/time localization. More... | |
StelSkyCultureMgr & | getSkyCultureMgr () const |
Get the sky cultures manager. More... | |
StelTextureMgr & | getTextureManager () const |
Get the texture manager to use for loading textures. More... | |
StelLocationMgr & | getLocationMgr () const |
Get the Location manager to use for managing stored locations. More... | |
StelObjectMgr & | getStelObjectMgr () const |
Get the StelObject manager to use for querying from all stellarium objects. More... | |
StelSkyLayerMgr & | getSkyImageMgr () const |
StelAudioMgr * | getStelAudioMgr () const |
Get the audio manager. | |
StelActionMgr * | getStelActionManager () const |
Get the actions manager to use for managing and editing actions. | |
StelPropertyMgr * | getStelPropertyManager () const |
Return the property manager. | |
StelVideoMgr * | getStelVideoMgr () const |
Get the video manager. | |
StelCore * | getCore () const |
Get the core of the program. More... | |
QNetworkAccessManager * | getNetworkAccessManager () const |
Get the common instance of QNetworkAccessManager used in stellarium. | |
void | updateI18n () |
Update translations, font for GUI and sky everywhere in the program. | |
QSettings * | getSettings () const |
Return the main configuration options. | |
const QString | getCurrentStelStyle () const |
Return the currently used style. | |
void | update (double deltaTime) |
Update all object according to the deltaTime in seconds. | |
void | draw () |
Draw all registered StelModule in the order defined by the order lists. | |
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) |
int | getScreenFontSize () const |
Get the fontsize used for screen text. | |
void | setScreenFontSize (int s) |
Change screen font size. | |
int | getGuiFontSize () const |
Get the principal font size used for GUI panels. | |
void | setGuiFontSize (int s) |
change GUI font size. | |
StelGuiBase * | getGui () const |
Get the GUI instance implementing the abstract GUI interface. | |
void | setGui (StelGuiBase *b) |
Tell the StelApp instance which GUI is currently being used. More... | |
StelMainScriptAPIProxy * | getMainScriptAPIProxy () const |
Get the script API proxy (for signal handling) | |
StelScriptMgr & | getScriptMgr () const |
Get the script manager. | |
StelProgressController * | addProgressBar () |
Add a progression indicator to the GUI (if applicable). More... | |
void | removeProgressBar (StelProgressController *p) |
void | setViewportEffect (const QString &effectName) |
Define the type of viewport effect to use. More... | |
QString | getViewportEffect () const |
Get the type of viewport effect currently used. | |
void | dumpModuleActionPriorities (StelModule::StelModuleActionName actionName) const |
Dump diagnostics about action call priorities. | |
Static Public Member Functions | |
static QStringList | getCommandlineArguments () |
Returns all arguments passed on the command line, together with the contents of the STEL_OPTS environment variable. More... | |
static StelApp & | getInstance () |
Get the StelApp singleton instance. More... | |
static void | initStatic () |
static void | deinitStatic () |
Properties | |
bool | nightMode |
bool | flagShowDecimalDegrees |
bool | flagUseAzimuthFromSouth |
bool | flagUseCCSDesignation |
bool | flagUseFormattingOutput |
int | screenFontSize |
int | guiFontSize |
Friends | |
class | StelAppGraphicsWidget |
class | StelRootItem |
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.
StelApp::StelApp | ( | StelMainView * | parent | ) |
parent | the QObject parent The configFile will be searched for in the search path by the StelFileMgr, it is therefore 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 |
StelProgressController* StelApp::addProgressBar | ( | ) |
|
slot |
|
static |
You can use the CLIProcessor class to help parse it.
|
inline |
It is the one which provide the projection, navigation and tone converter.
|
inlineslot |
Note that this is usually not the same as QOpenGLContext::defaultFramebufferObject(), so use this call instead of the Qt version! Valid through a StelModule::draw() call, do not use elsewhere.
|
inline |
Usually this value is 1, but for a mac with retina screen this will be value 2.
|
inlineslot |
|
inline |
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).
|
inline |
|
inline |
StelModule* StelApp::getModule | ( | const QString & | moduleID | ) | const |
This is a shortcut for getModleMgr().getModule().
|
inline |
|
inline |
|
inline |
|
inline |
|
slot |
This is used for statistics purposes. Connect this slot to QNetworkAccessManager::finished() slot to obtain statistics at the end of the program.
|
slot |
To retrieve, you can use QGuiApplication::font(). emits fontChanged(font)
|
inline |
The caller is responsible for destroying the GUI.
void StelApp::setViewportEffect | ( | const QString & | effectName | ) |
effectName | must be one of 'none', 'framebufferOnly', 'sphericMirrorDistorter' |