![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure |
#include <LandscapeMgr.hpp>
Inherits StelModule.
Public Slots | |
QStringList | getAllLandscapeNames () const |
QStringList | getAllLandscapeIDs () const |
const QString & | getCurrentLandscapeID () const |
bool | setCurrentLandscapeID (const QString &id, bool inThread=false) |
QString | getCurrentLandscapeName () const |
bool | setCurrentLandscapeName (const QString &name, bool inThread=false) |
const QString & | getDefaultLandscapeID () const |
bool | setDefaultLandscapeID (const QString &id) |
QString | getCurrentLandscapeHtmlDescription () const |
bool | getFlagLandscape () const |
void | setFlagLandscape (bool b) |
bool | getFlagFog () const |
void | setFlagFog (bool b) |
bool | getFlagLandscapeSetsLocation () const |
void | setFlagLandscapeSetsLocation (bool b) |
bool | getFlagCardinalsPoints () const |
void | setFlagCardinalsPoints (bool b) |
Vec3f | getColorCardinalPoints () const |
void | setColorCardinalPoints (const Vec3f &v) |
bool | getFlagAtmosphere () const |
void | setFlagAtmosphere (bool b) |
float | getAtmosphereFadeDuration () const |
void | setAtmosphereFadeDuration (float f) |
void | setAtmosphereBortleLightPollution (int bIndex) |
void | setZRotation (double d) |
Signals | |
void | requestSetCurrentLandscapeID (const QString &id) |
void | requestCompleteSetCurrentLandscapeID (bool success) |
void | requestSetCurrentLandscapeName (const QString &name) |
void | requestCompleteSetCurrentLandscapeName (bool success) |
Public Member Functions | |
virtual void | init () |
virtual void | draw (StelCore *core) |
virtual void | update (double deltaTime) |
virtual void | updateI18n () |
virtual void | updateSkyCulture (const QString &skyCultureDir) |
virtual void | setStelStyle (const StelStyle &style) |
virtual double | getCallOrder (StelModuleActionName actionName) const |
float | getLuminance (void) |
bool | loadLandscape (QMap< QString, QString > ¶m) |
Landscape * | createFromFile (const QString &landscapeFile, const QString &landscapeId) |
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.
virtual void LandscapeMgr::init | ( | ) | [virtual] |
Initialize the LandscapeManager class.
Operations performed:
Implements StelModule.
virtual void LandscapeMgr::draw | ( | StelCore * | core | ) | [virtual] |
virtual void LandscapeMgr::update | ( | double | deltaTime | ) | [virtual] |
Update time-dependent state.
Includes:
Implements StelModule.
virtual void LandscapeMgr::updateI18n | ( | ) | [virtual] |
virtual void LandscapeMgr::updateSkyCulture | ( | const QString & | skyCultureDir | ) | [inline, virtual] |
Called for all registered modules if the sky culture changes.
skyCultureDir | the name of the directory containing the sky culture to use. |
Reimplemented from StelModule.
virtual void LandscapeMgr::setStelStyle | ( | const StelStyle & | style | ) | [virtual] |
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.
float LandscapeMgr::getLuminance | ( | void | ) |
Return the global landscape luminance, for being used e.g for setting eye adaptation.
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.
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. |
QStringList LandscapeMgr::getAllLandscapeNames | ( | ) | const [slot] |
Retrieve list of the names of all the available landscape in the file search path sub-directories of the landscape area.
QStringList LandscapeMgr::getAllLandscapeIDs | ( | ) | const [slot] |
Retrieve list of the names of all the available landscape in the file search path sub-directories of the landscape area.
const QString& LandscapeMgr::getCurrentLandscapeID | ( | ) | const [inline, slot] |
Get the current landscape ID.
bool LandscapeMgr::setCurrentLandscapeID | ( | const QString & | id, | |
bool | inThread = false | |||
) | [slot] |
Change the current landscape to the landscape with the ID specified.
id | the ID of the new landscape | |
inThread | should be false when this is called from a script or a thread outside the main program thread. Note that if inThread is false, the return value will always be true. The return value may be retrieved asynchronously by connecting the requestCompleteSetCurrentLandscapeID signal to the calling code. |
QString LandscapeMgr::getCurrentLandscapeName | ( | ) | const [slot] |
Get the current landscape name.
bool LandscapeMgr::setCurrentLandscapeName | ( | const QString & | name, | |
bool | inThread = false | |||
) | [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. | |
inThread | should be false when this is called from a script or a thread outside the main program thread. Note that if inThread is false, the return value will always be true. The return value may be retrieved asynchronously by connecting the requestCompleteSetCurrentLandscapeID signal to the calling code. |
const QString& LandscapeMgr::getDefaultLandscapeID | ( | ) | const [inline, slot] |
Get the default landscape ID.
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 |
QString LandscapeMgr::getCurrentLandscapeHtmlDescription | ( | ) | const [slot] |
Return a pseudo HTML formated string with all informations on the current landscape.
bool LandscapeMgr::getFlagLandscape | ( | ) | const [slot] |
Get flag for displaying Landscape.
void LandscapeMgr::setFlagLandscape | ( | bool | b | ) | [slot] |
Set flag for displaying Landscape.
bool LandscapeMgr::getFlagFog | ( | ) | const [slot] |
Get flag for displaying Fog.
void LandscapeMgr::setFlagFog | ( | bool | b | ) | [slot] |
Set flag for displaying Fog.
bool LandscapeMgr::getFlagLandscapeSetsLocation | ( | ) | const [inline, slot] |
Return the value of the flag determining if a change of landscape will update the observer location.
void LandscapeMgr::setFlagLandscapeSetsLocation | ( | bool | b | ) | [inline, slot] |
Set the value of the flag determining if a change of landscape will update the observer location.
bool LandscapeMgr::getFlagCardinalsPoints | ( | ) | const [slot] |
Get flag for displaying Cardinals Points.
void LandscapeMgr::setFlagCardinalsPoints | ( | bool | b | ) | [slot] |
Set flag for displaying Cardinals Points.
Vec3f LandscapeMgr::getColorCardinalPoints | ( | ) | const [slot] |
Get Cardinals Points color.
void LandscapeMgr::setColorCardinalPoints | ( | const Vec3f & | v | ) | [slot] |
Set Cardinals Points color.
bool LandscapeMgr::getFlagAtmosphere | ( | ) | const [slot] |
Get flag for displaying Atmosphere.
void LandscapeMgr::setFlagAtmosphere | ( | bool | b | ) | [slot] |
Set flag for displaying Atmosphere.
float LandscapeMgr::getAtmosphereFadeDuration | ( | ) | const [slot] |
Get atmosphere fade duration in s.
void LandscapeMgr::setAtmosphereFadeDuration | ( | float | f | ) | [slot] |
Set atmosphere fade duration in s.
void LandscapeMgr::setAtmosphereBortleLightPollution | ( | int | bIndex | ) | [slot] |
Set the light pollution following the Bortle Scale.
void LandscapeMgr::setZRotation | ( | double | 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. |