Stellarium  0.22.2
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties | Friends
StelApp Class Reference

#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 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.
 
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 flagOverwriteInfoColorChanged (bool)
 
void colorSchemeChanged (const QString &)
 
void languageChanged ()
 
void screenFontSizeChanged (int)
 
void guiFontSizeChanged (int)
 
void fontChanged (QFont)
 
void overwriteInfoColorChanged (const Vec3f &color)
 
void daylightInfoColorChanged (const Vec3f &color)
 
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 () Q_DECL_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.
 
StelModuleMgrgetModuleMgr () const
 Get the module manager to use for accessing any module loaded in the application. More...
 
StelModulegetModule (const QString &moduleID) const
 Get the corresponding module or Q_NULLPTR if can't find it. More...
 
StelLocaleMgrgetLocaleMgr () const
 Get the locale manager to use for i18n & date/time localization. More...
 
StelSkyCultureMgrgetSkyCultureMgr () const
 Get the sky cultures manager. More...
 
StelTextureMgrgetTextureManager () const
 Get the texture manager to use for loading textures. More...
 
StelLocationMgrgetLocationMgr () const
 Get the Location manager to use for managing stored locations. More...
 
StelObjectMgrgetStelObjectMgr () const
 Get the StelObject manager to use for querying from all stellarium objects. More...
 
StelSkyLayerMgrgetSkyImageMgr () const
 
StelAudioMgrgetStelAudioMgr () const
 Get the audio manager.
 
StelActionMgrgetStelActionManager () const
 Get the actions manager to use for managing and editing actions.
 
StelPropertyMgrgetStelPropertyManager () const
 Return the property manager.
 
StelVideoMgrgetStelVideoMgr () const
 Get the video manager.
 
StelCoregetCore () 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)
 
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.
 
StelGuiBasegetGui () 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...
 
StelProgressControlleraddProgressBar ()
 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 StelAppgetInstance ()
 Get the StelApp singleton instance. More...
 
static void initStatic ()
 
static void deinitStatic ()
 

Properties

bool nightMode
 
bool flagShowDecimalDegrees
 
bool flagUseAzimuthFromSouth
 
bool flagUseCCSDesignation
 
bool flagUseFormattingOutput
 
bool flagOverwriteInfoColor
 
Vec3f overwriteInfoColor
 
Vec3f daylightInfoColor
 
int screenFontSize
 
int guiFontSize
 
QString version
 

Friends

class StelAppGraphicsWidget
 
class StelRootItem
 

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::StelApp ( StelMainView parent)
Parameters
parentthe 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

Member Function Documentation

◆ addProgressBar()

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

◆ ensureGLContextCurrent

void StelApp::ensureGLContextCurrent ( )
slot

This is always the case during init() and draw() calls, but if OpenGL access is required elsewhere, this MUST be called before using any GL functions.

◆ getCommandlineArguments()

static QStringList StelApp::getCommandlineArguments ( )
static

You can use the CLIProcessor class to help parse it.

Returns
the arguments passed to Stellarium on the command line concatenated with the STEL_OPTS environment variable

◆ getCore()

StelCore* StelApp::getCore ( ) const
inline

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

Returns
the StelCore instance of the program

◆ getDefaultFBO

quint32 StelApp::getDefaultFBO ( ) const
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.

◆ getDevicePixelsPerPixel()

qreal StelApp::getDevicePixelsPerPixel ( ) const
inline

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

◆ getFps

float StelApp::getFps ( ) const
inlineslot
Returns
the FPS averaged on the last second

◆ getGlobalScalingRatio()

float StelApp::getGlobalScalingRatio ( ) const
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).

◆ getInstance()

static StelApp& StelApp::getInstance ( )
inlinestatic
Returns
the StelApp singleton instance

◆ getLocaleMgr()

StelLocaleMgr& StelApp::getLocaleMgr ( ) const
inline
Returns
the font manager to use for loading fonts.

◆ getLocationMgr()

StelLocationMgr& StelApp::getLocationMgr ( ) const
inline
Returns
the Location manager to use for managing stored locations

◆ getModule()

StelModule* StelApp::getModule ( const QString &  moduleID) const

This is a shortcut for getModleMgr().getModule().

Returns
the module pointer.

◆ getModuleMgr()

StelModuleMgr& StelApp::getModuleMgr ( ) const
inline
Returns
the module manager.

◆ getSkyCultureMgr()

StelSkyCultureMgr& StelApp::getSkyCultureMgr ( ) const
inline
Returns
the sky cultures manager

◆ getStelObjectMgr()

StelObjectMgr& StelApp::getStelObjectMgr ( ) const
inline
Returns
the StelObject manager to use for querying from all stellarium objects .

◆ getTextureManager()

StelTextureMgr& StelApp::getTextureManager ( ) const
inline
Returns
the texture manager to use for loading textures.

◆ reportFileDownloadFinished

void StelApp::reportFileDownloadFinished ( QNetworkReply *  reply)
slot

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

◆ setAppFont

void StelApp::setAppFont ( QFont  font)
slot

To retrieve, you can use QGuiApplication::font(). emits fontChanged(font)

◆ setGui()

void StelApp::setGui ( StelGuiBase b)
inline

The caller is responsible for destroying the GUI.

◆ setViewportEffect()

void StelApp::setViewportEffect ( const QString &  effectName)
Parameters
effectNamemust be one of 'none', 'framebufferOnly', 'sphericMirrorDistorter'