00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _LANDSCAPE_HPP_
00021 #define _LANDSCAPE_HPP_
00022
00023 #include <QMap>
00024 #include "VecMath.hpp"
00025 #include "StelToneReproducer.hpp"
00026 #include "StelProjector.hpp"
00027 #include "StelNavigator.hpp"
00028 #include "StelFader.hpp"
00029 #include "StelUtils.hpp"
00030 #include "StelTextureTypes.hpp"
00031 #include "StelLocation.hpp"
00032
00033 class QSettings;
00034 class StelLocation;
00035 class StelCore;
00036
00040 class Landscape
00041 {
00042 public:
00043 Landscape(float _radius = 2.);
00044 virtual ~Landscape();
00045 virtual void load(const QSettings& landscapeIni, const QString& landscapeId) = 0;
00046 virtual void draw(StelCore* core) = 0;
00047 void update(double deltaTime)
00048 {
00049 landFader.update((int)(deltaTime*1000));
00050 fogFader.update((int)(deltaTime*1000));
00051 }
00052
00054 void setBrightness(float b) {skyBrightness = b;}
00055
00057 void setFlagShow(bool b) {landFader=b;}
00059 bool getFlagShow() const {return (bool)landFader;}
00061 void setFlagShowFog(bool b) {fogFader=b;}
00063 bool getFlagShowFog() const {return (bool)fogFader;}
00065 QString getName() const {return name;}
00067 QString getAuthorName() const {return author;}
00069 QString getDescription() const {return description;}
00070
00072 const StelLocation& getLocation() const {return location;}
00073
00075 void setZRotation(double d) {angleRotateZOffset = d;}
00076
00077 protected:
00081 void loadCommon(const QSettings& landscapeIni, const QString& landscapeId);
00082
00087 const QString getTexturePath(const QString& basename, const QString& landscapeId);
00088 float radius;
00089 QString name;
00090 float skyBrightness;
00091 bool validLandscape;
00092 LinearFader landFader;
00093 LinearFader fogFader;
00094 QString author;
00095 QString description;
00096
00097 typedef struct
00098 {
00099 StelTextureSP tex;
00100 float texCoords[4];
00101 } landscapeTexCoord;
00102
00103 StelLocation location;
00104 float angleRotateZ;
00105 float angleRotateZOffset;
00106 };
00107
00108
00109 class LandscapeOldStyle : public Landscape
00110 {
00111 public:
00112 LandscapeOldStyle(float _radius = 2.);
00113 virtual ~LandscapeOldStyle();
00114 virtual void load(const QSettings& landscapeIni, const QString& landscapeId);
00115 virtual void draw(StelCore* core);
00116 void create(bool _fullpath, QMap<QString, QString> param);
00117 private:
00118 void drawFog(StelCore* core) const;
00119 void drawDecor(StelCore* core) const;
00120 void drawGround(StelCore* core) const;
00121 StelTextureSP* sideTexs;
00122 int nbSideTexs;
00123 int nbSide;
00124 landscapeTexCoord* sides;
00125 StelTextureSP fogTex;
00126 landscapeTexCoord fogTexCoord;
00127 StelTextureSP groundTex;
00128 landscapeTexCoord groundTexCoord;
00129 int nbDecorRepeat;
00130 float fogAltAngle;
00131 float fogAngleShift;
00132 float decorAltAngle;
00133 float decorAngleShift;
00134 float groundAngleShift;
00135 float groundAngleRotateZ;
00136 int drawGroundFirst;
00137 bool tanMode;
00138 };
00139
00140 class LandscapeFisheye : public Landscape
00141 {
00142 public:
00143 LandscapeFisheye(float _radius = 1.);
00144 virtual ~LandscapeFisheye();
00145 virtual void load(const QSettings& landscapeIni, const QString& landscapeId);
00146 virtual void draw(StelCore* core);
00147 void create(const QString _name, bool _fullpath, const QString& _maptex,
00148 double _texturefov, double angleRotateZ);
00149 private:
00150
00151 StelTextureSP mapTex;
00152 float texFov;
00153 };
00154
00155
00156 class LandscapeSpherical : public Landscape
00157 {
00158 public:
00159 LandscapeSpherical(float _radius = 1.);
00160 virtual ~LandscapeSpherical();
00161 virtual void load(const QSettings& landscapeIni, const QString& landscapeId);
00162 virtual void draw(StelCore* core);
00163 void create(const QString _name, bool _fullpath,
00164 const QString& _maptex, double angleRotateZ);
00165 private:
00166
00167 StelTextureSP mapTex;
00168 };
00169
00170 #endif // _LANDSCAPE_HPP_