Stellarium 0.11.4 | |||
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
Manages all the rendering at the level of the observer's surroundings. More...
#include <LandscapeMgr.hpp>
Public Slots | |
QStringList | getAllLandscapeNames () const |
Retrieve a list of the names of all the available landscapes in the file search path sub-directories of the landscape area. | |
QStringList | getAllLandscapeIDs () const |
Retrieve a list of the identifiers of all the available landscapes in the file search path sub-directories of the landscape area. | |
QStringList | getUserLandscapeIDs () const |
Retrieve a list of the identifiers of all user-installed landscapes. | |
const QString & | getCurrentLandscapeID () const |
Get the current landscape ID. | |
bool | setCurrentLandscapeID (const QString &id) |
Change the current landscape to the landscape with the ID specified. | |
QString | getCurrentLandscapeName () const |
Get the current landscape name. | |
bool | setCurrentLandscapeName (const QString &name) |
Change the current landscape to the landscape with the name specified. | |
const QString & | getDefaultLandscapeID () const |
Get the default landscape ID. | |
bool | setDefaultLandscapeID (const QString &id) |
Change the default landscape to the landscape with the ID specified. | |
QString | getCurrentLandscapeHtmlDescription () const |
Return a pseudo HTML formated string with all informations on the current landscape. | |
QString | getDescription () const |
Return a pseudo HTML formated string with information from description or ini file. | |
bool | getFlagLandscape () const |
Get flag for displaying Landscape. | |
void | setFlagLandscape (const bool displayed) |
Set flag for displaying Landscape. | |
bool | getFlagFog () const |
Get flag for displaying Fog. | |
void | setFlagFog (const bool displayed) |
Set flag for displaying Fog. | |
bool | getFlagLandscapeSetsLocation () const |
Return the value of the flag determining if a change of landscape will update the observer location. | |
void | setFlagLandscapeSetsLocation (bool b) |
Set the value of the flag determining if a change of landscape will update the observer location. | |
bool | getFlagCardinalsPoints () const |
Get flag for displaying Cardinals Points. | |
void | setFlagCardinalsPoints (const bool displayed) |
Set flag for displaying Cardinals Points. | |
Vec3f | getColorCardinalPoints () const |
Get Cardinals Points color. | |
void | setColorCardinalPoints (const Vec3f &v) |
Set Cardinals Points color. | |
bool | getFlagAtmosphere () const |
Get flag for displaying Atmosphere. | |
void | setFlagAtmosphere (const bool displayed) |
Set flag for displaying Atmosphere. | |
float | getAtmosphereFadeDuration () const |
Get atmosphere fade duration in s. | |
void | setAtmosphereFadeDuration (float f) |
Set atmosphere fade duration in s. | |
void | setAtmosphereBortleLightPollution (int bIndex) |
Set the light pollution following the Bortle Scale. | |
int | getAtmosphereBortleLightPollution () |
Get the light pollution following the Bortle Scale. | |
void | setZRotation (float d) |
Set the rotation of the landscape about the z-axis. | |
QString | installLandscapeFromArchive (QString pathToSourceArchive, bool display=false, bool forAllUsers=false) |
Install a landscape from a ZIP archive. | |
bool | removeLandscape (QString landscapeID) |
Install a landscape from a directory. | |
QString | loadLandscapeName (QString landscapeID) |
This function reads a landscape's name from its configuration file. | |
quint64 | loadLandscapeSize (QString landscapeID) |
This function calculates and returns a landscape's disc size in bytes. | |
Signals | |
void | atmosphereDisplayedChanged (const bool displayed) |
void | cardinalsPointsDisplayedChanged (const bool displayed) |
void | fogDisplayedChanged (const bool displayed) |
void | landscapeDisplayedChanged (const bool displayed) |
void | landscapesChanged () |
Emitted when a landscape has been installed or un-installed. | |
void | errorUnableToOpen (QString path) |
Emitted when installLandscapeFromArchive() can't read from, write to or create a file or a directory. | |
void | errorNotArchive () |
Emitted when the file passed to installLandscapeFromArchive() is not a ZIP archive or does not contain a valid landscape. | |
void | errorNotUnique (QString nameOrID) |
Emitted when installLandscapeFromArchive() tries to install a landscape with the same name or identifier as an already installed one. | |
void | errorRemoveManually (QString path) |
Emitted when removeLandscape() is unable to remove all the files of a landscape. | |
Public Member Functions | |
virtual void | init () |
Initialize the LandscapeManager class. | |
virtual void | draw (StelCore *core) |
Draw the landscape graphics, cardinal points and atmosphere. | |
virtual void | update (double deltaTime) |
Update time-dependent state. | |
virtual double | getCallOrder (StelModuleActionName actionName) const |
Get the order in which this module will draw it's objects relative to other modules. | |
float | getLuminance () |
Return the global landscape luminance, for being used e.g for setting eye adaptation. | |
bool | loadLandscape (QMap< QString, QString > ¶m) |
Load a landscape based on a hash of parameters mirroring the landscape.ini file and make it the current landscape. | |
Landscape * | createFromFile (const QString &landscapeFile, const QString &landscapeId) |
Create a new landscape from the files which describe it. | |
Properties | |
bool | atmosphereDisplayed |
bool | cardinalsPointsDisplayed |
bool | fogDisplayed |
bool | landscapeDisplayed |
Manages all the rendering at the level of the observer's surroundings.
This includes landscape textures, fog, atmosphere and cardinal points. I decided to put all these elements together in a single class because they are inherently linked, especially when we start moving the observer in altitude.
Landscape* LandscapeMgr::createFromFile | ( | const QString & | landscapeFile, | |
const QString & | landscapeId | |||
) |
Create a new landscape from the files which describe it.
Reads a landscape.ini file which is passed as the first parameter, determines the landscape type, and creates a new object for the landscape of the proper type. The load member is then called, passing both parameters.
landscapeFile | This is the path to a landscape.ini file. | |
landscapeId | This is the landscape ID, which is also the name of the directory in which the files (textures and so on) for the landscape reside. |
virtual void LandscapeMgr::draw | ( | StelCore * | core | ) | [virtual] |
Draw the landscape graphics, cardinal points and atmosphere.
Reimplemented from StelModule.
void LandscapeMgr::errorNotArchive | ( | ) | [signal] |
Emitted when the file passed to installLandscapeFromArchive() is not a ZIP archive or does not contain a valid landscape.
(A way of moving the need for translatable error messages to the GUI.)
void LandscapeMgr::errorNotUnique | ( | QString | nameOrID | ) | [signal] |
Emitted when installLandscapeFromArchive() tries to install a landscape with the same name or identifier as an already installed one.
(A way of moving the need for translatable error messages to the GUI.)
nameOrID | the name or the identifier of the landscape |
void LandscapeMgr::errorRemoveManually | ( | QString | path | ) | [signal] |
Emitted when removeLandscape() is unable to remove all the files of a landscape.
(A way of moving the need for translatable error messages to the GUI.)
path | the path to the landscape's directory |
void LandscapeMgr::errorUnableToOpen | ( | QString | path | ) | [signal] |
Emitted when installLandscapeFromArchive() can't read from, write to or create a file or a directory.
(A way of moving the need for translatable error messages to the GUI.)
path | path to the file or directory |
QStringList LandscapeMgr::getAllLandscapeIDs | ( | ) | const [slot] |
Retrieve a list of the identifiers of all the available landscapes in the file search path sub-directories of the landscape area.
QStringList LandscapeMgr::getAllLandscapeNames | ( | ) | const [slot] |
Retrieve a list of the names of all the available landscapes in the file search path sub-directories of the landscape area.
int LandscapeMgr::getAtmosphereBortleLightPollution | ( | ) | [slot] |
Get the light pollution following the Bortle Scale.
float LandscapeMgr::getAtmosphereFadeDuration | ( | ) | const [slot] |
Get atmosphere fade duration in s.
virtual double LandscapeMgr::getCallOrder | ( | StelModuleActionName | actionName | ) | const [virtual] |
Get the order in which this module will draw it's objects relative to other modules.
Reimplemented from StelModule.
Vec3f LandscapeMgr::getColorCardinalPoints | ( | ) | const [slot] |
Get Cardinals Points color.
QString LandscapeMgr::getCurrentLandscapeHtmlDescription | ( | ) | const [slot] |
Return a pseudo HTML formated string with all informations on the current landscape.
const QString& LandscapeMgr::getCurrentLandscapeID | ( | ) | const [inline, slot] |
Get the current landscape ID.
QString LandscapeMgr::getCurrentLandscapeName | ( | ) | const [slot] |
Get the current landscape name.
const QString& LandscapeMgr::getDefaultLandscapeID | ( | ) | const [inline, slot] |
Get the default landscape ID.
QString LandscapeMgr::getDescription | ( | ) | const [slot] |
Return a pseudo HTML formated string with information from description or ini file.
bool LandscapeMgr::getFlagAtmosphere | ( | ) | const [slot] |
Get flag for displaying Atmosphere.
bool LandscapeMgr::getFlagCardinalsPoints | ( | ) | const [slot] |
Get flag for displaying Cardinals Points.
bool LandscapeMgr::getFlagFog | ( | ) | const [slot] |
Get flag for displaying Fog.
bool LandscapeMgr::getFlagLandscape | ( | ) | const [slot] |
Get flag for displaying Landscape.
bool LandscapeMgr::getFlagLandscapeSetsLocation | ( | ) | const [inline, slot] |
Return the value of the flag determining if a change of landscape will update the observer location.
float LandscapeMgr::getLuminance | ( | ) |
Return the global landscape luminance, for being used e.g for setting eye adaptation.
QStringList LandscapeMgr::getUserLandscapeIDs | ( | ) | const [slot] |
Retrieve a list of the identifiers of all user-installed landscapes.
Effectively, this returns the results of getAllLandscapeIDs() without the landscapes specified in the packagedLandscapeIDs list.
virtual void LandscapeMgr::init | ( | ) | [virtual] |
Initialize the LandscapeManager class.
Operations performed:
Implements StelModule.
QString LandscapeMgr::installLandscapeFromArchive | ( | QString | pathToSourceArchive, | |
bool | display = false , |
|||
bool | forAllUsers = false | |||
) | [slot] |
Install a landscape from a ZIP archive.
This function searches for a file named "landscape.ini" in the root directory of the archive. If it is not found there, the function searches inside the topmost sub-directories (if any), but no deeper. If a landscape configuration file is found:
The landscape identifier is either:
The landscape identifier must be unique.
pathToSourceArchive | path to the source archive file. | |
display | If true, the landscape will be set to be the current landscape after installation. | |
forAllUsers | If true, this function will try to install the landscape in a way that meakes it is available to all users of this computer. May require running Stellarium as an administrator (root) on some Windows or *nix systems. (NOT IMPLEMENTED!) |
void LandscapeMgr::landscapesChanged | ( | ) | [signal] |
Emitted when a landscape has been installed or un-installed.
For example, it is used to update the list of landscapes in the Sky and viewing options window (the ViewDialog class)
bool LandscapeMgr::loadLandscape | ( | QMap< QString, QString > & | param | ) |
Load a landscape based on a hash of parameters mirroring the landscape.ini file and make it the current landscape.
QString LandscapeMgr::loadLandscapeName | ( | QString | landscapeID | ) | [slot] |
This function reads a landscape's name from its configuration file.
landscapeID | an installed landscape's identifier (the folder name) |
quint64 LandscapeMgr::loadLandscapeSize | ( | QString | landscapeID | ) | [slot] |
This function calculates and returns a landscape's disc size in bytes.
It adds up the sizes of all files in the landscape's folder. It assumes that there are no sub-directories. (There shouldn't be any anyway.)
landscapeID | an installed landscape's identifier (the folder name) |
bool LandscapeMgr::removeLandscape | ( | QString | landscapeID | ) | [slot] |
Install a landscape from a directory.
Expected directory structure: the name of the directory that contains a landscape.ini file is assumed to be the landscape ID and should be unique. This directory and all files in it will be installed, but its subdirectories will be skipped along with any other files or directories in the archive.
pathToSourceLandscapeIni | path to a landscape.ini file. Its parent directory is assumed to be the landscape source directory. | |
display | If true, the landscape will be set to be the current landscape after installation. | |
forAllUsers | If true, this function will try to install the landscape in a way that meakes it is available to all users of this computer. May require running Stellarium as an administrator (root) on some Windows or *nix systems. (NOT IMPLEMENTED!) |
landscapeID | an installed landscape's identifier (the folder name) |
void LandscapeMgr::setAtmosphereBortleLightPollution | ( | int | bIndex | ) | [slot] |
Set the light pollution following the Bortle Scale.
void LandscapeMgr::setAtmosphereFadeDuration | ( | float | f | ) | [slot] |
Set atmosphere fade duration in s.
void LandscapeMgr::setColorCardinalPoints | ( | const Vec3f & | v | ) | [slot] |
Set Cardinals Points color.
bool LandscapeMgr::setCurrentLandscapeID | ( | const QString & | id | ) | [slot] |
Change the current landscape to the landscape with the ID specified.
id | the ID of the new landscape |
bool LandscapeMgr::setCurrentLandscapeName | ( | const QString & | name | ) | [slot] |
Change the current landscape to the landscape with the name specified.
name | the name of the new landscape, as found in the landscape:name key of the landscape.ini file. |
bool LandscapeMgr::setDefaultLandscapeID | ( | const QString & | id | ) | [slot] |
Change the default landscape to the landscape with the ID specified.
id | the ID of the landscape to use by default |
void LandscapeMgr::setFlagAtmosphere | ( | const bool | displayed | ) | [slot] |
Set flag for displaying Atmosphere.
void LandscapeMgr::setFlagCardinalsPoints | ( | const bool | displayed | ) | [slot] |
Set flag for displaying Cardinals Points.
void LandscapeMgr::setFlagFog | ( | const bool | displayed | ) | [slot] |
Set flag for displaying Fog.
void LandscapeMgr::setFlagLandscape | ( | const bool | displayed | ) | [slot] |
Set flag for displaying Landscape.
void LandscapeMgr::setFlagLandscapeSetsLocation | ( | bool | b | ) | [inline, slot] |
Set the value of the flag determining if a change of landscape will update the observer location.
void LandscapeMgr::setZRotation | ( | float | d | ) | [slot] |
Set the rotation of the landscape about the z-axis.
This is intended for special uses such as when the landscape consists of a vehicle which might change orientation over time (e.g. a ship).
d | the rotation angle in degrees as an offset from the originally loaded value. |
virtual void LandscapeMgr::update | ( | double | deltaTime | ) | [virtual] |
Update time-dependent state.
Includes:
Implements StelModule.