Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

core/modules/LandscapeMgr.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2006 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #ifndef _LANDSCAPEMGR_HPP_
00021 #define _LANDSCAPEMGR_HPP_
00022 
00023 #include "StelModule.hpp"
00024 #include "StelUtils.hpp"
00025 
00026 #include <QMap>
00027 #include <QStringList>
00028 
00029 class Landscape;
00030 class Atmosphere;
00031 class Cardinals;
00032 class QSettings;
00033 
00039 class LandscapeMgr : public StelModule
00040 {
00041     Q_OBJECT
00042 
00043 public:
00044     LandscapeMgr();
00045     virtual ~LandscapeMgr();
00046 
00048     // Methods defined in the StelModule class
00053     virtual void init();
00054 
00056     virtual void draw(StelCore* core);
00057 
00064     virtual void update(double deltaTime);
00065 
00067     virtual void updateI18n();
00068 
00070     virtual void setStelStyle(const QString& section);
00071 
00073     virtual double getCallOrder(StelModuleActionName actionName) const;
00074 
00075 
00077     // Method specific to the landscape manager
00079     float getLuminance();
00080 
00083     bool loadLandscape(QMap<QString, QString>& param);
00084 
00093     Landscape* createFromFile(const QString& landscapeFile, const QString& landscapeId);
00094 
00095 public slots:
00097     // Methods callable from script and GUI
00101     QStringList getAllLandscapeNames() const;
00102 
00106     QStringList getAllLandscapeIDs() const;
00107 
00109     const QString& getCurrentLandscapeID() const {return currentLandscapeID;}
00113     bool setCurrentLandscapeID(const QString& id);
00114     
00116     QString getCurrentLandscapeName() const;
00119     bool setCurrentLandscapeName(const QString& name);
00120 
00122     const QString& getDefaultLandscapeID() const {return defaultLandscapeID;}
00126     bool setDefaultLandscapeID(const QString& id);
00127 
00129     QString getCurrentLandscapeHtmlDescription() const;
00130 
00132     bool getFlagLandscape() const;
00134     void setFlagLandscape(bool b);
00135 
00137     bool getFlagFog() const;
00139     void setFlagFog(bool b);
00140 
00142     bool getFlagLandscapeSetsLocation() const {return flagLandscapeSetsLocation;}
00144     void setFlagLandscapeSetsLocation(bool b) {flagLandscapeSetsLocation=b;}
00145 
00147     bool getFlagCardinalsPoints() const;
00149     void setFlagCardinalsPoints(bool b);
00150 
00152     Vec3f getColorCardinalPoints() const;
00154     void setColorCardinalPoints(const Vec3f& v);
00155 
00157     bool getFlagAtmosphere() const;
00159     void setFlagAtmosphere(bool b);
00160 
00162     float getAtmosphereFadeDuration() const;
00164     void setAtmosphereFadeDuration(float f);
00165 
00167     void setAtmosphereBortleLightPollution(int bIndex);
00169     int getAtmosphereBortleLightPollution();
00170 
00175     void setZRotation(float d);
00176 
00177 private:
00179     float getAtmosphereLightPollutionLuminance() const;
00181     void setAtmosphereLightPollutionLuminance(float f);
00182 
00186     QString nameToID(const QString& name);
00187 
00189     QMap<QString,QString> getNameToDirMap() const;
00190 
00191     Atmosphere* atmosphere;         // Atmosphere
00192     Cardinals* cardinalsPoints;     // Cardinals points
00193     Landscape* landscape;           // The landscape i.e. the fog, the ground and "decor"
00194 
00195     // Define whether the observer location is to be updated when the landscape is updated.
00196     bool flagLandscapeSetsLocation;
00197 
00198     // The ID of the currently loaded landscape
00199     QString currentLandscapeID;
00200 
00201     // The ID of the default landscape
00202     QString defaultLandscapeID;
00203 };
00204 
00205 #endif // _LANDSCAPEMGR_HPP_

Generated on Wed Jun 2 13:11:13 2010 for Stellarium by  doxygen 1.5.5