Stellarium
24.4
|
Singleton main Stellarium application class. More...
#include <StelApp.hpp>
Public Slots | |
void | glWindowHasBeenResized (const QRectF &rect) |
Call this when the virtual size of the GL window has changed. | |
void | glPhysicalWindowHasBeenResized (const QRectF &rect) |
Call this when the physical 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 | setFlagOverwriteInfoColor (bool) |
Set flag for activating overwrite mode for text color in info panel. | |
bool | getFlagOverwriteInfoColor () const |
Get flag for activating overwrite mode for text color in info panel. | |
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. | |
void | setOverwriteInfoColor (const Vec3f &color) |
Define info text color for overwrites. | |
Vec3f | getOverwriteInfoColor () const |
Get info text color. | |
void | setDaylightInfoColor (const Vec3f &color) |
Define info text color for daylight mode. | |
Vec3f | getDaylightInfoColor () const |
Get info text color. | |
void | setFlagImmediateSave (bool b) |
Set flag for storing some settings immediately To not accidentally activate this mode permanently, you must use the "save settings" button to activate! Switching it off is however stored immediately. | |
bool | getFlagImmediateSave () const |
Get flag about storing some settings immediately. | |
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 occurred. 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 | flagOverwriteInfoColorChanged (bool) |
void | colorSchemeChanged (const QString &) |
void | languageChanged () |
void | screenFontSizeChanged (int) |
void | guiFontSizeChanged (int) |
void | fontChanged (const QFont &) |
void | overwriteInfoColorChanged (const Vec3f &color) |
void | daylightInfoColorChanged (const Vec3f &color) |
void | flagImmediateSaveChanged (bool) |
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... | |
~StelApp () override | |
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... | |
quint32 | getRand () const |
get a pseudo-random integer | |
int | getRandBounded (int lowest, int highest) const |
float | getRandF () const |
shortcut to retrieve a random float [0...1). | |
float | getRandFp1 () const |
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. | |
qreal | getDevicePixelsPerPixel () const |
Get the ratio between real device pixel and "Device Independent Pixel". More... | |
void | setDevicePixelsPerPixel (qreal dppp) |
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... | |
void | enableBottomStelBarUpdates (bool enable) |
Enable/disable updates to StelBottomBar This may be important for temporary changes which should not cause two costly redraws of the texts. More... | |
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 () |
static void | immediateSave (const QString &key, const QVariant &value) |
Power feature: allow immediate storing of config.ini entries. More... | |
static constexpr int | getDefaultGuiFontSize () |
static bool | isInitialized () |
Properties | |
bool | nightMode |
bool | flagShowDecimalDegrees |
bool | flagUseAzimuthFromSouth |
bool | flagUseCCSDesignation |
bool | flagUseFormattingOutput |
bool | flagOverwriteInfoColor |
Vec3f | overwriteInfoColor |
Vec3f | daylightInfoColor |
int | screenFontSize |
int | guiFontSize |
bool | flagImmediateSave |
QString | version |
Friends | |
class | StelAppGraphicsWidget |
class | StelMainView |
class | StelRootItem |
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 management 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 | ) |
Create and initialize the main Stellarium application.
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 | ( | ) |
Add a progression indicator to the GUI (if applicable).
void StelApp::enableBottomStelBarUpdates | ( | bool | enable | ) |
Enable/disable updates to StelBottomBar This may be important for temporary changes which should not cause two costly redraws of the texts.
After program launch, the bottom bar is updating according to signal connections. This means, enclose the temporary state change with 2 calls (false/true) per such method.
|
slot |
|
static |
Returns all arguments passed on the command line, together with the contents of the STEL_OPTS environment variable.
You can use the CLIProcessor class to help parse it.
|
inline |
Get the core of the program.
It is the one which provide the projection, navigation and tone converter.
|
inlineslot |
Returns the default FBO handle, to be used when StelModule instances want to release their own FBOs.
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 |
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.
|
inlineslot |
Get the current number of frame per second.
|
inlinestatic |
|
inline |
Get the locale manager to use for i18n & date/time localization.
|
inline |
Get the Location manager to use for managing stored locations.
StelModule* StelApp::getModule | ( | const QString & | moduleID | ) | const |
Get the corresponding module or Q_NULLPTR if can't find it.
This is a shortcut for getModleMgr().getModule().
|
inline |
Get the module manager to use for accessing any module loaded in the application.
|
inline |
Get the sky cultures manager.
|
inline |
Get the StelObject manager to use for querying from all stellarium objects.
|
inline |
Get the texture manager to use for loading textures.
|
static |
Power feature: allow immediate storing of config.ini entries.
Storing only takes place if property StelApp.flagImmediateSave is set, a flag activated with a manual config.ini entry gui/immediate_save_details=true Items saved with this method still need to be saved as well with ConfigurationDialog::saveAllSettings()!
|
slot |
Report that a download occurred.
This is used for statistics purposes. Connect this slot to QNetworkAccessManager::finished() slot to obtain statistics at the end of the program.
|
slot |
Set global application font.
To retrieve, you can use QGuiApplication::font(). emits fontChanged(font)
|
inline |
Tell the StelApp instance which GUI is currently being used.
The caller is responsible for destroying the GUI.
void StelApp::setViewportEffect | ( | const QString & | effectName | ) |
Define the type of viewport effect to use.
effectName | must be one of 'none', 'framebufferOnly', 'sphericMirrorDistorter' |