22 #ifndef _LANDSCAPEMGR_HPP_
23 #define _LANDSCAPEMGR_HPP_
25 #include "StelModule.hpp"
26 #include "StelUtils.hpp"
27 #include "Landscape.hpp"
30 #include <QStringList>
44 Q_PROPERTY(
bool atmosphereDisplayed
47 NOTIFY atmosphereDisplayedChanged)
48 Q_PROPERTY(
bool cardinalsPointsDisplayed
51 NOTIFY cardinalsPointsDisplayedChanged)
52 Q_PROPERTY(
bool fogDisplayed
55 NOTIFY fogDisplayedChanged)
56 Q_PROPERTY(
bool landscapeDisplayed
59 NOTIFY landscapeDisplayedChanged)
60 Q_PROPERTY(
bool illuminationDisplayed
63 NOTIFY illuminationDisplayedChanged)
64 Q_PROPERTY(
bool databaseUsage
67 NOTIFY lightPollutionUsageChanged)
90 virtual void update(
double deltaTime);
333 void atmosphereDisplayedChanged(
const bool displayed);
334 void cardinalsPointsDisplayedChanged(
const bool displayed);
335 void fogDisplayedChanged(
const bool displayed);
336 void landscapeDisplayedChanged(
const bool displayed);
337 void illuminationDisplayedChanged(
const bool displayed);
338 void lightPollutionUsageChanged(
const bool usage);
345 void lightPollutionChanged();
369 void setStelStyle(
const QString& section);
376 float getAtmosphereLightPollutionLuminance()
const;
378 void setAtmosphereLightPollutionLuminance(
const float f);
384 QString nameToID(
const QString& name)
const;
387 QMap<QString,QString> getNameToDirMap()
const;
393 QString getLandscapePath(
const QString landscapeID)
const;
396 Cardinals* cardinalsPoints;
400 bool flagLandscapeSetsLocation;
402 bool flagLandscapeAutoSelection;
404 bool flagLightPollutionFromDatabase;
407 bool flagLandscapeUseMinimalBrightness;
409 float defaultMinimalBrightness;
411 bool flagLandscapeSetsMinimalBrightness;
413 bool flagAtmosphereAutoEnabling;
416 QString currentLandscapeID;
419 QString defaultLandscapeID;
426 QStringList packagedLandscapeIDs;
430 #endif // _LANDSCAPEMGR_HPP_
void setFlagUseLightPollutionFromDatabase(const bool usage)
Sets the value of the flag usage light pollution (and bortle index) from locations database...
void setZRotation(const float d)
Set the rotation of the landscape about the z-axis.
void setFlagLandscape(const bool displayed)
Set flag for displaying Landscape.
float getAtmosphereFadeDuration() const
Get atmosphere fade duration in s.
bool loadLandscape(QMap< QString, QString > ¶m)
Load a landscape based on a hash of parameters mirroring the landscape.ini file and make it the curre...
QString installLandscapeFromArchive(QString pathToSourceArchive, const bool display=false, const bool forAllUsers=false)
Install a landscape from a ZIP archive.
QStringList getUserLandscapeIDs() const
Retrieve a list of the identifiers of all user-installed landscapes.
bool removeLandscape(const QString landscapeID)
This function removes a landscape from the user data directory.
Store and manages the displaying of the Landscape.
void errorNotArchive()
Emitted when the file passed to installLandscapeFromArchive() is not a ZIP archive or does not contai...
virtual void update(double deltaTime)
Update time-dependent state.
QString getCurrentLandscapeName() const
Get the current landscape name.
Compute and display the daylight sky color using openGL.
void setAtmosphereBortleLightPollution(const int bIndex)
Set the light pollution following the Bortle Scale.
void landscapesChanged()
Emitted when a landscape has been installed or un-installed.
float getLandscapeOpacity(Vec3d azalt) const
Forward opacity query to current landscape.
bool getFlagIllumination() const
Get flag for displaying illumination layer.
Vec3f getColorCardinalPoints() const
Get Cardinals Points color.
bool setCurrentLandscapeName(const QString &name, const double changeLocationDuration=1.0)
Change the current landscape to the landscape with the name specified.
Manages all the rendering at the level of the observer's surroundings.
bool getFlagUseLightPollutionFromDatabase() const
Return the value of flag usage light pollution (and bortle index) from locations database.
void setFlagFog(const bool displayed)
Set flag for displaying Fog.
Landscape * getCurrentLandscape() const
Get the current landscape object.
Main class for Stellarium core processing.
void setFlagLandscapeUseMinimalBrightness(bool b)
Set the value of the flag determining if a minimal brightness should be used to keep landscape visibl...
bool getFlagAtmosphereAutoEnable() const
Get flag for auto-enable of atmospheres for planets.
bool getFlagFog() const
Get flag for displaying Fog.
void setDefaultMinimalBrightness(const double b)
Set the minimal brightness value of the landscape.
QStringList getAllLandscapeNames() const
Retrieve a list of the names of all the available landscapes in the file search path sub-directories ...
bool getFlagLandscapeUseMinimalBrightness() const
Return the value of the flag determining if a minimal brightness should be used to keep landscape vis...
QStringList getAllLandscapeIDs() const
Retrieve a list of the identifiers of all the available landscapes in the file search path sub-direct...
bool getFlagLandscape() const
Get flag for displaying Landscape.
void setFlagCardinalsPoints(const bool displayed)
Set flag for displaying Cardinals Points.
QString getDescription() const
Return a pseudo HTML formatted string with information from description or ini file.
float getAtmosphereAverageLuminance() const
return average luminance [cd/m^2] of atmosphere. Around 10 at sunset, 6400 in daylight, >0 in dark night.
bool setCurrentLandscapeID(const QString &id, const double changeLocationDuration=1.0)
Change the current landscape to the landscape with the ID specified.
bool getFlagLandscapeAutoSelection() const
Get flag for autoselect of landscapes for planets.
void setFlagLandscapeSetsMinimalBrightness(bool b)
Sets the value of the flag determining if the minimal brightness should be taken from landscape...
quint64 loadLandscapeSize(const QString landscapeID) const
This function calculates and returns a landscape's disc size in bytes.
void setFlagLandscapeSetsLocation(bool b)
Set the value of the flag determining if a change of landscape will update the observer location...
const QString & getDefaultLandscapeID() const
Get the default landscape ID.
double getDefaultMinimalBrightness() const
Return the minimal brightness value of the landscape.
const QString & getCurrentLandscapeID() const
Get the current landscape ID.
Landscape * createFromFile(const QString &landscapeFile, const QString &landscapeId)
Create a new landscape from the files which describe it.
bool getFlagLandscapeSetsLocation() const
Return the value of the flag determining if a change of landscape will update the observer location...
virtual double getCallOrder(StelModuleActionName actionName) const
Get the order in which this module will draw its objects relative to other modules.
void setFlagIllumination(const bool on)
Set flag for displaying illumination layer.
StelModuleActionName
Define the possible action for which an order is defined.
QString loadLandscapeName(const QString landscapeID)
This function reads a landscape's name from its configuration file.
bool getFlagCardinalsPoints() const
Get flag for displaying Cardinals Points.
virtual void init()
Initialize the LandscapeManager class.
void errorNotUnique(QString nameOrID)
Emitted when installLandscapeFromArchive() tries to install a landscape with the same name or identif...
void setColorCardinalPoints(const Vec3f &v)
Set Cardinals Points color.
virtual float getOpacity(Vec3d azalt) const
can be used to find sunrise or visibility questions on the real-world landscape horizon.
bool getFlagAtmosphere() const
Get flag for displaying Atmosphere.
void setFlagAtmosphereAutoEnable(bool b)
Set flag for auto-enable atmosphere for planets with atmospheres in location window.
void setFlagAtmosphere(const bool displayed)
Set flag for displaying Atmosphere.
void errorRemoveManually(QString path)
Emitted when removeLandscape() is unable to remove all the files of a landscape.
void setAtmosphereFadeDuration(const float f)
Set atmosphere fade duration in s.
void errorUnableToOpen(QString path)
Emitted when installLandscapeFromArchive() can't read from, write to or create a file or a directory...
bool getFlagLandscapeSetsMinimalBrightness() const
Return the value of the flag determining if the minimal brightness should be taken from landscape...
bool getIsLandscapeFullyVisible() const
Get whether the landscape is currently visible. If true, object below landscape must be rendered...
float getLuminance() const
Return the global landscape luminance [0..1], for being used e.g for setting eye adaptation.
virtual void draw(StelCore *core)
Draw the landscape graphics, cardinal points and atmosphere.
int getAtmosphereBortleLightPollution() const
Get the light pollution following the Bortle Scale.
QString getCurrentLandscapeHtmlDescription() const
Return a pseudo HTML formatted string with all informations on the current landscape.
bool setDefaultLandscapeID(const QString &id)
Change the default landscape to the landscape with the ID specified.
This is the common base class for all the main components of stellarium.
void setFlagLandscapeAutoSelection(bool enableAutoSelect)
Set flag for autoselect of landscapes for planets.