StelApp.hpp   StelApp.hpp 
skipping to change at line 33 skipping to change at line 33
#include <QString> #include <QString>
#include <QObject> #include <QObject>
#include "StelModule.hpp" #include "StelModule.hpp"
// Predeclaration of some classes // Predeclaration of some classes
class StelCore; class StelCore;
class StelTextureMgr; class StelTextureMgr;
class StelObjectMgr; class StelObjectMgr;
class StelLocaleMgr; class StelLocaleMgr;
class StelModuleMgr; class StelModuleMgr;
class StelMainView;
class StelSkyCultureMgr; class StelSkyCultureMgr;
class StelViewportEffect; class StelViewportEffect;
class QOpenGLFramebufferObject; class QOpenGLFramebufferObject;
class QOpenGLFunctions;
class QSettings; class QSettings;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QTimer; class QTimer;
class StelLocationMgr; class StelLocationMgr;
class StelSkyLayerMgr; class StelSkyLayerMgr;
class StelAudioMgr; class StelAudioMgr;
class StelVideoMgr; class StelVideoMgr;
class StelGuiBase; class StelGuiBase;
class StelMainScriptAPIProxy; class StelMainScriptAPIProxy;
skipping to change at line 73 skipping to change at line 75
//! The StelApp class is also the one managing the StelModule in a generic manner //! The StelApp class is also the one managing the StelModule in a generic manner
//! by calling their update, drawing and other methods when needed. //! by calling their update, drawing and other methods when needed.
//! @author Fabien Chereau //! @author Fabien Chereau
class StelApp : public QObject class StelApp : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool nightMode READ getVisionModeNight WRITE setVisionMod eNight NOTIFY visionNightModeChanged) Q_PROPERTY(bool nightMode READ getVisionModeNight WRITE setVisionMod eNight NOTIFY visionNightModeChanged)
public: public:
friend class StelAppGraphicsWidget; friend class StelAppGraphicsWidget;
friend class StelSkyItem; friend class StelRootItem;
//! Create and initialize the main Stellarium application. //! Create and initialize the main Stellarium application.
//! @param parent the QObject parent //! @param parent the QObject parent
//! The configFile will be search for in the search path by the Stel FileMgr, //! The configFile will be search for in the search path by the Stel FileMgr,
//! it is therefor possible to specify either just a file name or pa th within the //! it is therefor possible to specify either just a file name or pa th within the
//! search path, or use a full path or even a relative path to an ex isting file //! search path, or use a full path or even a relative path to an ex isting file
StelApp(QObject* parent=NULL); StelApp(StelMainView* parent);
//! Deinitialize and destroy the main Stellarium application. //! Deinitialize and destroy the main Stellarium application.
virtual ~StelApp(); virtual ~StelApp();
//! Initialize core and all the modules. //! Initialize core and all the modules.
void init(QSettings* conf); void init(QSettings* conf);
//! Deinitialize core and all the modules. //! Deinitialize core and all the modules.
void deinit(); void deinit();
//! Load and initialize external modules (plugins) //! Load and initialize external modules (plugins)
skipping to change at line 163 skipping to change at line 165
QString getCurrentStelStyle() {return "color";} QString getCurrentStelStyle() {return "color";}
//! Update all object according to the deltaTime in seconds. //! Update all object according to the deltaTime in seconds.
void update(double deltaTime); void update(double deltaTime);
//! Draw all registered StelModule in the order defined by the order lists. //! Draw all registered StelModule in the order defined by the order lists.
// 2014-11: OLD COMMENT? What does a void return? // 2014-11: OLD COMMENT? What does a void return?
// @return the max squared distance in pixels that any object has tr avelled since the last update. // @return the max squared distance in pixels that any object has tr avelled since the last update.
void draw(); void draw();
//! Call this when the size of the GL window has changed.
void glWindowHasBeenResized(float x, float y, float w, float h);
//! Get the ratio between real device pixel and "Device Independent Pixel". //! Get the ratio between real device pixel and "Device Independent Pixel".
//! Usually this value is 1, but for a mac with retina screen this w ill be value 2. //! Usually this value is 1, but for a mac with retina screen this w ill be value 2.
float getDevicePixelsPerPixel() const {return devicePixelsPerPixel;} float getDevicePixelsPerPixel() const {return devicePixelsPerPixel;}
void setDevicePixelsPerPixel(float dppp); void setDevicePixelsPerPixel(float dppp);
//! Get the scaling ratio to apply on all display elements, like GUI , text etc.. //! 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 lo ok OK on a regular //! When this ratio is 1, all pixel sizes used in Stellarium will lo ok OK on a regular
//! computer screen with 96 pixel per inch (reference for tuning siz es). //! computer screen with 96 pixel per inch (reference for tuning siz es).
float getGlobalScalingRatio() const {return globalScalingRatio;} float getGlobalScalingRatio() const {return globalScalingRatio;}
void setGlobalScalingRatio(float r) {globalScalingRatio=r;} void setGlobalScalingRatio(float r) {globalScalingRatio=r;}
skipping to change at line 215 skipping to change at line 214
void setViewportEffect(const QString& effectName); void setViewportEffect(const QString& effectName);
//! Get the type of viewport effect currently used //! Get the type of viewport effect currently used
QString getViewportEffect() const; QString getViewportEffect() const;
//! Dump diagnostics about action call priorities //! Dump diagnostics about action call priorities
void dumpModuleActionPriorities(StelModule::StelModuleActionName act ionName); void dumpModuleActionPriorities(StelModule::StelModuleActionName act ionName);
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Scriptable methods // Scriptable methods
public slots: public slots:
//! Call this when the size of the GL window has changed.
void glWindowHasBeenResized(const QRectF &rect);
//! Set flag for activating night vision mode. //! Set flag for activating night vision mode.
void setVisionModeNight(bool); void setVisionModeNight(bool);
//! Get flag for activating night vision mode. //! Get flag for activating night vision mode.
bool getVisionModeNight() const {return flagNightVision;} bool getVisionModeNight() const {return flagNightVision;}
//! Set flag for showing decimal degree in various places. //! Set flag for showing decimal degree in various places.
void setFlagShowDecimalDegrees(bool b); void setFlagShowDecimalDegrees(bool b);
//! Get flag for showing decimal degree in various places. //! Get flag for showing decimal degree in various places.
bool getFlagShowDecimalDegrees() const {return flagShowDecimalDegree s;} bool getFlagShowDecimalDegrees() const {return flagShowDecimalDegree s;}
skipping to change at line 242 skipping to change at line 243
//! @deprecated Use getFlagSouthAzimuthUsage() instead. //! @deprecated Use getFlagSouthAzimuthUsage() instead.
bool getFlagOldAzimuthUsage() const { return getFlagSouthAzimuthUsag e(); } bool getFlagOldAzimuthUsage() const { return getFlagSouthAzimuthUsag e(); }
//! Get flag for using calculation of azimuth from south towards wes t (as in older astronomical literature) //! Get flag for using calculation of azimuth from south towards wes t (as in older astronomical literature)
//! @deprecated Use setFlagSouthAzimuthUsage() instead. //! @deprecated Use setFlagSouthAzimuthUsage() instead.
void setFlagOldAzimuthUsage(bool use) { setFlagSouthAzimuthUsage(use ); } void setFlagOldAzimuthUsage(bool use) { setFlagSouthAzimuthUsage(use ); }
//! Get the current number of frame per second. //! Get the current number of frame per second.
//! @return the FPS averaged on the last second //! @return the FPS averaged on the last second
float getFps() const {return fps;} float getFps() const {return fps;}
//! Returns the default FBO handle, to be used when StelModule insta
nces want to release their own FBOs.
//! Note that this is usually not the same as QOpenGLContext::defaul
tFramebufferObject(),
//! so use this call instead of the Qt version!
//! Valid through a StelModule::draw() call, do not use elsewhere.
quint32 getDefaultFBO() const { return currentFbo; }
//! Makes sure the correct GL context used for main drawing is made
current.
//! This is always the case during init() and draw() calls, but if O
penGL access is required elsewhere,
//! this MUST be called before using any GL functions.
void ensureGLContextCurrent();
//! Return the time since when stellarium is running in second. //! Return the time since when stellarium is running in second.
static double getTotalRunTime(); static double getTotalRunTime();
//! Return the scaled time for animated objects //! Return the scaled time for animated objects
static double getAnimationTime(); static double getAnimationTime();
//! Report that a download occured. This is used for statistics purp oses. //! Report that a download occured. This is used for statistics purp oses.
//! Connect this slot to QNetworkAccessManager::finished() slot to o btain statistics at the end of the program. //! Connect this slot to QNetworkAccessManager::finished() slot to o btain statistics at the end of the program.
void reportFileDownloadFinished(QNetworkReply* reply); void reportFileDownloadFinished(QNetworkReply* reply);
skipping to change at line 265 skipping to change at line 277
void visionNightModeChanged(bool); void visionNightModeChanged(bool);
void colorSchemeChanged(const QString&); void colorSchemeChanged(const QString&);
void languageChanged(); void languageChanged();
//! Called just after a progress bar is added. //! Called just after a progress bar is added.
void progressBarAdded(const StelProgressController*); void progressBarAdded(const StelProgressController*);
//! Called just before a progress bar is removed. //! Called just before a progress bar is removed.
void progressBarRemoved(const StelProgressController*); void progressBarRemoved(const StelProgressController*);
//! Called just before we exit Qt mainloop. //! Called just before we exit Qt mainloop.
void aboutToQuit(); void aboutToQuit();
private: private:
//! Handle mouse clics. //! Handle mouse clics.
void handleClick(class QMouseEvent* event); void handleClick(class QMouseEvent* event);
//! Handle mouse wheel. //! Handle mouse wheel.
void handleWheel(class QWheelEvent* event); void handleWheel(class QWheelEvent* event);
//! Handle mouse move. //! Handle mouse move.
void handleMove(float x, float y, Qt::MouseButtons b); bool handleMove(float x, float y, Qt::MouseButtons b);
//! Handle key press and release. //! Handle key press and release.
void handleKeys(class QKeyEvent* event); void handleKeys(class QKeyEvent* event);
//! Handle pinch on multi touch devices. //! Handle pinch on multi touch devices.
void handlePinch(qreal scale, bool started); void handlePinch(qreal scale, bool started);
//! Used internally to set the viewport effects. //! Used internally to set the viewport effects.
void prepareRenderBuffer(); void prepareRenderBuffer();
//! Used internally to set the viewport effects. //! Used internally to set the viewport effects.
//! @param drawFbo the OpenGL fbo we need to render into. //! @param drawFbo the OpenGL fbo we need to render into.
void applyRenderBuffer(int drawFbo=0); void applyRenderBuffer(quint32 drawFbo=0);
// The StelApp singleton // The StelApp singleton
static StelApp* singleton; static StelApp* singleton;
//! The main window which is the parent of this object
StelMainView* mainWin;
// The associated StelCore instance // The associated StelCore instance
StelCore* core; StelCore* core;
// Module manager for the application // Module manager for the application
StelModuleMgr* moduleMgr; StelModuleMgr* moduleMgr;
// Locale manager for the application // Locale manager for the application
StelLocaleMgr* localeMgr; StelLocaleMgr* localeMgr;
// Sky cultures manager for the application // Sky cultures manager for the application
skipping to change at line 354 skipping to change at line 368
float globalScalingRatio; float globalScalingRatio;
// Used to collect wheel events // Used to collect wheel events
QTimer * wheelEventTimer; QTimer * wheelEventTimer;
// Accumulated horizontal and vertical wheel event deltas // Accumulated horizontal and vertical wheel event deltas
int wheelEventDelta[2]; int wheelEventDelta[2];
float fps; float fps;
int frame; int frame;
double timefr, timeBase; // Used for fps counter double frameTimeAccum; // Used for fps counter
//! Define whether we are in night vision mode //! Define whether we are in night vision mode
bool flagNightVision; bool flagNightVision;
QSettings* confSettings; QSettings* confSettings;
// Define whether the StelApp instance has completed initialization // Define whether the StelApp instance has completed initialization
bool initialized; bool initialized;
static qint64 startMSecs; static qint64 startMSecs;
skipping to change at line 388 skipping to change at line 402
int nbUsedCache; int nbUsedCache;
//! Store the summed size of all downloaded files read from the cach e in bytes. //! Store the summed size of all downloaded files read from the cach e in bytes.
qint64 totalUsedCacheSize; qint64 totalUsedCacheSize;
QList<StelProgressController*> progressControllers; QList<StelProgressController*> progressControllers;
int baseFontSize; int baseFontSize;
// Framebuffer object used for viewport effects. // Framebuffer object used for viewport effects.
QOpenGLFramebufferObject* renderBuffer; QOpenGLFramebufferObject* renderBuffer;
StelViewportEffect* viewportEffect; StelViewportEffect* viewportEffect;
QOpenGLFunctions* gl;
bool flagShowDecimalDegrees; bool flagShowDecimalDegrees;
// flag to indicate we want calculate azimuth from south towards wes t (as in old astronomical literature) // flag to indicate we want calculate azimuth from south towards wes t (as in old astronomical literature)
bool flagUseAzimuthFromSouth; bool flagUseAzimuthFromSouth;
#ifdef ENABLE_SPOUT #ifdef ENABLE_SPOUT
SpoutSender* spoutSender; SpoutSender* spoutSender;
#endif #endif
// The current main FBO/render target handle, without requiring GL q
ueries. Valid through a draw() call
quint32 currentFbo;
}; };
#endif // _STELAPP_HPP_ #endif // _STELAPP_HPP_
 End of changes. 15 change blocks. 
10 lines changed or deleted 32 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/