00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _STELCORE_HPP_
00020 #define _STELCORE_HPP_
00021
00022 #include "StelProjector.hpp"
00023 #include "StelProjectorType.hpp"
00024 #include <QString>
00025 #include <QStringList>
00026
00027 class StelNavigator;
00028 class StelToneReproducer;
00029 class StelSkyDrawer;
00030 class StelGeodesicGrid;
00031 class StelMovementMgr;
00032
00042 class StelCore : public QObject
00043 {
00044 Q_OBJECT
00045 Q_ENUMS(ProjectionType);
00046
00047 public:
00050 enum FrameType
00051 {
00052 FrameAltAz,
00053 FrameHeliocentricEcliptic,
00054 FrameObservercentricEcliptic,
00055 FrameEquinoxEqu,
00056 FrameJ2000
00057 };
00058
00060 enum ProjectionType
00061 {
00062 ProjectionPerspective,
00063 ProjectionEqualArea,
00064 ProjectionStereographic,
00065 ProjectionFisheye,
00066 ProjectionCylinder,
00067 ProjectionMercator,
00068 ProjectionOrthographic
00069 };
00070
00071 StelCore();
00072 virtual ~StelCore();
00073
00075 void init();
00076
00079 void update(double deltaTime);
00080
00082 void windowHasBeenResized(int width,int height);
00083
00085 void preDraw();
00086
00088 void postDraw();
00089
00092 const StelProjectorP getProjection2d() const;
00093
00097 const StelProjectorP getProjection(FrameType frameType, ProjectionType projType=(ProjectionType)1000) const;
00098
00102 const StelProjectorP getProjection(const Mat4d& modelViewMat, ProjectionType projType=(ProjectionType)1000) const;
00103
00105 StelNavigator* getNavigator() {return navigation;}
00107 const StelNavigator* getNavigator() const {return navigation;}
00108
00110 StelToneReproducer* getToneReproducer() {return toneConverter;}
00112 const StelToneReproducer* getToneReproducer() const {return toneConverter;}
00113
00115 StelSkyDrawer* getSkyDrawer() {return skyDrawer;}
00117 const StelSkyDrawer* getSkyDrawer() const {return skyDrawer;}
00118
00120 const StelGeodesicGrid* getGeodesicGrid(int maxLevel) const;
00121
00123 StelMovementMgr* getMovementMgr() {return movementMgr;}
00125 const StelMovementMgr* getMovementMgr() const {return movementMgr;}
00126
00128 void setClippingPlanes(double znear, double zfar) {currentProjectorParams.zNear=znear;currentProjectorParams.zFar=zfar;}
00130 void getClippingPlanes(double* zn, double* zf) const {*zn = currentProjectorParams.zNear; *zf = currentProjectorParams.zFar;}
00131
00133 QString projectionTypeKeyToNameI18n(const QString& key) const;
00134
00136 QString projectionNameI18nToTypeKey(const QString& nameI18n) const;
00137
00139 StelProjector::StelProjectorParams getCurrentStelProjectorParams() const {return currentProjectorParams;}
00141 void setCurrentStelProjectorParams(const StelProjector::StelProjectorParams& newParams) {currentProjectorParams=newParams;}
00142
00143 public slots:
00145 void setCurrentProjectionType(ProjectionType type) {currentProjectionType=type;}
00146
00148 QString getCurrentProjectionTypeKey(void) const;
00150 void setCurrentProjectionTypeKey(QString type);
00151
00153 QStringList getAllProjectionTypeKeys() const;
00154
00156 void setMaskType(StelProjector::StelProjectorMaskType m) {currentProjectorParams.maskType = m; }
00157
00160 void setFlagGravityLabels(bool gravity) { currentProjectorParams.gravityLabels = gravity; }
00163 void setFlipHorz(bool flip) {currentProjectorParams.flipHorz = flip;}
00166 void setFlipVert(bool flip) {currentProjectorParams.flipVert = flip;}
00169 bool getFlipHorz(void) const {return currentProjectorParams.flipHorz;}
00172 bool getFlipVert(void) const {return currentProjectorParams.flipVert;}
00173
00174 private:
00175 StelNavigator* navigation;
00176 StelToneReproducer* toneConverter;
00177 StelSkyDrawer* skyDrawer;
00178 StelMovementMgr* movementMgr;
00179
00180
00181 mutable StelGeodesicGrid* geodesicGrid;
00182
00183
00184 ProjectionType currentProjectionType;
00185
00186
00187 StelProjector::StelProjectorParams currentProjectorParams;
00188 };
00189
00190 #endif // _STELCORE_HPP_