Landscape.hpp   Landscape.hpp 
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef _LANDSCAPE_HPP_ #ifndef _LANDSCAPE_HPP_
#define _LANDSCAPE_HPP_ #define _LANDSCAPE_HPP_
#include <QMap> #include <QMap>
#include "vecmath.h" #include "VecMath.hpp"
#include "ToneReproducer.hpp" #include "StelToneReproducer.hpp"
#include "Projector.hpp" #include "StelProjector.hpp"
#include "Navigator.hpp" #include "StelNavigator.hpp"
#include "Fader.hpp" #include "StelFader.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "STextureTypes.hpp" #include "StelTextureTypes.hpp"
#include "Location.hpp" #include "StelLocation.hpp"
class QSettings; class QSettings;
class Location; class StelLocation;
class StelCore;
//! Store and manages the displaying of the Landscape //! @class Landscape
//! Store and manages the displaying of the Landscape.
//! Don't use this class direcly, use the LandscapeMgr.
class Landscape class Landscape
{ {
public: public:
Landscape(float _radius = 2.); Landscape(float _radius = 2.);
virtual ~Landscape(); virtual ~Landscape();
virtual void load(const QSettings& landscapeIni, const QString& land scapeId) = 0; virtual void load(const QSettings& landscapeIni, const QString& land scapeId) = 0;
virtual void draw(ToneReproducer * eye, const Projector* prj, const Navigator* nav) = 0; virtual void draw(StelCore* core) = 0;
void update(double deltaTime) void update(double deltaTime)
{ {
landFader.update((int)(deltaTime*1000)); landFader.update((int)(deltaTime*1000));
fogFader.update((int)(deltaTime*1000)); fogFader.update((int)(deltaTime*1000));
} }
//! Set the brightness of the landscape //! Set the brightness of the landscape
void setBrightness(float b) {skyBrightness = b;} void setBrightness(float b) {skyBrightness = b;}
//! Set whether landscape is displayed (does not concern fog) //! Set whether landscape is displayed (does not concern fog)
skipping to change at line 69 skipping to change at line 72
//! Get whether fog is displayed //! Get whether fog is displayed
bool getFlagShowFog() const {return (bool)fogFader;} bool getFlagShowFog() const {return (bool)fogFader;}
//! Get landscape name //! Get landscape name
QString getName() const {return name;} QString getName() const {return name;}
//! Get landscape author name //! Get landscape author name
QString getAuthorName() const {return author;} QString getAuthorName() const {return author;}
//! Get landscape description //! Get landscape description
QString getDescription() const {return description;} QString getDescription() const {return description;}
//! Return the associated location or NULL //! Return the associated location or NULL
const Location& getLocation() const {return location;} const StelLocation& getLocation() const {return location;}
//! Set the z-axis rotation (offset from original value when rotated
void setZRotation(double d) {angleRotateZOffset = d;}
protected: protected:
//! Load attributes common to all landscapes //! Load attributes common to all landscapes
//! @param landscapeIni A reference to an existant QSettings object which describes the landscape //! @param landscapeIni A reference to an existant QSettings object which describes the landscape
//! @param landscapeId The name of the directory for the landscape f iles (e.g. "ocean") //! @param landscapeId The name of the directory for the landscape f iles (e.g. "ocean")
void loadCommon(const QSettings& landscapeIni, const QString& landsc apeId); void loadCommon(const QSettings& landscapeIni, const QString& landsc apeId);
//! search for a texture in landscape directory, else global texture s directory //! search for a texture in landscape directory, else global texture s directory
//! @param basename The name of a texture file, e.g. "fog.png" //! @param basename The name of a texture file, e.g. "fog.png"
//! @param landscapeId The landscape ID (directory name) to which th e texture belongs //! @param landscapeId The landscape ID (directory name) to which th e texture belongs
skipping to change at line 93 skipping to change at line 99
QString name; QString name;
float skyBrightness; float skyBrightness;
bool validLandscape; // was a landscape loaded properly? bool validLandscape; // was a landscape loaded properly?
LinearFader landFader; LinearFader landFader;
LinearFader fogFader; LinearFader fogFader;
QString author; QString author;
QString description; QString description;
typedef struct typedef struct
{ {
STextureSP tex; StelTextureSP tex;
float texCoords[4]; float texCoords[4];
} landscapeTexCoord; } landscapeTexCoord;
Location location; StelLocation location;
float angleRotateZ;
float angleRotateZOffset;
}; };
class LandscapeOldStyle : public Landscape class LandscapeOldStyle : public Landscape
{ {
public: public:
LandscapeOldStyle(float _radius = 2.); LandscapeOldStyle(float _radius = 2.);
virtual ~LandscapeOldStyle(); virtual ~LandscapeOldStyle();
virtual void load(const QSettings& landscapeIni, const QString& land scapeId); virtual void load(const QSettings& landscapeIni, const QString& land scapeId);
virtual void draw(ToneReproducer * eye, const Projector* prj, const Navigator* nav); virtual void draw(StelCore* core);
void create(bool _fullpath, QMap<QString, QString> param); void create(bool _fullpath, QMap<QString, QString> param);
private: private:
void drawFog(ToneReproducer * eye, const Projector* prj, const Navig void drawFog(StelCore* core) const;
ator* nav) const; void drawDecor(StelCore* core) const;
void drawDecor(ToneReproducer * eye, const Projector* prj, const Nav void drawGround(StelCore* core) const;
igator* nav) const; StelTextureSP* sideTexs;
void drawGround(ToneReproducer * eye, const Projector* prj, const Na
vigator* nav) const;
STextureSP* sideTexs;
int nbSideTexs; int nbSideTexs;
int nbSide; int nbSide;
landscapeTexCoord* sides; landscapeTexCoord* sides;
STextureSP fogTex; StelTextureSP fogTex;
landscapeTexCoord fogTexCoord; landscapeTexCoord fogTexCoord;
STextureSP groundTex; StelTextureSP groundTex;
landscapeTexCoord groundTexCoord; landscapeTexCoord groundTexCoord;
int nbDecorRepeat; int nbDecorRepeat;
float fogAltAngle; float fogAltAngle;
float fogAngleShift; float fogAngleShift;
float decorAltAngle; float decorAltAngle;
float decorAngleShift; float decorAngleShift;
float decorAngleRotatez;
float groundAngleShift; float groundAngleShift;
float groundAngleRotatez; float groundAngleRotateZ;
int drawGroundFirst; int drawGroundFirst;
bool tanMode; // Whether the angles should be converted using tan instead of sin bool tanMode; // Whether the angles should be converted using tan instead of sin
}; };
class LandscapeFisheye : public Landscape class LandscapeFisheye : public Landscape
{ {
public: public:
LandscapeFisheye(float _radius = 1.); LandscapeFisheye(float _radius = 1.);
virtual ~LandscapeFisheye(); virtual ~LandscapeFisheye();
virtual void load(const QSettings& landscapeIni, const QString& land scapeId); virtual void load(const QSettings& landscapeIni, const QString& land scapeId);
virtual void draw(ToneReproducer * eye, const Projector* prj, const Navigator* nav); virtual void draw(StelCore* core);
void create(const QString _name, bool _fullpath, const QString& _map tex, void create(const QString _name, bool _fullpath, const QString& _map tex,
double _texturefov, double angleRotatez); double _texturefov, double angleRotateZ);
private: private:
STextureSP mapTex; StelTextureSP mapTex;
float texFov; float texFov;
float angleRotatez;
}; };
class LandscapeSpherical : public Landscape class LandscapeSpherical : public Landscape
{ {
public: public:
LandscapeSpherical(float _radius = 1.); LandscapeSpherical(float _radius = 1.);
virtual ~LandscapeSpherical(); virtual ~LandscapeSpherical();
virtual void load(const QSettings& landscapeIni, const QString& land scapeId); virtual void load(const QSettings& landscapeIni, const QString& land scapeId);
virtual void draw(ToneReproducer * eye, const Projector* prj, const Navigator* nav); virtual void draw(StelCore* core);
void create(const QString _name, bool _fullpath, void create(const QString _name, bool _fullpath,
const QString& _maptex, double angleRotatez); const QString& _maptex, double angleRotateZ);
private: private:
STextureSP mapTex; StelTextureSP mapTex;
float angleRotatez;
}; };
#endif // _LANDSCAPE_HPP_ #endif // _LANDSCAPE_HPP_
 End of changes. 22 change blocks. 
34 lines changed or deleted 36 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/